diff --git a/include/wx/propgrid/propgridiface.h b/include/wx/propgrid/propgridiface.h index 542f60b795..cd415b6155 100644 --- a/include/wx/propgrid/propgridiface.h +++ b/include/wx/propgrid/propgridiface.h @@ -728,7 +728,7 @@ public: bool IsPropertyEnabled( wxPGPropArg id ) const { 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 { 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 { 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. diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 757dc20e19..68c4c4cbae 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -322,7 +322,7 @@ wxPGWindowList wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid, // // 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() ) return NULL; @@ -333,7 +333,7 @@ wxPGWindowList wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid, text = property->GetValueAsString(argFlags); int flags = 0; - if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && + if ( property->HasFlag(wxPG_PROP_PASSWORD) && wxDynamicCast(property, wxStringProperty) ) 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 // is now done in GetValueAsString. - /*if ( (property->GetFlags() & wxPG_PROP_PASSWORD) && + /*if ( property->HasFlag(wxPG_PROP_PASSWORD) && property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) ) { size_t a = drawStr.length(); @@ -1008,7 +1008,7 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid, 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) ) odcbFlags |= wxODCB_DCLICK_CYCLES; @@ -1370,7 +1370,7 @@ wxPGWindowList wxPGTextCtrlAndButtonEditor::CreateControls( wxPropertyGrid* prop { wxWindow* wnd2; wxWindow* wnd = propGrid->GenerateEditorTextCtrlAndButton( pos, sz, &wnd2, - property->GetFlags() & wxPG_PROP_NOEDITOR, property); + property->HasFlag(wxPG_PROP_NOEDITOR), property); return wxPGWindowList(wnd, wnd2); } diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 3d8ee2612c..b01f2f82b1 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2365,7 +2365,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, if ( butRect.x > 0 ) 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) ) { dc.SetFont(m_captionFont); @@ -3376,9 +3376,9 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) wxWindow* editor = GetEditorControl(); // 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 ( editor ) @@ -3394,7 +3394,7 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags ) while ( prevPwc != topPaintedProperty ) { - pwc->m_flags |= wxPG_PROP_MODIFIED; + pwc->SetFlag(wxPG_PROP_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 - if ( !p->IsCategory() && !(p->m_flags & wxPG_PROP_DISABLED) ) + if ( !p->IsCategory() && !p->HasFlag(wxPG_PROP_DISABLED) ) { // 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? m_iFlags &= ~(wxPG_FL_CUR_USES_CUSTOM_IMAGE); - if ( (p->m_flags & wxPG_PROP_CUSTOMIMAGE) && + if ( p->HasFlag(wxPG_PROP_CUSTOMIMAGE) && !p->GetEditorClass()->CanContainCustomImage() ) 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 // (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) ) SetCurControlBoldFont(); @@ -5089,7 +5089,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y, tipString = m_propHover->GetDisplayedString(); space = m_width - splitterX; - if ( m_propHover->m_flags & wxPG_PROP_CUSTOMIMAGE ) + if ( m_propHover->HasFlag(wxPG_PROP_CUSTOMIMAGE) ) space -= wxPG_CUSTOM_IMAGE_WIDTH + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2; diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 06c089b862..cafc9d4023 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -259,7 +259,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) if ( enable ) { - if ( !(p->m_flags & wxPG_PROP_DISABLED) ) + if ( !p->HasFlag(wxPG_PROP_DISABLED) ) return false; // If active, Set active Editor. @@ -268,7 +268,7 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) } else { - if ( p->m_flags & wxPG_PROP_DISABLED ) + if ( p->HasFlag(wxPG_PROP_DISABLED) ) return false; // If active, Disable as active Editor.