00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __CHMSEARCHPANEL_HPP_
00024 #define __CHMSEARCHPANEL_HPP_
00025
00026
00027 #include <wx/panel.h>
00028 #include <wx/treectrl.h>
00029 #include <wx/textctrl.h>
00030 #include <wx/listctrl.h>
00031 #include <wx/checkbox.h>
00032 #include <wx/button.h>
00033 #include <wx/listbox.h>
00034 #include <wx/html/htmlwin.h>
00035 #include <wx/font.h>
00036 #include <wx/string.h>
00037
00038
00039
00040 class CHMListCtrl;
00041 class CHMHtmlNotebook;
00042
00043
00050
00051 enum {
00052 ID_SearchText = 1024,
00053 ID_SearchButton,
00054 ID_Results,
00055 };
00056
00057
00059 class CHMSearchPanel : public wxPanel {
00060
00061 public:
00071 CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00072 CHMHtmlNotebook* nbhtml);
00073
00075 ~CHMSearchPanel();
00076
00078 void Reset();
00079
00081 void SetNewFont(const wxFont& font);
00082
00083 protected:
00088 void OnSearch(wxCommandEvent& event);
00089
00091 void OnSearchSel(wxListEvent& event);
00092
00093 private:
00095 void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00096
00098 bool TitleSearch(const wxString& title, wxString& text,
00099 bool caseSensitive, bool wholeWords);
00100
00102 void GetConfig();
00103
00105 void SetConfig();
00106
00107 private:
00108 wxTreeCtrl* _tcl;
00109 wxTextCtrl* _text;
00110 wxCheckBox* _partial;
00111 wxCheckBox* _titles;
00112 wxButton* _search;
00113 CHMListCtrl* _results;
00114 CHMHtmlNotebook* _nbhtml;
00115
00116 private:
00117 DECLARE_EVENT_TABLE()
00118 };
00119
00120
00121 #endif // __CHMSEARCHPANEL_HPP_
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136