X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a9b4940a1f8eef8eb3e7ff65ed45f1daf14c2d9..1d529ef7eed851db9d007821decb9639e4e7fc16:/samples/htlbox/htlbox.cpp diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index 06563fe4d7..97a8815af9 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -84,6 +84,8 @@ protected: #ifdef USE_HTML_FILE wxTextFile m_file; #endif + + DECLARE_NO_COPY_CLASS(MyHtmlListBox) }; class MyFrame : public wxFrame @@ -316,7 +318,7 @@ void MyFrame::OnToggleMulti(wxCommandEvent& event) void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { - m_hlbox->SelectRange(0, m_hlbox->GetItemCount() - 1); + m_hlbox->SelectAll(); } void MyFrame::OnUpdateUISelectAll(wxUpdateUIEvent& event) @@ -403,23 +405,19 @@ MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi) SetMargins(5, 5); #ifdef USE_HTML_FILE - if ( !m_file.Open("results") ) + if ( !m_file.Open(_T("results")) ) { - wxLogError("Failed to open results file"); + wxLogError(_T("Failed to open results file")); } else { SetItemCount(m_file.GetLineCount()); } #else - SetItemCount(10); + SetItemCount(1000); #endif - // select something - if ( HasMultipleSelection() ) - Select(3); - else - SetSelection(3); + SetSelection(3); } void MyHtmlListBox::OnDrawSeparator(wxDC& dc, wxRect& rect, size_t) const