Exemplo n.º 1
0
void CMainFrame::OnOptionsDefineRegex() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  RegexFilter param = getOptions().m_regexFilter;
  CRegexDlg dlg(param);
  if(dlg.DoModal() == IDOK) {
    getOptions().m_regexFilter = param;
    if(isMenuItemChecked(this, ID_OPTIONS_IGNOREREGEX)) {
      view->setIgnoreRegex(true);
    }
  }
}
Exemplo n.º 2
0
void CMainFrame::OnOptionsIgnoreRegex() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  if(!isMenuItemChecked(this, ID_OPTIONS_IGNOREREGEX)) {
    const Options &options = getOptions();
    if(options.m_regexFilter.isEmpty()) {
      OnOptionsDefineRegex();
    }
    if(options.m_regexFilter.isEmpty()) {
      return;
    }
  }
  view->setIgnoreRegex(toggleMenuItem(this, ID_OPTIONS_IGNOREREGEX));
}