From: Jaakko Salli Date: Sun, 4 Jul 2010 10:30:13 +0000 (+0000) Subject: m_inDoSelectProperty: make it bool and use wxON_BLOCK_EXIT_SET() on it. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/96bffa128845e1ee806f53abd2942b4b16a51eea m_inDoSelectProperty: make it bool and use wxON_BLOCK_EXIT_SET() on it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 62d43e2745..3e85ef4285 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1938,7 +1938,7 @@ protected: unsigned char m_inCommitChangesFromEditor; /** 1 if in DoSelectProperty() */ - unsigned char m_inDoSelectProperty; + bool m_inDoSelectProperty; bool m_inOnValidationFailure; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 1774f76d09..50a9f09d4d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4000,13 +4000,11 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) if ( m_inDoSelectProperty ) return true; - m_inDoSelectProperty = 1; + m_inDoSelectProperty = true; + wxON_BLOCK_EXIT_SET(m_inDoSelectProperty, false); if ( !m_pState ) - { - m_inDoSelectProperty = 0; return false; - } wxArrayPGProperty prevSelection = m_pState->m_selection; wxPGProperty* prevFirstSel; @@ -4072,7 +4070,6 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) } } - m_inDoSelectProperty = 0; return true; } @@ -4088,7 +4085,6 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) // Validation has failed, so we can't exit the previous editor //::wxMessageBox(_("Please correct the value or press ESC to cancel the edit."), // _("Invalid Value"),wxOK|wxICON_ERROR); - m_inDoSelectProperty = 0; return false; } } @@ -4327,8 +4323,6 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) } #endif - m_inDoSelectProperty = 0; - // call wx event handler (here so that it also occurs on deselection) if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) ) SendEvent( wxEVT_PG_SELECTED, p, NULL );