Notify wxPropertyGrid about selected property only if new page was selected

wxPropertyGridManager::DoSelectPage() returns true also if new page is
the same as the current one so we have to use alternative way to check
whether we really switched to the new page.
This commit is contained in:
Artur Wieczorek
2019-04-19 22:24:00 +02:00
parent 285bedc5e5
commit 06d15be780

View File

@@ -1175,7 +1175,9 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res
if ( selectedPage != -1 )
{
if ( DoSelectPage(selectedPage) )
wxPropertyGridPageState* curPageState = GetPageState(-1);
DoSelectPage(selectedPage);
if ( GetPageState(-1) != curPageState )
{
pg->SendEvent(wxEVT_PG_SELECTED, pg->GetSelectedProperty());
}