]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/listctrl/listtest.cpp
added checkbox for testing wxNB_MULTILINE
[wxWidgets.git] / samples / listctrl / listtest.cpp
index 89bda1e810bd16fb73aa9abdf897e6e6dd7125dd..dc9acf8eaaef62689d323836af7e73df459b82c0 100644 (file)
@@ -249,6 +249,13 @@ MyFrame::~MyFrame()
 }
 
 void MyFrame::OnSize(wxSizeEvent& event)
+{
+    DoSize();
+
+    event.Skip();
+}
+
+void MyFrame::DoSize()
 {
     if ( !m_logWindow )
         return;
@@ -257,8 +264,6 @@ void MyFrame::OnSize(wxSizeEvent& event)
     wxCoord y = (2*size.y)/3;
     m_listCtrl->SetSize(0, 0, size.x, y);
     m_logWindow->SetSize(0, y + 1, size.x, size.y - y);
-
-    event.Skip();
 }
 
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
@@ -302,7 +307,7 @@ void MyFrame::OnFocusLast(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnToggleFirstSel(wxCommandEvent& WXUNUSED(event))
 {
-    m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+    m_listCtrl->SetItemState(0, (~m_listCtrl->GetItemState(0, wxLIST_STATE_SELECTED) ) & wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
 }
 
 void MyFrame::OnDeselectAll(wxCommandEvent& WXUNUSED(event))
@@ -365,9 +370,7 @@ void MyFrame::RecreateList(long flags, bool withText)
         }
     }
 
-#ifdef __WXMSW__
-        SendSizeEvent();
-#endif
+    DoSize();
 
     m_logWindow->Clear();
 }