Register multibutton editor class in frame ctor instead of CreateGrid() (this fixes memleak in tests)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -1665,10 +1665,8 @@ void FormMain::PopulateWithExamples () | |||||||
|  |  | ||||||
|     // |     // | ||||||
|     // Test wxSampleMultiButtonEditor |     // Test wxSampleMultiButtonEditor | ||||||
|     wxPGEditor* pSampleMultiButtonEditor = new wxSampleMultiButtonEditor(); |  | ||||||
|     wxPropertyGrid::RegisterEditorClass(pSampleMultiButtonEditor); |  | ||||||
|     pg->Append( new wxLongStringProperty(wxT("MultipleButtons"), wxPG_LABEL) ); |     pg->Append( new wxLongStringProperty(wxT("MultipleButtons"), wxPG_LABEL) ); | ||||||
|     pg->SetPropertyEditor(wxT("MultipleButtons"), pSampleMultiButtonEditor ); |     pg->SetPropertyEditor(wxT("MultipleButtons"), m_pSampleMultiButtonEditor ); | ||||||
|  |  | ||||||
|     // Test SingleChoiceProperty |     // Test SingleChoiceProperty | ||||||
|     pg->Append( new SingleChoiceProperty(wxT("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.) |     // Register all editors (SpinCtrl etc.) | ||||||
|     m_pPropGridManager->RegisterAdditionalEditors(); |     m_pPropGridManager->RegisterAdditionalEditors(); | ||||||
|  |  | ||||||
|  |     // Register our sample custom editors | ||||||
|  |     m_pSampleMultiButtonEditor = | ||||||
|  |         wxPropertyGrid::RegisterEditorClass(new wxSampleMultiButtonEditor()); | ||||||
|  |  | ||||||
|     // |     // | ||||||
|     // Create menubar |     // Create menubar | ||||||
|     wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF); |     wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF); | ||||||
|   | |||||||
| @@ -137,6 +137,7 @@ public: | |||||||
|     wxWindow*       m_panel; |     wxWindow*       m_panel; | ||||||
|     wxBoxSizer*     m_topSizer; |     wxBoxSizer*     m_topSizer; | ||||||
|  |  | ||||||
|  |     wxPGEditor*     m_pSampleMultiButtonEditor; | ||||||
|     wxPGChoices     m_combinedFlags; |     wxPGChoices     m_combinedFlags; | ||||||
|  |  | ||||||
|     wxMenuItem*     m_itemCatColours; |     wxMenuItem*     m_itemCatColours; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user