Suppress sending spurious wxEVT_PG_SELECTED events.

Don't send wxEVT_PG_SELECTED event when wxPG is ordered to unselect current property but no property is actually selected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-02-18 17:13:52 +00:00
parent 8cf3e90650
commit 821f5da314

View File

@@ -4378,8 +4378,12 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
// call wx event handler (here so that it also occurs on deselection) // call wx event handler (here so that it also occurs on deselection)
// In case of deselection previously selected property // In case of deselection previously selected property
// is passed to the event object. // is passed to the event object.
if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) ) if (!p)
SendEvent( wxEVT_PG_SELECTED, p? p: prevFirstSel, NULL ); {
p = prevFirstSel;
}
if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) && p)
SendEvent( wxEVT_PG_SELECTED, p, NULL );
return true; return true;
} }