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
00035
00042
00043 enum {
00044 ID_SearchText = 1024,
00045 ID_SearchButton,
00046 ID_Results,
00047 };
00048
00049
00051 class CHMSearchPanel : public wxPanel {
00052
00053 public:
00063 CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00064 wxHtmlWindow* html);
00065
00067 ~CHMSearchPanel();
00068
00070 void Reset();
00071
00073 void ResetFont(const wxFont& font);
00074
00076 void SetNewFont(const wxFont& font);
00077
00078 protected:
00083 void OnSearch(wxCommandEvent& event);
00084
00086 void OnSearchSel(wxCommandEvent& event);
00087
00088 private:
00090 void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00091
00093 bool TitleSearch(const wxString& title, wxString& text,
00094 bool caseSensitive, bool wholeWords);
00095
00097 void GetConfig();
00098
00100 void SetConfig();
00101
00102 private:
00103 wxTreeCtrl* _tcl;
00104 wxTextCtrl* _text;
00105 wxCheckBox* _partial;
00106 wxCheckBox* _titles;
00107 wxButton* _search;
00108 wxListBox* _results;
00109 wxHtmlWindow* _html;
00110 wxFontEncoding _enc;
00111
00112 private:
00113 DECLARE_EVENT_TABLE()
00114 };
00115
00116
00117 #endif // __CHMSEARCHPANEL_HPP_
00118