]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.cpp
Allow hiding/showing already hidden/shown wxGrid rows/columns.
[wxWidgets.git] / samples / treectrl / treetest.cpp
index 94563cad03404547dbfa74b3a9fbdcf253cef80b..8085917c9ee8cbc48e6628b248da912cca129a93 100644 (file)
@@ -53,7 +53,7 @@
 #include "unchecked.xpm"
 #include "checked.xpm"
 
-#ifndef __WXMSW__
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -113,6 +113,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     MENU_LINK(Recreate)
     MENU_LINK(ToggleImages)
     MENU_LINK(ToggleStates)
+    MENU_LINK(ToggleBell)
     MENU_LINK(ToggleAlternateImages)
     MENU_LINK(ToggleAlternateStates)
     MENU_LINK(ToggleButtons)
@@ -214,7 +215,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
     // This reduces flicker effects - even better would be to define
     // OnEraseBackground to do nothing. When the tree control's scrollbars are
     // show or hidden, the frame is sent a background erase event.
-    SetBackgroundColour(wxColour(255, 255, 255));
+    SetBackgroundColour(*wxWHITE);
 
     // Give it an icon
     SetIcon(wxICON(sample));
@@ -247,6 +248,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
 #endif // NO_MULTIPLE_SELECTION
     style_menu->AppendCheckItem(TreeTest_ToggleImages, wxT("Toggle show ima&ges"));
     style_menu->AppendCheckItem(TreeTest_ToggleStates, wxT("Toggle show st&ates"));
+    style_menu->AppendCheckItem(TreeTest_ToggleBell, wxT("Toggle &bell on no match"));
     style_menu->AppendCheckItem(TreeTest_ToggleAlternateImages, wxT("Toggle alternate images"));
     style_menu->AppendCheckItem(TreeTest_ToggleAlternateStates, wxT("Toggle alternate state images"));
     style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze..."));
@@ -705,6 +707,11 @@ void MyFrame::OnToggleStates(wxCommandEvent& WXUNUSED(event))
     }
 }
 
+void MyFrame::OnToggleBell(wxCommandEvent& event)
+{
+    m_treeCtrl->EnableBellOnNoMatch(event.IsChecked());
+}
+
 void MyFrame::OnToggleAlternateImages(wxCommandEvent& WXUNUSED(event))
 {
     bool alternateImages = m_treeCtrl->AlternateImages();