void QuickFindBar::OnShowReplaceControls(wxFlatButtonEvent& e) { if(e.IsChecked()) { m_replaceWith->Show(); m_buttonReplace->Show(); } else { m_replaceWith->Hide(); m_buttonReplace->Hide(); } m_bar->GetSizer()->Layout(); }
void QuickFindBar::OnHighlightMatches(wxFlatButtonEvent& e) { bool checked = e.IsChecked(); LEditor* editor = dynamic_cast<LEditor*>(m_sci); if(checked && editor) { int flags = DoGetSearchFlags(); wxString findwhat = m_findWhat->GetValue(); if(!m_sci || m_sci->GetLength() == 0 || findwhat.IsEmpty()) return; // Do we have at least one match? if(m_sci->FindText(0, m_sci->GetLastPosition(), findwhat, flags) == wxNOT_FOUND) return; m_sci->ClearSelections(); m_sci->SetCurrentPos(0); m_sci->SetSelectionEnd(0); m_sci->SetSelectionStart(0); editor->SetFindBookmarksActive(true); editor->DelAllMarkers(smt_find_bookmark); while(true) { m_sci->SearchAnchor(); if(m_sci->SearchNext(flags, findwhat) != wxNOT_FOUND) { int selStart, selEnd; m_sci->GetSelection(&selStart, &selEnd); m_sci->SetIndicatorCurrent(MARKER_WORD_HIGHLIGHT); m_sci->IndicatorFillRange(selStart, selEnd - selStart); m_sci->MarkerAdd(m_sci->LineFromPosition(selStart), smt_find_bookmark); // Clear the selection so the next 'SearchNext' will search forward m_sci->SetCurrentPos(selEnd); m_sci->SetSelectionEnd(selEnd); m_sci->SetSelectionStart(selEnd); } else { break; } } } else { if(editor) { editor->DelAllMarkers(smt_find_bookmark); editor->SetFindBookmarksActive(false); } } clMainFrame::Get()->SelectBestEnvSet(); // Updates the statusbar display }
void QuickFindBar::OnHighlightMatches(wxFlatButtonEvent& e) { bool checked = e.IsChecked(); LEditor* editor = dynamic_cast<LEditor*>(m_sci); if(checked && editor) { editor->SetFindBookmarksActive(true); DoMarkAll(); } else { if(editor) { editor->DelAllMarkers(smt_find_bookmark); editor->SetFindBookmarksActive(false); } } clMainFrame::Get()->SelectBestEnvSet(); // Updates the statusbar display }
void QuickFindBar::OnRegex(wxFlatButtonEvent& event) { m_regexType = event.IsChecked() ? kRegexPosix : kRegexNone; }