]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/propgrid/tests.cpp
Use explicit menu item background if it's given under MSW.
[wxWidgets.git] / samples / propgrid / tests.cpp
index 19c18728e89c72b51d6239bf04acb26f70733fdf..5d62dbfe81b5e015915f7ecec3b1ee97efc3174e 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2007-05-16
 // RCS-ID:      $Id$
 // Copyright:   (c) Jaakko Salli
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
@@ -106,7 +106,7 @@ public:
 void FormMain::AddTestProperties( wxPropertyGridPage* pg )
 {
     pg->Append( new MyColourProperty(wxT("CustomColourProperty"), wxPG_LABEL, *wxGREEN) );
-    pg->GetProperty(wxT("CustomColourProperty"))->SetFlag(wxPG_PROP_AUTO_UNSPECIFIED);
+    pg->GetProperty(wxT("CustomColourProperty"))->SetAutoUnspecified(true);
     pg->SetPropertyEditor( wxT("CustomColourProperty"), wxPGEditor_ComboBox );
 
     pg->SetPropertyHelpString(wxT("CustomColourProperty"),
@@ -1030,13 +1030,17 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
         wxPGProperty* p;
 
         wxPGProperty* origParent =
-            pgman->GetProperty(wxT("Window Styles"))->GetParent();
+            pgman->GetProperty("Window Styles")->GetParent();
 
-        p = pgman->RemoveProperty(wxT("Window Styles"));
+        // For testing purposes, let's set some custom cell colours
+        p = pgman->GetProperty("Window Styles");
+        p->SetCell(2, wxPGCell("style"));
+        p = pgman->RemoveProperty("Window Styles");
         pgman->Refresh();
         pgman->Update();
 
         pgman->AppendIn(origParent, p);
+        wxASSERT( p->GetCell(2).GetText() == "style");
         pgman->Refresh();
         pgman->Update();
     }
@@ -1131,7 +1135,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
         InitPanel();
 
         const int trySplitterPos = 50;
-    
+
         int style = wxPG_AUTO_SORT;  // wxPG_SPLITTER_AUTO_CENTER;
         pgman = m_pPropGridManager =
             new wxPropertyGridManager(m_panel, wxID_ANY,