]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.cpp
Don't call wxTextMeasure::BeginMeasuring() when using non-native wxDC.
[wxWidgets.git] / samples / treectrl / treetest.cpp
index 8bfb579636cb7394e4c94ec73129cce62d468112..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));
@@ -228,7 +229,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
 
     file_menu->Append(TreeTest_ClearLog, wxT("&Clear log\tCtrl-L"));
     file_menu->AppendSeparator();
-    file_menu->Append(TreeTest_About, wxT("&About..."));
+    file_menu->Append(TreeTest_About, wxT("&About"));
     file_menu->AppendSeparator();
     file_menu->Append(TreeTest_Quit, wxT("E&xit\tAlt-X"));
 
@@ -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();
@@ -1606,7 +1613,7 @@ void MyTreeCtrl::ShowMenu(wxTreeItemId id, const wxPoint& pt)
 
 #if wxUSE_MENUS
     wxMenu menu(title);
-    menu.Append(TreeTest_About, wxT("&About..."));
+    menu.Append(TreeTest_About, wxT("&About"));
     menu.AppendSeparator();
     menu.Append(TreeTest_Highlight, wxT("&Highlight item"));
     menu.Append(TreeTest_Dump, wxT("&Dump"));