]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/htlbox/htlbox.cpp
implemented wxTE_RIGHT, wxTE_CENTRE for wxGTK2 (patch 957687)
[wxWidgets.git] / samples / htlbox / htlbox.cpp
index 06563fe4d743bda450daae82485109cb4065ff0c..2e3b116dc1bf208b93f6e05c9880e0992208ee32 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include "wx/colordlg.h"
 #endif
 
 #include "wx/colordlg.h"
+#include "wx/numdlg.h"
 
 #include "wx/htmllbox.h"
 
 
 #include "wx/htmllbox.h"
 
@@ -84,6 +85,8 @@ protected:
 #ifdef USE_HTML_FILE
     wxTextFile m_file;
 #endif
 #ifdef USE_HTML_FILE
     wxTextFile m_file;
 #endif
+
+    DECLARE_NO_COPY_CLASS(MyHtmlListBox)
 };
 
 class MyFrame : public wxFrame
 };
 
 class MyFrame : public wxFrame
@@ -316,7 +319,7 @@ void MyFrame::OnToggleMulti(wxCommandEvent& event)
 
 void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event))
 {
 
 void MyFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event))
 {
-    m_hlbox->SelectRange(0, m_hlbox->GetItemCount() - 1);
+    m_hlbox->SelectAll();
 }
 
 void MyFrame::OnUpdateUISelectAll(wxUpdateUIEvent& event)
 }
 
 void MyFrame::OnUpdateUISelectAll(wxUpdateUIEvent& event)
@@ -403,23 +406,19 @@ MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
     SetMargins(5, 5);
 
 #ifdef USE_HTML_FILE
     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
     }
     else
     {
         SetItemCount(m_file.GetLineCount());
     }
 #else
-    SetItemCount(10);
+    SetItemCount(1000);
 #endif
 
 #endif
 
-    // select something
-    if ( HasMultipleSelection() )
-        Select(3);
-    else
-        SetSelection(3);
+    SetSelection(3);
 }
 
 void MyHtmlListBox::OnDrawSeparator(wxDC& dc, wxRect& rect, size_t) const
 }
 
 void MyHtmlListBox::OnDrawSeparator(wxDC& dc, wxRect& rect, size_t) const