本文整理汇总了C++中GetLastPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLastPosition函数的具体用法?C++ GetLastPosition怎么用?C++ GetLastPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetLastPosition函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectAll
//---------------------------------------------------------
void CINFO_Messages::On_Copy(wxCommandEvent &WXUNUSED(event))
{
if( GetStringSelection().IsEmpty() )
{
SelectAll();
Copy();
SetSelection(GetLastPosition(), GetLastPosition());
}
else
{
Copy();
}
}
示例2: GetLastPosition
void 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
示例3: LineFromPosition
void 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);
}
}
示例4: GetLastPosition
void 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 ();
}
示例5: GetLastPosition
long luConsoleEdit::getLastPromptPos()
{
long x = 0, y = 0;
long last = GetLastPosition();
if (!PositionToXY(last, &x, &y))
return 0;
return XYToPosition(0, y);
}
示例6: GetLastPosition
void wxComboBox::SetInsertionPointEnd()
{
// setting insertion point doesn't make sense for read only comboboxes
if ( !(GetWindowStyle() & wxCB_READONLY) )
{
wxTextPos pos = GetLastPosition();
SetInsertionPoint(pos);
}
}
示例7: IsOnGround
void 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;
}
示例8: wxCHECK_RET
void 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 );
}
示例9: GetLastPosition
void 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);
}
示例10: SetEditable
void 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();
}
示例11: SharedCaretState
SharedCaretState 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();
}
示例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);
}
示例13: GetLastPosition
void 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));
}
示例14: GetTotalRange
bool 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();
}
示例15: moText2Wx
void 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() );
}