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/listctrl.h>
00030 #include <wx/checkbox.h>
00031 #include <wx/button.h>
00032 #include <wx/listbox.h>
00033 #include <wx/html/htmlwin.h>
00034 #include <wx/font.h>
00035 #include <wx/string.h>
00036
00037
00038
00039 class CHMListCtrl;
00040 class CHMHtmlWindow;
00041
00042
00049
00050 enum {
00051 ID_SearchText = 1024,
00052 ID_SearchButton,
00053 ID_Results,
00054 };
00055
00056
00058 class CHMSearchPanel : public wxPanel {
00059
00060 public:
00070 CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00071 CHMHtmlWindow* html);
00072
00074 ~CHMSearchPanel();
00075
00077 void Reset();
00078
00080 void SetNewFont(const wxFont& font);
00081
00082 protected:
00087 void OnSearch(wxCommandEvent& event);
00088
00090 #ifndef _ENABLE_COPY_AND_FIND
00091 void OnSearchSel(wxCommandEvent& event);
00092 #else
00093 void OnSearchSel(wxListEvent& event);
00094 #endif
00095
00096 private:
00098 void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00099
00101 bool TitleSearch(const wxString& title, wxString& text,
00102 bool caseSensitive, bool wholeWords);
00103
00105 void GetConfig();
00106
00108 void SetConfig();
00109
00110 private:
00111 wxTreeCtrl* _tcl;
00112 wxTextCtrl* _text;
00113 wxCheckBox* _partial;
00114 wxCheckBox* _titles;
00115 wxButton* _search;
00116 CHMListCtrl* _results;
00117 CHMHtmlWindow* _html;
00118
00119 private:
00120 DECLARE_EVENT_TABLE()
00121 };
00122
00123
00124 #endif // __CHMSEARCHPANEL_HPP_
00125