]> git.saurik.com Git - wxWidgets.git/commitdiff
Register multibutton editor class in frame ctor instead of CreateGrid() (this fixes...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 27 Sep 2008 15:29:50 +0000 (15:29 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 27 Sep 2008 15:29:50 +0000 (15:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/propgrid/propgrid.cpp
samples/propgrid/propgrid.h

index f37c78166fc0ee3aa832ece697bb6cc97ce03ea1..e4030606143738144d80fac98dbe0ec816e07258 100644 (file)
@@ -1665,10 +1665,8 @@ void FormMain::PopulateWithExamples ()
 
     //
     // Test wxSampleMultiButtonEditor
-    wxPGEditor* pSampleMultiButtonEditor = new wxSampleMultiButtonEditor();
-    wxPropertyGrid::RegisterEditorClass(pSampleMultiButtonEditor);
     pg->Append( new wxLongStringProperty(wxT("MultipleButtons"), wxPG_LABEL) );
-    pg->SetPropertyEditor(wxT("MultipleButtons"), pSampleMultiButtonEditor );
+    pg->SetPropertyEditor(wxT("MultipleButtons"), m_pSampleMultiButtonEditor );
 
     // Test SingleChoiceProperty
     pg->Append( new SingleChoiceProperty(wxT("SingleChoiceProperty")) );
@@ -2093,6 +2091,10 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
     // Register all editors (SpinCtrl etc.)
     m_pPropGridManager->RegisterAdditionalEditors();
 
+    // Register our sample custom editors
+    m_pSampleMultiButtonEditor =
+        wxPropertyGrid::RegisterEditorClass(new wxSampleMultiButtonEditor());
+
     //
     // Create menubar
     wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
index e0e44a09936d528a6708d7426e5830b0d0e561dd..df754a2055d52186e17279ae5711207090911b10 100644 (file)
@@ -137,6 +137,7 @@ public:
     wxWindow*       m_panel;
     wxBoxSizer*     m_topSizer;
 
+    wxPGEditor*     m_pSampleMultiButtonEditor;
     wxPGChoices     m_combinedFlags;
 
     wxMenuItem*     m_itemCatColours;