xCHM  1.23
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CHMSearchPanel Class Reference

Custom built search panel. More...

#include <chmsearchpanel.h>

Inheritance diagram for CHMSearchPanel:
wxPanel

Public Member Functions

 CHMSearchPanel (wxWindow *parent, wxTreeCtrl *topics, CHMHtmlNotebook *nbhtml)
 Initialized the search panel. More...
 
 ~CHMSearchPanel ()
 Calls SetConfig().
 
void Reset ()
 Resets the panel (clears the result list and the textbox.)
 
void SetNewFont (const wxFont &font)
 Sets the font.
 

Protected Member Functions

void OnSearch (wxCommandEvent &event)
 
void OnSearchSel (wxListEvent &event)
 This gets called when the user clicks on a result.
 

Private Member Functions

void PopulateList (wxTreeItemId root, wxString &text, bool wholeWords)
 Helper. Searches through the tree recursively.
 
bool TitleSearch (const wxString &title, wxString &text, bool caseSensitive, bool wholeWords)
 Helper. Grep searches page titles for the given text.
 
void GetConfig ()
 Reads the search configuration from .xchm (case sensitive, etc.).
 
void SetConfig ()
 Writes the search configuration to .xchm.
 

Private Attributes

wxTreeCtrl * _tcl
 
wxTextCtrl * _text
 
wxCheckBox * _partial
 
wxCheckBox * _titles
 
wxButton * _search
 
CHMListCtrl_results
 
CHMHtmlNotebook_nbhtml
 

Detailed Description

Custom built search panel.

Constructor & Destructor Documentation

CHMSearchPanel::CHMSearchPanel ( wxWindow *  parent,
wxTreeCtrl *  topics,
CHMHtmlNotebook nbhtml 
)

Initialized the search panel.

Parameters
parentParent widget.
topicsA wxTreeCtrl* that will be iterated over recursively in order to figure out which files from the archive to be searched.
nbhtmlThe widget that can load a html page found as a result of searching.

References GetConfig().

Member Function Documentation

void CHMSearchPanel::OnSearch ( wxCommandEvent &  event)
protected

This gets called when the user clicks the Search button or presses Enter in the textbox.

References CHMListCtrl::AddPairItem(), CHMInputStream::GetCache(), CHMFile::IndexSearch(), PopulateList(), CHMListCtrl::Reset(), and CHMListCtrl::UpdateUI().


The documentation for this class was generated from the following files: