From e90feaadf3247bb73380a4d59f065e0f61e10b89 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 19 Aug 2015 19:40:20 +0200 Subject: [PATCH] Added ability to disable label editing mode in propgrid sample. Currently, once label editing is enabled it cannot be disabled. By replacing ordinary menu item with check item and modifying the handler respectively, label editing mode can be switched on and off. --- samples/propgrid/propgrid.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 2e265004a5..cc6f0fa168 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2104,7 +2104,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"), wxT("Select window style flags used by the grid.")); - menuTry->Append(ID_ENABLELABELEDITING, wxT("Enable label editing"), + menuTry->AppendCheckItem(ID_ENABLELABELEDITING, wxT("Enable label editing"), wxT("This calls wxPropertyGrid::MakeColumnEditable(0)")); #if wxUSE_HEADERCTRL menuTry->AppendCheckItem(ID_SHOWHEADER, @@ -2692,9 +2692,9 @@ void FormMain::OnFreezeClick( wxCommandEvent& event ) // ----------------------------------------------------------------------- -void FormMain::OnEnableLabelEditing( wxCommandEvent& WXUNUSED(event) ) +void FormMain::OnEnableLabelEditing(wxCommandEvent& event) { - m_propGrid->MakeColumnEditable(0); + m_propGrid->MakeColumnEditable(0, event.IsChecked()); } // -----------------------------------------------------------------------