From f7fc873ec78c7980950cc3b5f0dc44d819c05d38 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 15 Feb 2015 23:23:25 +0000 Subject: [PATCH] wxEVT_PG_SELECTED event object generated when property is unselected should refer to the property being unselected. Currently, wxEVT_PG_SELECTED event object generated when property is unselected doesn't refer to the property being unselected (in fact it doesn't refer to any property; pointer to the property is NULL) and therefore it is not possible to determine unselected property or to check its state. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index a92de53b71..877bc3151a 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4376,8 +4376,10 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) } // call wx event handler (here so that it also occurs on deselection) + // In case of deselection previously selected property + // is passed to the event object. if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) ) - SendEvent( wxEVT_PG_SELECTED, p, NULL ); + SendEvent( wxEVT_PG_SELECTED, p? p: prevFirstSel, NULL ); return true; }