]> git.saurik.com Git - wxWidgets.git/commitdiff
Have to check for wxPG_SPLITTER_AUTO_CENTER style before setting propgrid column...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 1 Mar 2010 15:26:07 +0000 (15:26 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 1 Mar 2010 15:26:07 +0000 (15:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/propgrid/propgrid.cpp

index 0122b230d2bf668a14092fe1fb1bd9f912a8070d..b546314ab4f83a61f3e8ba8bbcf5bd7c6dda7dc2 100644 (file)
@@ -1845,9 +1845,14 @@ void FormMain::PopulateWithLibraryConfig ()
     wxPropertyGridManager* pgman = m_pPropGridManager;
     wxPropertyGridPage* pg = pgman->GetPage(wxT("wxWidgets Library Config"));
 
-    // Set custom column proportions
-    pg->SetColumnProportion(0, 3);
-    pg->SetColumnProportion(1, 1);
+    // Set custom column proportions (here in the sample app we need
+    // to check if the grid has wxPG_SPLITTER_AUTO_CENTER style. You usually
+    // need not to do it in your application).
+    if ( pgman->HasFlag(wxPG_SPLITTER_AUTO_CENTER) )
+    {
+        pg->SetColumnProportion(0, 3);
+        pg->SetColumnProportion(1, 1);
+    }
 
     wxPGProperty* cat;