本文整理汇总了C++中TextView::getCurrentPos方法的典型用法代码示例。如果您正苦于以下问题:C++ TextView::getCurrentPos方法的具体用法?C++ TextView::getCurrentPos怎么用?C++ TextView::getCurrentPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextView
的用法示例。
在下文中一共展示了TextView::getCurrentPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doPreTranslateMessage
BOOL CMainFrame::doPreTranslateMessage(MSG *pMsg) {
const BOOL ret = __super::PreTranslateMessage(pMsg);
TextView *view = getActiveTextView();
if(view == NULL) return ret;
const TextPosition pos = view->getCurrentPos();
m_wndStatusBar.SetPaneText(4, format(_T("Ln %d, Col %d"), pos.m_line+1, pos.m_column+1).cstr());
const TCHAR *msgStr = NULL;
switch(pMsg->message) {
case WM_PAINT : msgStr = _T("WM_PAINT") ; break;
case WM_NCMOUSEMOVE: msgStr = _T("WM_NCMOUSEMOVE"); break;
case WM_SIZING : msgStr = _T("WM_SIZING") ; break;
case WM_SIZE : msgStr = _T("WM_SIZE") ; break;
case 118 : msgStr = _T("msg(118)") ; break;
}
if(m_statusPanesVisible && msgStr) {
CRect rect;
m_wndStatusBar.GetItemRect(1,&rect);
CStatusBarCtrl &statusBar = m_wndStatusBar.GetStatusBarCtrl();
CClientDC dc(&statusBar);
m_wndStatusBar.SetPaneText(1,EMPTYSTRING);
textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Deleted lines"), *statusBar.GetFont(), BLUE);
m_wndStatusBar.GetItemRect(2,&rect);
m_wndStatusBar.SetPaneText(2,EMPTYSTRING);
textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Changed lines"), *statusBar.GetFont(), RED);
m_wndStatusBar.GetItemRect(3,&rect);
m_wndStatusBar.SetPaneText(3,EMPTYSTRING);
textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Inserted lines"), *statusBar.GetFont(), GREEN);
}
return ret;
}