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

List control class meant to emulate the look and feel of a wxListBox. More...

#include <chmlistctrl.h>

Inheritance diagram for CHMListCtrl:
wxListCtrl

Public Member Functions

 CHMListCtrl (wxWindow *parent, CHMHtmlNotebook *nbhtml, wxWindowID id=-1)
 Initializes the custom list control. More...
 
 ~CHMListCtrl ()
 Cleanup.
 
void Reset ()
 Cleans up and removes all the list items.
 
void AddPairItem (const wxString &title, const wxString &url)
 Adds a title:url pair to the list. The title is the part that gets displayed, the url is tha page where the HTML window should go when the item is being clicked. More...
 
void LoadSelected ()
 Loads the page that corresponds to the item currently selected.
 
void UpdateUI ()
 Should be called each time the list control's state changes.
 
void FindBestMatch (const wxString &title)
 Finds the list item that is the best match. More...
 

Protected Member Functions

void OnSize (wxSizeEvent &event)
 Gets called when the widget is being resized.
 
wxString OnGetItemText (long item, long column) const
 Gets called when an item needs to be displayed.
 

Private Member Functions

void ResetItems ()
 Delete/empty the items in the item array.
 

Private Attributes

ItemPairArray _items
 
CHMHtmlNotebook_nbhtml
 
int _currentSize
 

Detailed Description

List control class meant to emulate the look and feel of a wxListBox.

Constructor & Destructor Documentation

CHMListCtrl::CHMListCtrl ( wxWindow *  parent,
CHMHtmlNotebook nbhtml,
wxWindowID  id = -1 
)

Initializes the custom list control.

Parameters
parentThe parent widget.
nbhtmlPointer to a CHMHtmlWindow that I'll associate with this object so that selecting an item from the list will display the corresponding page in the HTML window.
idWidget id.

Member Function Documentation

void CHMListCtrl::AddPairItem ( const wxString &  title,
const wxString &  url 
)

Adds a title:url pair to the list. The title is the part that gets displayed, the url is tha page where the HTML window should go when the item is being clicked.

Parameters
titleThe title to add.
urlThe title's associated url.

Referenced by HHCParser::addToList(), CHMFile::GetItem(), CHMSearchPanel::OnSearch(), and CHMSearchPanel::PopulateList().

void CHMListCtrl::FindBestMatch ( const wxString &  title)

Finds the list item that is the best match.

Parameters
titleThe string to match against.

Referenced by CHMIndexPanel::OnText().


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