这篇教程C++ GetLastPosition函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetLastPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLastPosition函数的具体用法?C++ GetLastPosition怎么用?C++ GetLastPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetLastPosition函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SelectAll//---------------------------------------------------------void CINFO_Messages::On_Copy(wxCommandEvent &WXUNUSED(event)){ if( GetStringSelection().IsEmpty() ) { SelectAll(); Copy(); SetSelection(GetLastPosition(), GetLastPosition()); } else { Copy(); }}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:14,
示例2: GetLastPositionvoid wxTextCtrl::SetInsertionPointEnd(){ wxTextPos lPos = GetLastPosition(); // // We must not do anything if the caret is already there because calling // SetInsertionPoint() thaws the controls if Freeze() had been called even // if it doesn't actually move the caret anywhere and so the simple fact of // doing it results in horrible flicker when appending big amounts of text // to the control in a few chunks (see DoAddText() test in the text sample) // if (GetInsertionPoint() == GetLastPosition()) return; SetInsertionPoint(lPos);} // end of wxTextCtrl::SetInsertionPointEnd
开发者ID:EdgarTx,项目名称:wx,代码行数:15,
示例3: LineFromPositionvoid Edit::OnGoto (wxCommandEvent &WXUNUSED(event)) { const int lastLine = LineFromPosition(GetLastPosition()); long line = wxGetNumberFromUser(wxT(""), wxT("Goto line:"), wxT("Goto Line"), 1, 1, 1000000, this); if(line <= lastLine) { GotoLine(line - 1); }}
开发者ID:8l,项目名称:objeck-lang,代码行数:7,
示例4: GetLastPositionvoid psLinearMovement::SetSoftDRData (bool on_ground, csVector3& pos, float yrot, iSector *sector, csVector3& vel, csVector3& worldVel, float ang_vel){ if (colldet) colldet->SetOnGround (on_ground); csVector3 cur_pos; float cur_rot; iSector *cur_sect; GetLastPosition (cur_pos, cur_rot, cur_sect); if (cur_sect == sector) { offset_err = pos - cur_pos; // Check for NaN conditions: if (offset_err.x != offset_err.x) offset_err.x = 0.0f; if (offset_err.y != offset_err.y) offset_err.y = 0.0f; if (offset_err.z != offset_err.z) offset_err.z = 0.0f; offset_rate = offset_err; SetPosition (cur_pos, yrot, sector); } else { offset_rate = offset_err = csVector3 (0.0f, 0.0f ,0.0f); SetPosition (pos, yrot, sector); } SetVelocity (vel); ClearWorldVelocity (); AddVelocity (worldVel); csVector3 rot (0.0f, ang_vel, 0.0f); SetAngularVelocity (rot); lastDRUpdate = csGetTicks ();}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:34,
示例5: GetLastPositionlong luConsoleEdit::getLastPromptPos(){ long x = 0, y = 0; long last = GetLastPosition(); if (!PositionToXY(last, &x, &y)) return 0; return XYToPosition(0, y);}
开发者ID:Ali-il,项目名称:gamekit,代码行数:9,
示例6: GetLastPositionvoid wxComboBox::SetInsertionPointEnd(){ // setting insertion point doesn't make sense for read only comboboxes if ( !(GetWindowStyle() & wxCB_READONLY) ) { wxTextPos pos = GetLastPosition(); SetInsertionPoint(pos); }}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:9,
示例7: IsOnGroundvoid psLinearMovement::GetDRData (bool& on_ground, csVector3& pos, float& yrot, iSector*& sector, csVector3& vel, csVector3& worldVel, float& ang_vel){ on_ground = IsOnGround (); GetLastPosition (pos, yrot, sector); vel = velBody; ang_vel = angularVelocity.y; worldVel = this->velWorld;}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:10,
示例8: wxCHECK_RETvoid wxComboBox::SetInsertionPoint( long pos ){ wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); if ( pos == GetLastPosition() ) pos = -1; GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:10,
示例9: GetLastPositionvoid wxTextEntry::SetInsertionPoint(long pos){ // calling DoSetSelection(-1, -1) would select everything which is not what // we want here if ( pos == -1 ) pos = GetLastPosition(); // be careful to call DoSetSelection() which is overridden in wxTextCtrl // and not just SetSelection() here DoSetSelection(pos, pos);}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:11,
示例10: SetEditablevoid PythonIOCtrl::OnUserInput(wxKeyEvent& ke){ if(ke.GetModifiers()==wxMOD_CONTROL) {// wxMessageBox(_T("control pressed"));// wxMessageBox(wxString::Format(_("Key: %i"),ke.GetKeyCode()));// if(ke.GetKeyCode()==4)// {// m_pyctrl->DispatchCode(GetValue()); // would need to retrieve the code control's value//// if(m_pyctrl->DispatchCode(GetValue()))//// ChangeValue(_T(""));// return;// } if(ke.GetKeyCode()==5) { m_pyctrl->BreakCode(); return; } } if(ke.GetKeyCode()==WXK_RETURN) { if(!ke.ShiftDown() && !ke.ControlDown()) { if(m_line_entry_mode) { m_line_entry_mode=false; SetEditable(false); wxString line; if(m_line_entry_point<GetLastPosition()) line=GetRange(m_line_entry_point,GetLastPosition()); line.Replace(_T("/n"),_T("")); //will cause major problems if there is more than one line feed returned here, so we remove them (TODO: fix on server side?? server should treat buffered lines as new input without errors) line.Replace(_T("/r"),_T("")); line.Append(_T("/n")); AppendText(_T("/n")); m_pyctrl->stdin_append(line); m_pyctrl->Continue(); } } } ke.Skip();}
开发者ID:KinKir,项目名称:codeblocks-python,代码行数:41,
示例11: SharedCaretStateSharedCaretState TextFormulaNode::GetPreviousPosition(SharedCaretState& relativeState){ if (relativeState && relativeState->CheckInNode(this)) { int pos = relativeState->GetPos(); if (pos > 0) return SharedCaretState(new CaretState(this, pos - 1)); return parent->GetPreviousPosition(relativeState); } return GetLastPosition();}
开发者ID:denprog,项目名称:NaturalCalculator,代码行数:12,
示例12: AppendText void AppendText(const wxString& text, int lineCount, const CHARFORMAT2& cf) { HWND hwnd = (HWND)GetHWND(); CHARRANGE range; range.cpMin = GetLastPosition(); range.cpMax = range.cpMin; ::SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&range); ::SendMessage(hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); m_updatesCount = -2; // suppress any update event ::SendMessage(hwnd, EM_REPLACESEL, 0, (LPARAM)text.c_str()); ::SendMessage(hwnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)lineCount); }
开发者ID:bartojak,项目名称:osp-filezilla,代码行数:13,
示例13: GetLastPositionvoid console::ted_log::OnLOGMessage(wxCommandEvent& evt) { wxColour logColour; long int startPos = GetLastPosition(); switch (evt.GetInt()) { case MT_INFO: *this << rply_mark << evt.GetString() << wxT("/n"); logColour = *wxBLACK;// logColour = *wxGREEN; break; case MT_ERROR: *this << rply_mark << evt.GetString() << wxT("/n"); logColour = *wxRED; break; case MT_COMMAND: *this << cmd_mark << evt.GetString() << wxT("/n"); break; case MT_GUIPROMPT: *this << gui_mark; break; case MT_GUIINPUT: *this << evt.GetString();break; case MT_EOL: *this << wxT("/n"); break; case MT_WARNING: *this << rply_mark << evt.GetString() << wxT("/n"); logColour = *wxBLUE; break; case MT_CELLNAME: *this << rply_mark << wxT(" Cell ") << evt.GetString() << wxT("/n"); break; case MT_DESIGNNAME: *this << rply_mark << wxT(" Design ") << evt.GetString() << wxT("/n"); break; default: assert(false);/*wxLogTextCtrl::DoLog(evt.GetInt(), evt.GetString(), evt.GetExtraLong());*/ } long int endPos = GetLastPosition(); SetStyle(startPos,endPos,wxTextAttr(logColour));}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:39,
示例14: GetTotalRangebool CHttpRanges::GetTotalRange(CHttpRange& range) const{ if (m_ranges.empty()) return false; uint64_t firstPosition, lastPosition; if (!GetFirstPosition(firstPosition) || !GetLastPosition(lastPosition)) return false; range.SetFirstPosition(firstPosition); range.SetLastPosition(lastPosition); return range.IsValid();}
开发者ID:Distrotech,项目名称:xbmc,代码行数:14,
示例15: moText2Wxvoid moLogTextCtrl::LogError( moText p_message ) { wxString w = moText2Wx( p_message ); if (GetNumberOfLines()>10000) { Clear(); } SetDefaultStyle( wxTextAttr( wxColour(255,0,0) ) ); AppendText(w + wxT("/n")); ShowPosition( GetLastPosition() );}
开发者ID:inaes-tic,项目名称:tv-moldeo,代码行数:14,
示例16: SetSelectionvoid Edit::OnFindReplaceDialog(wxFindDialogEvent& event){ const wxEventType type = event.GetEventType(); const wxString find_string = m_FindData.GetFindString(); int found_start, found_end; if (type == wxEVT_FIND || type == wxEVT_FIND_NEXT) { // search if (FindText(found_start, found_end, type == wxEVT_FIND_NEXT)) { SetSelection(found_start, found_end); } else { wxMessageDialog dialog(this, wxT("Cannot find the text /"" + find_string + "/" from current position"), wxT("Find")); dialog.ShowModal(); } } else if (type == wxEVT_FIND_REPLACE) { ReplaceText(find_string); } else if (type == wxEVT_FIND_REPLACE_ALL) { const wxString replace_string = m_FindData.GetReplaceString(); int start_index = 0; bool found = true; int found_count = 0; do { // set search area SetTargetStart(start_index); SetTargetEnd(GetLastPosition()); // search and replace found_start = SearchInTarget(find_string); if (found_start > -1) { found_end = found_start + find_string.size(); SetTargetStart(found_start); SetTargetEnd(found_end); ReplaceTarget(replace_string); start_index = found_start + replace_string.size(); found_count++; } else { found = false; } } while (found); const wxString message = wxString::Format(wxT("%d occurrence(s) of /"%s/" were replaced with /"%s/"."), found_count, find_string, replace_string); wxMessageDialog replace_dialog(this, message, wxT("Replaced Text")); replace_dialog.ShowModal(); }}
开发者ID:8l,项目名称:objeck-lang,代码行数:50,
示例17: GetFirstPositionSharedCaretState RootFormulaNode::GetNextPosition(SharedCaretState& relativeState){ SharedCaretState res; if (!relativeState) res = GetFirstPosition(); else { int i = -1; FormulaNode* node = relativeState->GetNode(); if (!relativeState->CheckAtLast(this)) { if (node == this) { i = relativeState->GetPos(); FormulaNode* n = (*this)[i == childNodes->Count() ? i - 1 : i]; res = n->GetNextPosition(relativeState); if (res) return res; if (i == childNodes->Count() - 1 && !dynamic_cast<EmptyFormulaNode*>(n)) return SharedCaretState(new CaretState(this, i + 1)); } else i = GetFirstLevelChildPos(node); } else if (node == this && parent) res = parent->GetNextPosition(relativeState); else i = GetFirstLevelChildPos(node); if (i != -1) { if (i + 1 < childNodes->Count()) { FormulaNode* n = (*this)[i + 1]; res = n->GetNextPosition(relativeState); if (!res && n->CanSetCaret()) res = SharedCaretState(new CaretState(this, i + 1)); } else if (!IsEmptySymbol() && i == childNodes->Count() - 1 && *relativeState != *GetLastPosition()) return SharedCaretState(new CaretState(this, i + 1)); } if (!res && parent) return parent->GetNextPosition(relativeState); } return res;}
开发者ID:denprog,项目名称:NaturalCalculator,代码行数:49,
示例18: LineInputRequestvoid PythonIOCtrl::LineInputRequest(){ if(!m_line_entry_mode) { m_line_entry_mode=true; m_line_entry_point=GetLastPosition(); SetSelection(m_line_entry_point,m_line_entry_point); SetEditable(true); SetFocus(); InfoWindow::Display(_("Python Interpreter Input Requested"), _("An interpreter has needs keyboard input in its I/O window to proceed"), 8000); }}
开发者ID:KinKir,项目名称:codeblocks-python,代码行数:15,
示例19: _Add_Text//---------------------------------------------------------void CINFO_Messages::_Add_Text(wxString Text){ int i, n; if( m_MaxLength <= (int)(GetLastPosition() + Text.Length()) ) { for(i=0, n=0; i<GetNumberOfLines() && n<(int)Text.Length(); i++) { n += 1 + GetLineLength(i); } Remove(0, n + 1); } AppendText(Text);}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:17,
示例20: wxCHECK_RETvoid wxComboBox::SetInsertionPoint( long pos ){ wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); if ( pos == GetLastPosition() ) pos = -1; GtkEntry *entry = NULL;#ifdef __WXGTK24__ if (!gtk_check_version(2,4,0)) entry = GTK_ENTRY( GTK_BIN(m_widget)->child ); else#endif entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry ); gtk_entry_set_position( entry, (int)pos );}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:17,
示例21: GetLastPositionSharedCaretState CompoundFormulaNode::GetPreviousPosition(SharedCaretState& relativeState){ SharedCaretState res; if (!relativeState) res = GetLastPosition(); else { if (relativeState->CheckInNode(this)) { int i; FormulaNode* n; FormulaNode* node = relativeState->GetNode(); if (!relativeState->CheckAtLast(this)) { if (node == this) { i = relativeState->GetPos(); n = (*this)[i == childNodes->Count() ? i - 1 : i]; res = n->GetPreviousPosition(relativeState); if (res) return res; } else i = GetFirstLevelChildPos(node); } else i = childNodes->Count(); for (int pos = i - 1; pos >= 0; --pos) { n = (*this)[pos]; res = n->GetPreviousPosition(); if (res) break; } if (!res) res = SharedCaretState(new CaretState(parent, parent->GetChildPos(this))); } } return res;}
开发者ID:denprog,项目名称:NaturalCalculator,代码行数:44,
示例22: GetLastPositionSharedCaretState RootFormulaNode::GetPreviousPosition(SharedCaretState& relativeState){ SharedCaretState res; if (!relativeState) res = GetLastPosition(); else { int i; FormulaNode* n; FormulaNode* node = relativeState->GetNode(); if (node == this) { i = relativeState->GetPos(); n = (*this)[i == childNodes->Count() ? i - 1 : i]; res = n->GetPreviousPosition(relativeState); if (res) return res; } else i = GetFirstLevelChildPos(node); for (int pos = i - 1; pos >= 0; --pos) { n = (*this)[pos]; res = n->GetPreviousPosition(); if (res) break; } if (!res && parent) return parent->GetPreviousPosition(relativeState); } return res;}
开发者ID:denprog,项目名称:NaturalCalculator,代码行数:36,
示例23: OnUpdateSelectAllvoid wxTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event){ event.Enable(GetLastPosition() > 0);}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:4,
示例24: SetInsertionPointvoid wxTextCtrl::SetInsertionPointEnd(){ if ( GetInsertionPoint() != GetLastPosition() ) SetInsertionPoint(GetLastPosition());}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:5,
示例25: switchbool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event){ // we have a native implementation for Win32 and so don't need this one#ifndef __WIN32__ wxChar ch = 0; int keycode = event.GetKeyCode(); switch ( keycode ) { case WXK_NUMPAD0: case WXK_NUMPAD1: case WXK_NUMPAD2: case WXK_NUMPAD3: case WXK_NUMPAD4: case WXK_NUMPAD5: case WXK_NUMPAD6: case WXK_NUMPAD7: case WXK_NUMPAD8: case WXK_NUMPAD9: ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0); break; case WXK_MULTIPLY: case WXK_NUMPAD_MULTIPLY: ch = _T('*'); break; case WXK_ADD: case WXK_NUMPAD_ADD: ch = _T('+'); break; case WXK_SUBTRACT: case WXK_NUMPAD_SUBTRACT: ch = _T('-'); break; case WXK_DECIMAL: case WXK_NUMPAD_DECIMAL: ch = _T('.'); break; case WXK_DIVIDE: case WXK_NUMPAD_DIVIDE: ch = _T('/'); break; case WXK_DELETE: case WXK_NUMPAD_DELETE: // delete the character at cursor { const long pos = GetInsertionPoint(); if ( pos < GetLastPosition() ) Remove(pos, pos + 1); } break; case WXK_BACK: // delete the character before the cursor { const long pos = GetInsertionPoint(); if ( pos > 0 ) Remove(pos - 1, pos); } break; default:#if wxUSE_UNICODE if ( event.GetUnicodeKey() ) { ch = event.GetUnicodeKey(); } else#endif if ( keycode < 256 && keycode >= 0 && wxIsprint(keycode) ) { // FIXME this is not going to work for non letters... if ( !event.ShiftDown() ) { keycode = wxTolower(keycode); } ch = (wxChar)keycode; } else { ch = _T('/0'); } } if ( ch ) { WriteText(ch); return true; }#else // __WIN32__ wxUnusedVar(event);#endif // !__WIN32__/__WIN32__ return false;//.........这里部分代码省略.........
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:101,
示例26: SetSelectionvoid wxComboBox::SelectAll(){ SetSelection(0, GetLastPosition());}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:4,
示例27: OnUpdateSelectAllvoid wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event){ event.Enable(GetLastPosition() > 0);}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:4,
注:本文中的GetLastPosition函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetLayer函数代码示例 C++ GetLastErrorText函数代码示例 |