• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetLastPosition函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetLastPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLastPosition函数的具体用法?C++ GetLastPosition怎么用?C++ GetLastPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetLastPosition函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SetSelection

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


示例17: GetFirstPosition

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


示例18: LineInputRequest

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


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


示例20: wxCHECK_RET

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetLayer函数代码示例发布时间:2022-05-30
下一篇:
C++ GetLastErrorText函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap