X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1c3cdc4a2c4cc2b15d7fdf60c1be228f9fbc520..fce127d758a53bec28bce0c66f52a2e03ae9bf4b:/samples/htlbox/htlbox.cpp diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index 4e445bdeb1..1d65bf48e9 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -129,12 +129,12 @@ public: { wxLogMessage(_T("Listbox item %d double clicked."), event.GetInt()); } - + void OnHtmlLinkClicked(wxHtmlLinkEvent& event); void OnHtmlCellHover(wxHtmlCellEvent &event); void OnHtmlCellClicked(wxHtmlCellEvent &event); - wxSimpleHtmlListBox *GetSimpleBox() + wxSimpleHtmlListBox *GetSimpleBox() { return wxDynamicCast(m_hlbox, wxSimpleHtmlListBox); } MyHtmlListBox *GetMyBox() { return wxDynamicCast(m_hlbox, MyHtmlListBox); } @@ -238,9 +238,9 @@ MyFrame::MyFrame() #if wxUSE_MENUS // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->AppendRadioItem(HtmlLbox_CustomBox, _T("Use custom box"), + menuFile->AppendRadioItem(HtmlLbox_CustomBox, _T("Use custom box"), _T("Use a wxHtmlListBox virtual class control")); - menuFile->AppendRadioItem(HtmlLbox_SimpleBox, _T("Use simple box"), + menuFile->AppendRadioItem(HtmlLbox_SimpleBox, _T("Use simple box"), _T("Use a wxSimpleHtmlListBox control")); menuFile->AppendSeparator(); menuFile->Append(HtmlLbox_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); @@ -288,7 +288,7 @@ MyFrame::MyFrame() CreateStatusBar(2); SetStatusText(_T("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR - + // create the child controls CreateBox(); wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""), @@ -321,7 +321,7 @@ void MyFrame::CreateBox() { m_hlbox = new wxSimpleHtmlListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, multi ? wxLB_MULTIPLE : 0); - + // unlike wxHtmlListBox which is abstract, wxSimpleHtmlListBox is a // concrete control and doesn't support virtual mode, this we need // to add all of its items from the beginning @@ -354,12 +354,12 @@ void MyFrame::CreateBox() void MyFrame::OnSimpleOrCustomBox(wxCommandEvent& WXUNUSED(event)) { wxWindow *old = m_hlbox; - + // we need to recreate the listbox CreateBox(); GetSizer()->Replace(old, m_hlbox); delete old; - + GetSizer()->Layout(); Refresh(); } @@ -401,7 +401,7 @@ void MyFrame::OnSetMargins(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnToggleMulti(wxCommandEvent& WXUNUSED(event)) { wxWindow *old = m_hlbox; - + // we need to recreate the listbox CreateBox(); GetSizer()->Replace(old, m_hlbox); @@ -470,7 +470,7 @@ void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event) if (GetMyBox()) { GetMyBox()->m_linkClicked = true; - GetMyBox()->RefreshLine(1); + GetMyBox()->RefreshRow(1); } } @@ -575,7 +575,7 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const { if ( !n && m_firstItemUpdated ) { - return wxString::Format(_T("