xCHM  1.23
chmindexpanel.h
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 __CHMINDEXPANEL_H_
24 #define __CHMINDEXPANEL_H_
25 
26 
27 #include <wx/panel.h>
28 #include <wx/textctrl.h>
29 #include <wx/listctrl.h>
30 
31 
32 class CHMHtmlNotebook;
34 
35 
42 enum {
44  ID_SearchIndex = 1500,
45  ID_IndexClicked,
46 };
47 
48 
50 class CHMIndexPanel : public wxPanel {
51 
52 public:
59  CHMIndexPanel(wxWindow *parent, CHMHtmlNotebook* nbhtml);
60 
61 public:
63  CHMListCtrl* GetResultsList() { return _lc; }
64 
66  void Reset();
67 
69  void SetNewFont(const wxFont& font);
70 
71 protected:
73  void OnIndexSel(wxListEvent& event);
74 
76  void OnIndexSelRet(wxCommandEvent& event);
77 
79  void OnText(wxCommandEvent& event);
80 
81 private:
82  CHMHtmlNotebook* _nbhtml;
83  wxTextCtrl* _text;
84  CHMListCtrl* _lc;
85  bool _navigate;
86 
87 private:
88  DECLARE_EVENT_TABLE()
89 };
90 
91 
92 #endif // __CHMINDEXPANEL_H_
93 
94 
95 /*
96  Local Variables:
97  mode: c++
98  c-basic-offset: 8
99  tab-width: 8
100  c-indent-comments-syntactically-p: t
101  c-tab-always-indent: t
102  indent-tabs-mode: t
103  End:
104 */
105 
106 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
107 
CHMIndexPanel(wxWindow *parent, CHMHtmlNotebook *nbhtml)
Initializes the panel.
Definition: chmindexpanel.cpp:29
void Reset()
Clears the textbox and removes all items from the list control.
Definition: chmindexpanel.cpp:47
void OnIndexSelRet(wxCommandEvent &event)
This gets called when the user presses enter on a list item.
Definition: chmindexpanel.cpp:60
Custom panel for displaying the .chm index (if available).
Definition: chmindexpanel.h:50
Custom HTML notebook widget class. For tabbed viewing of a CHM file.
Definition: chmhtmlnotebook.h:49
generic wxWidgets panel widget class.
Definition: chmindexpanel.h:33
CHMListCtrl * GetResultsList()
Accesor for the CHMListCtrl used by this panel.
Definition: chmindexpanel.h:63
void OnIndexSel(wxListEvent &event)
This gets called when the user clicks on a list item.
Definition: chmindexpanel.cpp:69
List control class meant to emulate the look and feel of a wxListBox.
Definition: chmlistctrl.h:65
void OnText(wxCommandEvent &event)
Called whenever the user types a letter in the textbox.
Definition: chmindexpanel.cpp:78
void SetNewFont(const wxFont &font)
Sets the font.
Definition: chmindexpanel.cpp:54