Use getter/setter methods to get access to wxPGProperty::m_flags.

Use dedicated wxPGProperty::HasFlags, wxPGProperty::SetFlag methods to check or modify wxPGProperty::m_flags member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-01-31 21:42:17 +00:00
parent 3c0b17d4b5
commit 9698181b45
4 changed files with 22 additions and 18 deletions

View File

@@ -728,7 +728,7 @@ public:
bool IsPropertyEnabled( wxPGPropArg id ) const bool IsPropertyEnabled( wxPGPropArg id ) const
{ {
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
return (!(p->GetFlags() & wxPG_PROP_DISABLED))?true:false; return !p->HasFlag(wxPG_PROP_DISABLED);
} }
/** /**
@@ -745,7 +745,11 @@ public:
bool IsPropertyModified( wxPGPropArg id ) const bool IsPropertyModified( wxPGPropArg id ) const
{ {
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
return ( (p->GetFlags() & wxPG_PROP_MODIFIED) ? true : false ); #if WXWIN_COMPATIBILITY_3_0
return p->HasFlag(wxPG_PROP_MODIFIED)?true:false;
#else
return p->HasFlag(wxPG_PROP_MODIFIED);
#endif
} }
/** /**
@@ -764,7 +768,7 @@ public:
bool IsPropertyShown( wxPGPropArg id ) const bool IsPropertyShown( wxPGPropArg id ) const
{ {
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false) wxPG_PROP_ARG_CALL_PROLOG_RETVAL(false)
return (!(p->GetFlags() & wxPG_PROP_HIDDEN))?true:false; return !p->HasFlag(wxPG_PROP_HIDDEN);
} }
/** Returns true if property value is set to unspecified. /** Returns true if property value is set to unspecified.

View File

@@ -322,7 +322,7 @@ wxPGWindowList wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid,
// //
// If has children, and limited editing is specified, then don't create. // If has children, and limited editing is specified, then don't create.
if ( (property->GetFlags() & wxPG_PROP_NOEDITOR) && if ( property->HasFlag(wxPG_PROP_NOEDITOR) &&
property->GetChildCount() ) property->GetChildCount() )
return NULL; return NULL;
@@ -333,7 +333,7 @@ wxPGWindowList wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid,
text = property->GetValueAsString(argFlags); text = property->GetValueAsString(argFlags);
int flags = 0; int flags = 0;
if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && if ( property->HasFlag(wxPG_PROP_PASSWORD) &&
wxDynamicCast(property, wxStringProperty) ) wxDynamicCast(property, wxStringProperty) )
flags |= wxTE_PASSWORD; flags |= wxTE_PASSWORD;
@@ -352,7 +352,7 @@ void wxPGTextCtrlEditor::DrawValue( wxDC& dc, wxPGProperty* property, const wxRe
// Code below should no longer be needed, as the obfuscation // Code below should no longer be needed, as the obfuscation
// is now done in GetValueAsString. // is now done in GetValueAsString.
/*if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && /*if ( property->HasFlag(wxPG_PROP_PASSWORD) &&
property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) ) property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) )
{ {
size_t a = drawStr.length(); size_t a = drawStr.length();
@@ -1008,7 +1008,7 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
int odcbFlags = extraStyle | wxBORDER_NONE | wxTE_PROCESS_ENTER; int odcbFlags = extraStyle | wxBORDER_NONE | wxTE_PROCESS_ENTER;
if ( (property->GetFlags() & wxPG_PROP_USE_DCC) && if ( property->HasFlag(wxPG_PROP_USE_DCC) &&
wxDynamicCast(property, wxBoolProperty) ) wxDynamicCast(property, wxBoolProperty) )
odcbFlags |= wxODCB_DCLICK_CYCLES; odcbFlags |= wxODCB_DCLICK_CYCLES;
@@ -1370,7 +1370,7 @@ wxPGWindowList wxPGTextCtrlAndButtonEditor::CreateControls( wxPropertyGrid* prop
{ {
wxWindow* wnd2; wxWindow* wnd2;
wxWindow* wnd = propGrid->GenerateEditorTextCtrlAndButton( pos, sz, &wnd2, wxWindow* wnd = propGrid->GenerateEditorTextCtrlAndButton( pos, sz, &wnd2,
property->GetFlags() & wxPG_PROP_NOEDITOR, property); property->HasFlag(wxPG_PROP_NOEDITOR), property);
return wxPGWindowList(wnd, wnd2); return wxPGWindowList(wnd, wnd2);
} }

View File

@@ -2365,7 +2365,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
if ( butRect.x > 0 ) if ( butRect.x > 0 )
butRect.x += IN_CELL_EXPANDER_BUTTON_X_ADJUST; butRect.x += IN_CELL_EXPANDER_BUTTON_X_ADJUST;
if ( p->m_flags & wxPG_PROP_MODIFIED && if ( p->HasFlag(wxPG_PROP_MODIFIED) &&
(windowStyle & wxPG_BOLD_MODIFIED) ) (windowStyle & wxPG_BOLD_MODIFIED) )
{ {
dc.SetFont(m_captionFont); dc.SetFont(m_captionFont);
@@ -3376,9 +3376,9 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
wxWindow* editor = GetEditorControl(); wxWindow* editor = GetEditorControl();
// Set as Modified (not if dragging just began) // Set as Modified (not if dragging just began)
if ( !(p->m_flags & wxPG_PROP_MODIFIED) ) if ( !p->HasFlag(wxPG_PROP_MODIFIED) )
{ {
p->m_flags |= wxPG_PROP_MODIFIED; p->SetFlag(wxPG_PROP_MODIFIED);
if ( p == selected && (m_windowStyle & wxPG_BOLD_MODIFIED) ) if ( p == selected && (m_windowStyle & wxPG_BOLD_MODIFIED) )
{ {
if ( editor ) if ( editor )
@@ -3394,7 +3394,7 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
while ( prevPwc != topPaintedProperty ) while ( prevPwc != topPaintedProperty )
{ {
pwc->m_flags |= wxPG_PROP_MODIFIED; pwc->SetFlag(wxPG_PROP_MODIFIED);
if ( pwc == selected && (m_windowStyle & wxPG_BOLD_MODIFIED) ) if ( pwc == selected && (m_windowStyle & wxPG_BOLD_MODIFIED) )
{ {
@@ -4155,7 +4155,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
// //
// Only create editor for non-disabled non-caption // Only create editor for non-disabled non-caption
if ( !p->IsCategory() && !(p->m_flags & wxPG_PROP_DISABLED) ) if ( !p->IsCategory() && !p->HasFlag(wxPG_PROP_DISABLED) )
{ {
// do this for non-caption items // do this for non-caption items
@@ -4163,7 +4163,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
// Do we need to paint the custom image, if any? // Do we need to paint the custom image, if any?
m_iFlags &= ~(wxPG_FL_CUR_USES_CUSTOM_IMAGE); m_iFlags &= ~(wxPG_FL_CUR_USES_CUSTOM_IMAGE);
if ( (p->m_flags & wxPG_PROP_CUSTOMIMAGE) && if ( p->HasFlag(wxPG_PROP_CUSTOMIMAGE) &&
!p->GetEditorClass()->CanContainCustomImage() !p->GetEditorClass()->CanContainCustomImage()
) )
m_iFlags |= wxPG_FL_CUR_USES_CUSTOM_IMAGE; m_iFlags |= wxPG_FL_CUR_USES_CUSTOM_IMAGE;
@@ -4218,7 +4218,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
// If it has modified status, use bold font // If it has modified status, use bold font
// (must be done before capturing m_ctrlXAdjust) // (must be done before capturing m_ctrlXAdjust)
if ( (p->m_flags & wxPG_PROP_MODIFIED) && if ( p->HasFlag(wxPG_PROP_MODIFIED) &&
(m_windowStyle & wxPG_BOLD_MODIFIED) ) (m_windowStyle & wxPG_BOLD_MODIFIED) )
SetCurControlBoldFont(); SetCurControlBoldFont();
@@ -5089,7 +5089,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
tipString = m_propHover->GetDisplayedString(); tipString = m_propHover->GetDisplayedString();
space = m_width - splitterX; space = m_width - splitterX;
if ( m_propHover->m_flags & wxPG_PROP_CUSTOMIMAGE ) if ( m_propHover->HasFlag(wxPG_PROP_CUSTOMIMAGE) )
space -= wxPG_CUSTOM_IMAGE_WIDTH + space -= wxPG_CUSTOM_IMAGE_WIDTH +
wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN1 +
wxCC_CUSTOM_IMAGE_MARGIN2; wxCC_CUSTOM_IMAGE_MARGIN2;

View File

@@ -259,7 +259,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable )
if ( enable ) if ( enable )
{ {
if ( !(p->m_flags & wxPG_PROP_DISABLED) ) if ( !p->HasFlag(wxPG_PROP_DISABLED) )
return false; return false;
// If active, Set active Editor. // If active, Set active Editor.
@@ -268,7 +268,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable )
} }
else else
{ {
if ( p->m_flags & wxPG_PROP_DISABLED ) if ( p->HasFlag(wxPG_PROP_DISABLED) )
return false; return false;
// If active, Disable as active Editor. // If active, Disable as active Editor.