Improve composite flags handling in the property grid wxFlagsProperty.
Don't consider that a flag is on just because one of its bits is enabled in the current flags, for the composite flags (e.g. something like "BOTH = ONE | TWO") all the bits composing the flag must be on for it to be enabled. Closes #15499. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -575,6 +575,7 @@ All (GUI):
|
|||||||
- Set correct cursor when the mouse is over image map links in wxHTML (LukasK).
|
- Set correct cursor when the mouse is over image map links in wxHTML (LukasK).
|
||||||
- Add wxPropertyGridPageState::GetColumnFullWidth() (Teodor Petrov).
|
- Add wxPropertyGridPageState::GetColumnFullWidth() (Teodor Petrov).
|
||||||
- wxRTC: extracted XML utilities into a separate class for potential reuse.
|
- wxRTC: extracted XML utilities into a separate class for potential reuse.
|
||||||
|
- wxPropertyGrid: improve composite flags handling (Jens Lody).
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -1490,7 +1490,7 @@ wxString wxFlagsProperty::ValueToString( wxVariant& value,
|
|||||||
for ( i = 0; i < GetItemCount(); i++ )
|
for ( i = 0; i < GetItemCount(); i++ )
|
||||||
{
|
{
|
||||||
int doAdd;
|
int doAdd;
|
||||||
doAdd = ( flags & choices.GetValue(i) );
|
doAdd = ( (flags & choices.GetValue(i)) == choices.GetValue(i) );
|
||||||
|
|
||||||
if ( doAdd )
|
if ( doAdd )
|
||||||
{
|
{
|
||||||
@@ -1578,7 +1578,7 @@ void wxFlagsProperty::RefreshChildren()
|
|||||||
if ( subVal != (m_oldValue & flag) )
|
if ( subVal != (m_oldValue & flag) )
|
||||||
p->ChangeFlag( wxPG_PROP_MODIFIED, true );
|
p->ChangeFlag( wxPG_PROP_MODIFIED, true );
|
||||||
|
|
||||||
p->SetValue( subVal?true:false );
|
p->SetValue( subVal == flag?true:false );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_oldValue = flags;
|
m_oldValue = flags;
|
||||||
|
Reference in New Issue
Block a user