Deprecate wxPGProperty::GetFlags() getter method.
Instead of using pass-trough getter just to check the bits of internal field there are implemented dedicated HasFlag() and HasFlagsExact() methods to do so.
This commit is contained in:
@@ -1754,6 +1754,21 @@ public:
|
|||||||
return (m_flags & flag) != 0;
|
return (m_flags & flag) != 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/**
|
||||||
|
Returns true if property has given flag set.
|
||||||
|
*/
|
||||||
|
bool HasFlag(FlagType flag) const
|
||||||
|
{
|
||||||
|
return (m_flags & flag) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns true if property has all given flags set.
|
||||||
|
*/
|
||||||
|
bool HasFlagsExact(FlagType flags) const
|
||||||
|
{
|
||||||
|
return (m_flags & flags) == flags;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns comma-delimited string of property attributes.
|
/** Returns comma-delimited string of property attributes.
|
||||||
*/
|
*/
|
||||||
@@ -1766,13 +1781,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
wxVariant GetAttributesAsList() const;
|
wxVariant GetAttributesAsList() const;
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_3_0
|
||||||
/**
|
/**
|
||||||
Returns property flags.
|
Returns property flags.
|
||||||
*/
|
*/
|
||||||
|
wxDEPRECATED_MSG("Use HasFlag or HasFlagsExact functions instead.")
|
||||||
FlagType GetFlags() const
|
FlagType GetFlags() const
|
||||||
{
|
{
|
||||||
return m_flags;
|
return m_flags;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const wxPGEditor* GetEditorClass() const;
|
const wxPGEditor* GetEditorClass() const;
|
||||||
|
|
||||||
@@ -2105,7 +2123,7 @@ public:
|
|||||||
example, if you want to disable a property, call
|
example, if you want to disable a property, call
|
||||||
Enable(false) instead of setting wxPG_PROP_DISABLED flag.
|
Enable(false) instead of setting wxPG_PROP_DISABLED flag.
|
||||||
|
|
||||||
@see HasFlag(), GetFlags()
|
@see HasFlag(), HasFlagsExact()
|
||||||
*/
|
*/
|
||||||
void ChangeFlag( wxPGPropertyFlags flag, bool set )
|
void ChangeFlag( wxPGPropertyFlags flag, bool set )
|
||||||
{
|
{
|
||||||
|
@@ -183,7 +183,7 @@ wxPG_ITERATE_DEFAULT = wxPG_ITERATE_NORMAL
|
|||||||
// Macro to test if children of PWC should be iterated through
|
// Macro to test if children of PWC should be iterated through
|
||||||
#define wxPG_ITERATOR_PARENTEXMASK_TEST(PWC, PARENTMASK) \
|
#define wxPG_ITERATOR_PARENTEXMASK_TEST(PWC, PARENTMASK) \
|
||||||
( \
|
( \
|
||||||
!(PWC->GetFlags() & PARENTMASK) && \
|
!PWC->HasFlag(PARENTMASK) && \
|
||||||
PWC->GetChildCount() \
|
PWC->GetChildCount() \
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -240,8 +240,8 @@ private:
|
|||||||
wxPGProperty* m_baseParent;
|
wxPGProperty* m_baseParent;
|
||||||
|
|
||||||
// Masks are used to quickly exclude items
|
// Masks are used to quickly exclude items
|
||||||
int m_itemExMask;
|
wxPGProperty::FlagType m_itemExMask;
|
||||||
int m_parentExMask;
|
wxPGProperty::FlagType m_parentExMask;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -494,12 +494,12 @@ void wxPropertyGridInterface::GetPropertiesWithFlag( wxArrayPGProperty* targetAr
|
|||||||
|
|
||||||
if ( !inverse )
|
if ( !inverse )
|
||||||
{
|
{
|
||||||
if ( (property->GetFlags() & flags) == flags )
|
if ( property->HasFlagsExact(flags) )
|
||||||
targetArr->push_back((wxPGProperty*)property);
|
targetArr->push_back((wxPGProperty*)property);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( (property->GetFlags() & flags) != flags )
|
if ( !property->HasFlagsExact(flags) )
|
||||||
targetArr->push_back((wxPGProperty*)property);
|
targetArr->push_back((wxPGProperty*)property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -62,7 +62,7 @@ void wxPropertyGridIteratorBase::Init( wxPropertyGridPageState* state, int flags
|
|||||||
wxPG_ITERATOR_CREATE_MASKS(flags, m_itemExMask, m_parentExMask)
|
wxPG_ITERATOR_CREATE_MASKS(flags, m_itemExMask, m_parentExMask)
|
||||||
|
|
||||||
// Need to skip first?
|
// Need to skip first?
|
||||||
if ( property && (property->GetFlags() & m_itemExMask) )
|
if ( property && property->HasFlag(m_itemExMask) )
|
||||||
{
|
{
|
||||||
if ( dir == 1 )
|
if ( dir == 1 )
|
||||||
Next();
|
Next();
|
||||||
@@ -145,7 +145,7 @@ void wxPropertyGridIteratorBase::Prev()
|
|||||||
m_property = property;
|
m_property = property;
|
||||||
|
|
||||||
// If property does not match our criteria, skip it
|
// If property does not match our criteria, skip it
|
||||||
if ( property->GetFlags() & m_itemExMask )
|
if ( property->HasFlag(m_itemExMask) )
|
||||||
Prev();
|
Prev();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ void wxPropertyGridIteratorBase::Next( bool iterateChildren )
|
|||||||
m_property = property;
|
m_property = property;
|
||||||
|
|
||||||
// If property does not match our criteria, skip it
|
// If property does not match our criteria, skip it
|
||||||
if ( property->GetFlags() & m_itemExMask )
|
if ( property->HasFlag(m_itemExMask) )
|
||||||
Next();
|
Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags )
|
|||||||
if ( !m_properties->GetChildCount() )
|
if ( !m_properties->GetChildCount() )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wxPG_ITERATOR_CREATE_MASKS(flags, int itemExMask, int parentExMask)
|
wxPG_ITERATOR_CREATE_MASKS(flags, wxPGProperty::FlagType itemExMask, wxPGProperty::FlagType parentExMask)
|
||||||
|
|
||||||
// First, get last child of last parent
|
// First, get last child of last parent
|
||||||
wxPGProperty* pwc = (wxPGProperty*)m_properties->Last();
|
wxPGProperty* pwc = (wxPGProperty*)m_properties->Last();
|
||||||
@@ -429,7 +429,7 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags )
|
|||||||
pwc = (wxPGProperty*) pwc->Last();
|
pwc = (wxPGProperty*) pwc->Last();
|
||||||
|
|
||||||
// Then, if it doesn't fit our criteria, back up until we find something that does
|
// Then, if it doesn't fit our criteria, back up until we find something that does
|
||||||
if ( pwc->GetFlags() & itemExMask )
|
if ( pwc->HasFlag(itemExMask) )
|
||||||
{
|
{
|
||||||
wxPropertyGridIterator it( this, flags, pwc );
|
wxPropertyGridIterator it( this, flags, pwc );
|
||||||
for ( ; !it.AtEnd(); it.Prev() )
|
for ( ; !it.AtEnd(); it.Prev() )
|
||||||
|
Reference in New Issue
Block a user