Use dedicated function to change wxPGProperty flags
Using wxPGProperty::ChangeFlag() function makes the code simpler and more readable.
This commit is contained in:
@@ -1255,8 +1255,7 @@ public:
|
|||||||
// Common values are disabled by the default for all properties.
|
// Common values are disabled by the default for all properties.
|
||||||
void EnableCommonValue( bool enable = true )
|
void EnableCommonValue( bool enable = true )
|
||||||
{
|
{
|
||||||
if ( enable ) SetFlag( wxPG_PROP_USES_COMMON_VALUE );
|
ChangeFlag(wxPG_PROP_USES_COMMON_VALUE, enable);
|
||||||
else ClearFlag( wxPG_PROP_USES_COMMON_VALUE );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Composes text from values of child properties.
|
// Composes text from values of child properties.
|
||||||
@@ -1682,8 +1681,7 @@ public:
|
|||||||
|
|
||||||
void SetExpanded( bool expanded )
|
void SetExpanded( bool expanded )
|
||||||
{
|
{
|
||||||
if ( !expanded ) m_flags |= wxPG_PROP_COLLAPSED;
|
ChangeFlag(wxPG_PROP_COLLAPSED, !expanded);
|
||||||
else m_flags &= ~wxPG_PROP_COLLAPSED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets or clears given property flag. Mainly for internal use.
|
// Sets or clears given property flag. Mainly for internal use.
|
||||||
|
@@ -1593,11 +1593,7 @@ bool wxSystemColourProperty::DoSetAttribute( const wxString& name, wxVariant& va
|
|||||||
}
|
}
|
||||||
else if ( name == wxPG_COLOUR_HAS_ALPHA )
|
else if ( name == wxPG_COLOUR_HAS_ALPHA )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_COLOUR_HAS_ALPHA, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_COLOUR_HAS_ALPHA;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_COLOUR_HAS_ALPHA);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return wxEnumProperty::DoSetAttribute(name, value);
|
return wxEnumProperty::DoSetAttribute(name, value);
|
||||||
|
@@ -1627,10 +1627,7 @@ void wxPGProperty::Enable( bool enable )
|
|||||||
|
|
||||||
void wxPGProperty::DoEnable( bool enable )
|
void wxPGProperty::DoEnable( bool enable )
|
||||||
{
|
{
|
||||||
if ( enable )
|
ChangeFlag(wxPG_PROP_DISABLED, !enable);
|
||||||
ClearFlag(wxPG_PROP_DISABLED);
|
|
||||||
else
|
|
||||||
SetFlag(wxPG_PROP_DISABLED);
|
|
||||||
|
|
||||||
// Apply same to sub-properties as well
|
// Apply same to sub-properties as well
|
||||||
for ( unsigned int i = 0; i < GetChildCount(); i++ )
|
for ( unsigned int i = 0; i < GetChildCount(); i++ )
|
||||||
@@ -2154,10 +2151,7 @@ bool wxPGProperty::Hide( bool hide, int flags )
|
|||||||
|
|
||||||
bool wxPGProperty::DoHide( bool hide, int flags )
|
bool wxPGProperty::DoHide( bool hide, int flags )
|
||||||
{
|
{
|
||||||
if ( !hide )
|
ChangeFlag(wxPG_PROP_HIDDEN, hide);
|
||||||
ClearFlag( wxPG_PROP_HIDDEN );
|
|
||||||
else
|
|
||||||
SetFlag( wxPG_PROP_HIDDEN );
|
|
||||||
|
|
||||||
if ( flags & wxPG_RECURSE )
|
if ( flags & wxPG_RECURSE )
|
||||||
{
|
{
|
||||||
|
@@ -142,10 +142,7 @@ bool wxStringProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
{
|
{
|
||||||
if ( name == wxPG_STRING_PASSWORD )
|
if ( name == wxPG_STRING_PASSWORD )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_PASSWORD, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_PASSWORD;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_PASSWORD);
|
|
||||||
RecreateEditor();
|
RecreateEditor();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1166,19 +1163,13 @@ bool wxBoolProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
#if wxPG_INCLUDE_CHECKBOX
|
#if wxPG_INCLUDE_CHECKBOX
|
||||||
if ( name == wxPG_BOOL_USE_CHECKBOX )
|
if ( name == wxPG_BOOL_USE_CHECKBOX )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_USE_CHECKBOX, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_USE_CHECKBOX;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_USE_CHECKBOX);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ( name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
|
if ( name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_USE_DCC, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_USE_DCC;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_USE_DCC);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return wxPGProperty::DoSetAttribute(name, value);
|
return wxPGProperty::DoSetAttribute(name, value);
|
||||||
@@ -1830,10 +1821,7 @@ bool wxFlagsProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
{
|
{
|
||||||
if ( name == wxPG_BOOL_USE_CHECKBOX )
|
if ( name == wxPG_BOOL_USE_CHECKBOX )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_USE_CHECKBOX, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_USE_CHECKBOX;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_USE_CHECKBOX);
|
|
||||||
|
|
||||||
for ( size_t i = 0; i < GetChildCount(); i++ )
|
for ( size_t i = 0; i < GetChildCount(); i++ )
|
||||||
{
|
{
|
||||||
@@ -1843,10 +1831,7 @@ bool wxFlagsProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
}
|
}
|
||||||
else if ( name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
|
else if ( name == wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_USE_DCC, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_USE_DCC;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_USE_DCC);
|
|
||||||
|
|
||||||
for ( size_t i = 0; i < GetChildCount(); i++ )
|
for ( size_t i = 0; i < GetChildCount(); i++ )
|
||||||
{
|
{
|
||||||
@@ -2136,10 +2121,7 @@ bool wxFileProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
// stored in m_attributes.
|
// stored in m_attributes.
|
||||||
if ( name == wxPG_FILE_SHOW_FULL_PATH )
|
if ( name == wxPG_FILE_SHOW_FULL_PATH )
|
||||||
{
|
{
|
||||||
if ( value.GetBool() )
|
ChangeFlag(wxPG_PROP_SHOW_FULL_FILENAME, value.GetBool());
|
||||||
m_flags |= wxPG_PROP_SHOW_FULL_FILENAME;
|
|
||||||
else
|
|
||||||
m_flags &= ~(wxPG_PROP_SHOW_FULL_FILENAME);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ( name == wxPG_FILE_WILDCARD )
|
else if ( name == wxPG_FILE_WILDCARD )
|
||||||
|
Reference in New Issue
Block a user