本文整理汇总了C++中TextView::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ TextView::getId方法的具体用法?C++ TextView::getId怎么用?C++ TextView::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextView
的用法示例。
在下文中一共展示了TextView::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFocusFlags
BYTE CMainFrame::getFocusFlags() {
BYTE result;
if(m_hasFocus) result |= MAINHASFOCUS;
TextView *view = getActiveTextView();
if(view) {
result |= (view->getId() == 0) ? PANEL0ACTIVE : PANEL1ACTIVE;
}
return result;
}
示例2: OnEditPaste
void CMainFrame::OnEditPaste() {
TextView *view = getActiveTextView();
if(view == NULL) {
return;
}
const String t = getClipboardText();
CWinDiffDoc *doc = view->getDocument();
doc->setDoc(view->getId(),DIFFDOC_BUF,t);
view->refreshBoth();
}
示例3: ajourMenuItems
void CMainFrame::ajourMenuItems() {
TextView *view = getActiveTextView();
bool hasView = view != NULL;
CWinDiffDoc *doc = getDoc();
const Diff &diff = doc->m_diff;
if(!hasView) {
enableMenuItem(this, ID_EDIT_COPY , false);
enableMenuItem(this, ID_EDIT_SELECTALL , false);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND , false);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT , false);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV , false);
enableToolbarButtonAndMenuItem(ID_EDIT_PREV_DIFF , false);
enableMenuItem(this, ID_EDIT_GOTO , false);
enableMenuItem(this, ID_EDIT_REFRESHFILES , false);
enableMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL , false);
enableToolbarButtonAndMenuItem(ID_EDIT_NEXT_DIFF , false);
enableToolbarButtonAndMenuItem(ID_EDIT_SHOWDETAILS , false);
showStatusBarPanes(false);
} else {
const bool hasText = !diff.getDoc(view->getId()).isEmpty();
enableMenuItem(this, ID_EDIT_COPY , !view->getSelectedRange().isEmpty());
enableMenuItem(this, ID_EDIT_SELECTALL , hasText);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND , hasText);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT , hasText);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT , hasText);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV , hasText);
enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV , hasText);
enableMenuItem(this, ID_EDIT_GOTO , hasText);
enableMenuItem(this, ID_EDIT_REFRESHFILES , diff.hasFileDoc());
enableMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL , doc->m_filter.hasLineFilter());
if(!doc->m_filter.hasLineFilter()) {
checkMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL, false);
}
enableToolbarButtonAndMenuItem( ID_EDIT_SHOWDETAILS , !diff.isEmpty() && !diff.getDiffLines()[view->getCurrentLine()].linesAreEqual());
enableToolbarButtonAndMenuItem( ID_EDIT_PREV_DIFF , !diff.isEmpty() && (view->getCurrentLine() > diff.getFirstDiffLine()));
enableToolbarButtonAndMenuItem( ID_EDIT_NEXT_DIFF , !diff.isEmpty() && (view->getCurrentLine() < diff.getLastDiffLine()));
showStatusBarPanes(!diff.isEmpty());
}
updateNameFontSizeMenuItems(getOptions().m_nameFontSizePct);
}
示例4: onFileMruFile
void CMainFrame::onFileMruFile(int index) {
TextView *view = getActiveTextView();
if(view == NULL) return;
try {
const String fname = theApp.getRecentFile(index);
if(ACCESS(fname, 4) < 0) {
const int errorCode = errno;
showWarning(getErrnoText());
if(errorCode == ENOENT) {
theApp.removeFromRecentFiles(index);
}
return;
}
CWinDiffDoc *doc = view->getDocument();
doc->setDoc(view->getId(),DIFFDOC_FILE, fname);
Invalidate(FALSE);
//view->refreshBoth();
} catch(Exception e) {
showException(e);
}
}
示例5: OnEditShowDetails
void CMainFrame::OnEditShowDetails() {
if(!isToolbarButtonEnabled(ID_EDIT_SHOWDETAILS)) {
return;
}
TextView *view = getActiveTextView();
if(view == NULL) {
return;
}
if(!view->hasPartner()) {
return;
}
String s1, s2;
if(view->getId() == 0) {
s1 = view->getCurrentString();
s2 = view->getPartner()->getCurrentString();
} else {
s2 = view->getCurrentString();
s1 = view->getPartner()->getCurrentString();
}
CZoomDlg dlg(s1,s2, view);
dlg.DoModal();
}