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


C++ TextView::getId方法代码示例

本文整理汇总了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;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:9,代码来源:MainFrm.cpp

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

示例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);
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:48,代码来源:MainFrm.cpp

示例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);
  }
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:22,代码来源:MainFrm.cpp

示例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();
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:23,代码来源:MainFrm.cpp


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