Fixed setting/unsetting wxPGProperty as read-only.

Don't do any action only if property is exactly in the same state as required (and action is requested for single property only).
This commit is contained in:
Artur Wieczorek
2016-07-11 21:41:31 +02:00
parent 97713c12d7
commit e9af6d6ec7

View File

@@ -284,8 +284,10 @@ void wxPropertyGridInterface::SetPropertyReadOnly( wxPGPropArg id, bool set, int
}
else
{
// Do nothing if flag is already set.
if ( p->HasFlag(wxPG_PROP_READONLY) )
// Do nothing if flag is already set as required.
if ( set && p->HasFlag(wxPG_PROP_READONLY) )
return;
if ( !set && !p->HasFlag(wxPG_PROP_READONLY) )
return;
p->ChangeFlag(wxPG_PROP_READONLY, set);