当前位置: 首页>>代码示例>>C++>>正文


C++ GetLastPosition函数代码示例

本文整理汇总了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();
	}
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:14,代码来源:info_messages.cpp

示例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
开发者ID:EdgarTx,项目名称:wx,代码行数:15,代码来源:textctrl.cpp

示例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);
  }
}
开发者ID:8l,项目名称:objeck-lang,代码行数:7,代码来源:edit.cpp

示例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 ();
}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:34,代码来源:linmove.cpp

示例5: GetLastPosition

long 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,代码来源:luOutputs.cpp

示例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);
    }
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:9,代码来源:combobox.cpp

示例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;
}
开发者ID:Chettie,项目名称:Eulora-client,代码行数:10,代码来源:linmove.cpp

示例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 );
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:10,代码来源:combobox.cpp

示例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);
}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:11,代码来源:textentry.cpp

示例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();
}
开发者ID:KinKir,项目名称:codeblocks-python,代码行数:41,代码来源:PythonInterpCtrl.cpp

示例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();
}
开发者ID:denprog,项目名称:NaturalCalculator,代码行数:12,代码来源:TextFormulaNode.cpp

示例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,代码来源:StatusView.cpp

示例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));
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:39,代码来源:outbox.cpp

示例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();
}
开发者ID:Distrotech,项目名称:xbmc,代码行数:14,代码来源:HttpRangeUtils.cpp

示例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() );

}
开发者ID:inaes-tic,项目名称:tv-moldeo,代码行数:14,代码来源:moLogNotebook.cpp


注:本文中的GetLastPosition函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。