1 /* 2 3 Copyright (C) 2003 - 2013 Razvan Cojocaru <rzvncj@gmail.com> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 MA 02110-1301, USA. 19 20 */ 21 22 23 #ifndef __CHMFINDDIALOG_H 24 #define __CHMFINDDIALOG_H 25 26 27 #include <wx/dialog.h> 28 #include <wx/textctrl.h> 29 #include <wx/html/htmlcell.h> 30 31 32 // Forward declarations. 33 class wxCheckBox; 34 class CHMHtmlWindow; 35 36 37 //! Event IDs. 38 enum { 39 ID_TextFind = 1408, 40 ID_FindNext, 41 }; 42 43 44 //! Dialog for finding a word in the currently displayed page. 45 class CHMFindDialog : public wxDialog { 46 public: 47 //! Initializes the dialog. 48 CHMFindDialog(wxWindow *parent, CHMHtmlWindow *toSearch); 49 50 //! Sets the focus to the textbox. SetFocusToTextBox()51 void SetFocusToTextBox() { _text->SetFocusFromKbd(); } 52 53 //! Resets the word to be found, so 'Find next' will start over. Reset()54 void Reset() { _cell = NULL; } 55 56 protected: 57 //! Called when the user clicks the 'Find next' button. 58 void OnFind(wxCommandEvent& event); 59 60 private: 61 CHMHtmlWindow* _html; 62 wxTextCtrl* _text; 63 wxCheckBox* _whole; 64 wxCheckBox* _case; 65 wxString _currWord; 66 wxHtmlCell *_cell; 67 68 private: 69 DECLARE_EVENT_TABLE(); 70 }; 71 72 73 #endif // __CHMFINDDIALOG_H 74 75 76 /* 77 Local Variables: 78 mode: c++ 79 c-basic-offset: 8 80 tab-width: 8 81 c-indent-comments-syntactically-p: t 82 c-tab-always-indent: t 83 indent-tabs-mode: t 84 End: 85 */ 86 87 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8 88 89