#include <chmlistctrl.h>
Public Member Functions | |
CHMListCtrl (wxWindow *parent, CHMHtmlNotebook *nbhtml, wxWindowID id=-1) | |
Initializes the custom list control. | |
~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. | |
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. | |
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 |
CHMListCtrl::CHMListCtrl | ( | wxWindow * | parent, | |
CHMHtmlNotebook * | nbhtml, | |||
wxWindowID | id = -1 | |||
) |
Initializes the custom list control.
parent | The parent widget. | |
html | Pointer 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. | |
id | Widget id. |
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.
title | The title to add. | |
url | The title's associated url. |
Referenced by HHCParser::addToList(), CHMFile::GetItem(), and CHMSearchPanel::PopulateList().
void CHMListCtrl::FindBestMatch | ( | const wxString & | title | ) |
Finds the list item that is the best match.
title | The string to match against. |