00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CHMSEARCHPANEL_HPP_
00023 #define __CHMSEARCHPANEL_HPP_
00024
00025
00026 #include <wx/panel.h>
00027 #include <wx/treectrl.h>
00028 #include <wx/textctrl.h>
00029 #include <wx/checkbox.h>
00030 #include <wx/button.h>
00031 #include <wx/listbox.h>
00032 #include <wx/html/htmlwin.h>
00033 #include <wx/font.h>
00034 #include <wx/string.h>
00035
00036
00037
00038 class CHMListCtrl;
00039 class CHMHtmlWindow;
00040
00041
00048
00049 enum {
00050 ID_SearchText = 1024,
00051 ID_SearchButton,
00052 ID_Results,
00053 };
00054
00055
00057 class CHMSearchPanel : public wxPanel {
00058
00059 public:
00069 CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00070 CHMHtmlWindow* html);
00071
00073 ~CHMSearchPanel();
00074
00076 void Reset();
00077
00079 void SetNewFont(const wxFont& font);
00080
00081 protected:
00086 void OnSearch(wxCommandEvent& event);
00087
00089 void OnSearchSel(wxCommandEvent& event);
00090
00091 private:
00093 void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00094
00096 bool TitleSearch(const wxString& title, wxString& text,
00097 bool caseSensitive, bool wholeWords);
00098
00100 void GetConfig();
00101
00103 void SetConfig();
00104
00105 private:
00106 wxTreeCtrl* _tcl;
00107 wxTextCtrl* _text;
00108 wxCheckBox* _partial;
00109 wxCheckBox* _titles;
00110 wxButton* _search;
00111 CHMListCtrl* _results;
00112 CHMHtmlWindow* _html;
00113
00114 private:
00115 DECLARE_EVENT_TABLE()
00116 };
00117
00118
00119 #endif // __CHMSEARCHPANEL_HPP_
00120