本文整理汇总了C++中TextView::getSelectedRange方法的典型用法代码示例。如果您正苦于以下问题:C++ TextView::getSelectedRange方法的具体用法?C++ TextView::getSelectedRange怎么用?C++ TextView::getSelectedRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextView
的用法示例。
在下文中一共展示了TextView::getSelectedRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}