@@ -88,35 +88,36 @@ QuickFindBar::QuickFindBar(wxWindow* parent, wxWindowID id)
88
88
// -------------------------------------------------------------
89
89
m_bar->SetExpandableColumn (5 );
90
90
GetSizer ()->Add (m_bar, 1 , wxEXPAND | wxALL, 2 );
91
- QuickFindBarImages images;
92
91
93
92
// Add the 'close' button
94
- m_closeButton = m_bar->AddButton (" " , images.Bitmap (" find-bar-close-16" ), wxSize (24 , -1 ));
93
+ BitmapLoader* bmps = clGetManager ()->GetStdIcons ();
94
+
95
+ m_closeButton = m_bar->AddButton (" " , bmps->LoadBitmap (" x-close" ), wxSize (24 , -1 ));
95
96
m_closeButton->SetToolTip (_ (" Close" ));
96
97
m_closeButton->Bind (wxEVT_KEY_DOWN, &QuickFindBar::OnKeyDown, this );
97
98
m_closeButton->Bind (wxEVT_CMD_FLATBUTTON_CLICK, &QuickFindBar::OnHideBar, this );
98
99
99
100
// Add the 'case sensitive' button
100
- m_caseSensitive = m_bar->AddButton (" " , images. Bitmap (" case-sensitive" ), wxSize (24 , -1 ));
101
+ m_caseSensitive = m_bar->AddButton (" " , bmps-> LoadBitmap (" case-sensitive" ), wxSize (24 , -1 ));
101
102
m_caseSensitive->SetTogglable (true );
102
103
m_caseSensitive->SetToolTip (_ (" Case sensitive match" ));
103
104
m_caseSensitive->Bind (wxEVT_KEY_DOWN, &QuickFindBar::OnKeyDown, this );
104
105
105
106
// Add the 'whole word' button
106
- m_wholeWord = m_bar->AddButton (" " , images. Bitmap ( " word" ), wxSize (24 , -1 ));
107
+ m_wholeWord = m_bar->AddButton (" " , bmps-> LoadBitmap ( " whole- word" ), wxSize (24 , -1 ));
107
108
m_wholeWord->SetTogglable (true );
108
109
m_wholeWord->SetToolTip (_ (" Match a whole word" ));
109
110
m_wholeWord->Bind (wxEVT_KEY_DOWN, &QuickFindBar::OnKeyDown, this );
110
111
111
- m_regexOrWildButton = m_bar->AddButton (" " , images. Bitmap ( " regex " ), wxSize (24 , -1 ));
112
+ m_regexOrWildButton = m_bar->AddButton (" " , bmps-> LoadBitmap ( " regular-expression " ), wxSize (24 , -1 ));
112
113
m_regexOrWildButton->SetTogglable (true );
113
114
m_regexOrWildButton->Bind (wxEVT_CMD_FLATBUTTON_CLICK, &QuickFindBar::OnRegex, this );
114
115
m_regexOrWildButton->Bind (wxEVT_UPDATE_UI, &QuickFindBar::OnRegexUI, this );
115
116
m_regexOrWildButton->Bind (wxEVT_KEY_DOWN, &QuickFindBar::OnKeyDown, this );
116
117
m_regexOrWildButton->SetToolTip (_ (" Use regular expression" ));
117
118
118
119
// Marker button
119
- wxFlatButton* btnMarker = m_bar->AddButton (" " , images. Bitmap (" marker-16 " ), wxSize (24 , -1 ));
120
+ wxFlatButton* btnMarker = m_bar->AddButton (" " , bmps-> LoadBitmap (" marker" ), wxSize (24 , -1 ));
120
121
btnMarker->SetTogglable (true );
121
122
btnMarker->Bind (wxEVT_CMD_FLATBUTTON_CLICK, &QuickFindBar::OnHighlightMatches, this );
122
123
btnMarker->Bind (wxEVT_UPDATE_UI, &QuickFindBar::OnHighlightMatchesUI, this );
@@ -202,21 +203,12 @@ QuickFindBar::QuickFindBar(wxWindow* parent, wxWindowID id)
202
203
GetSizer ()->Fit (this );
203
204
wxTheApp->Connect (
204
205
XRCID (" find_next" ), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (QuickFindBar::OnFindNext), NULL , this );
205
- wxTheApp->Connect (XRCID (" find_previous" ),
206
- wxEVT_COMMAND_MENU_SELECTED,
207
- wxCommandEventHandler (QuickFindBar::OnFindPrevious),
208
- NULL ,
209
- this );
210
- wxTheApp->Connect (XRCID (" find_next_at_caret" ),
211
- wxEVT_COMMAND_MENU_SELECTED,
212
- wxCommandEventHandler (QuickFindBar::OnFindNextCaret),
213
- NULL ,
214
- this );
215
- wxTheApp->Connect (XRCID (" find_previous_at_caret" ),
216
- wxEVT_COMMAND_MENU_SELECTED,
217
- wxCommandEventHandler (QuickFindBar::OnFindPreviousCaret),
218
- NULL ,
219
- this );
206
+ wxTheApp->Connect (XRCID (" find_previous" ), wxEVT_COMMAND_MENU_SELECTED,
207
+ wxCommandEventHandler (QuickFindBar::OnFindPrevious), NULL , this );
208
+ wxTheApp->Connect (XRCID (" find_next_at_caret" ), wxEVT_COMMAND_MENU_SELECTED,
209
+ wxCommandEventHandler (QuickFindBar::OnFindNextCaret), NULL , this );
210
+ wxTheApp->Connect (XRCID (" find_previous_at_caret" ), wxEVT_COMMAND_MENU_SELECTED,
211
+ wxCommandEventHandler (QuickFindBar::OnFindPreviousCaret), NULL , this );
220
212
221
213
EventNotifier::Get ()->Connect (
222
214
wxEVT_FINDBAR_RELEASE_EDITOR, wxCommandEventHandler (QuickFindBar::OnReleaseEditor), NULL , this );
@@ -373,7 +365,7 @@ void QuickFindBar::OnKeyDown(wxKeyEvent& e)
373
365
void QuickFindBar::OnUpdateUI (wxUpdateUIEvent& e)
374
366
{
375
367
e.Enable (ManagerST::Get ()->IsShutdownInProgress () == false && m_sci && m_sci->GetLength () > 0 &&
376
- !m_findWhat->GetValue ().IsEmpty ());
368
+ !m_findWhat->GetValue ().IsEmpty ());
377
369
}
378
370
379
371
void QuickFindBar::OnEnter (wxCommandEvent& e)
@@ -471,12 +463,11 @@ void QuickFindBar::OnReplace(wxCommandEvent& event)
471
463
DoSearch (kSearchForward );
472
464
return ;
473
465
}
474
-
466
+
475
467
// Ensure that the selection matches our search pattern
476
468
size_t searchFlags = DoGetSearchFlags ();
477
- if (m_sci->FindText (
478
- selStart, selEnd, searchFlags & wxSTC_FIND_REGEXP ? findWhatSciVersion : findwhat, searchFlags) ==
479
- wxNOT_FOUND) {
469
+ if (m_sci->FindText (selStart, selEnd, searchFlags & wxSTC_FIND_REGEXP ? findWhatSciVersion : findwhat,
470
+ searchFlags) == wxNOT_FOUND) {
480
471
// we got a selection, but it does not match our search
481
472
return ;
482
473
}
@@ -521,7 +512,7 @@ void QuickFindBar::OnReplace(wxCommandEvent& event)
521
512
void QuickFindBar::OnReplaceUI (wxUpdateUIEvent& e)
522
513
{
523
514
e.Enable (ManagerST::Get ()->IsShutdownInProgress () == false && m_sci && !m_sci->GetReadOnly () &&
524
- m_sci->GetLength () > 0 && !m_findWhat->GetValue ().IsEmpty ());
515
+ m_sci->GetLength () > 0 && !m_findWhat->GetValue ().IsEmpty ());
525
516
}
526
517
527
518
void QuickFindBar::OnReplaceEnter (wxCommandEvent& e)
@@ -807,21 +798,12 @@ QuickFindBar::~QuickFindBar()
807
798
{
808
799
wxTheApp->Disconnect (
809
800
XRCID (" find_next" ), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (QuickFindBar::OnFindNext), NULL , this );
810
- wxTheApp->Disconnect (XRCID (" find_previous" ),
811
- wxEVT_COMMAND_MENU_SELECTED,
812
- wxCommandEventHandler (QuickFindBar::OnFindPrevious),
813
- NULL ,
814
- this );
815
- wxTheApp->Disconnect (XRCID (" find_next_at_caret" ),
816
- wxEVT_COMMAND_MENU_SELECTED,
817
- wxCommandEventHandler (QuickFindBar::OnFindNextCaret),
818
- NULL ,
819
- this );
820
- wxTheApp->Disconnect (XRCID (" find_previous_at_caret" ),
821
- wxEVT_COMMAND_MENU_SELECTED,
822
- wxCommandEventHandler (QuickFindBar::OnFindPreviousCaret),
823
- NULL ,
824
- this );
801
+ wxTheApp->Disconnect (XRCID (" find_previous" ), wxEVT_COMMAND_MENU_SELECTED,
802
+ wxCommandEventHandler (QuickFindBar::OnFindPrevious), NULL , this );
803
+ wxTheApp->Disconnect (XRCID (" find_next_at_caret" ), wxEVT_COMMAND_MENU_SELECTED,
804
+ wxCommandEventHandler (QuickFindBar::OnFindNextCaret), NULL , this );
805
+ wxTheApp->Disconnect (XRCID (" find_previous_at_caret" ), wxEVT_COMMAND_MENU_SELECTED,
806
+ wxCommandEventHandler (QuickFindBar::OnFindPreviousCaret), NULL , this );
825
807
EventNotifier::Get ()->Disconnect (
826
808
wxEVT_FINDBAR_RELEASE_EDITOR, wxCommandEventHandler (QuickFindBar::OnReleaseEditor), NULL , this );
827
809
}
0 commit comments