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:
Artur Wieczorek
2015-05-16 17:16:30 +02:00
parent 08f9e27351
commit b6ab81584f
4 changed files with 29 additions and 11 deletions

View File

@@ -1754,6 +1754,21 @@ public:
return (m_flags & flag) != 0;
}
#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.
*/
@@ -1766,13 +1781,16 @@ public:
*/
wxVariant GetAttributesAsList() const;
#if WXWIN_COMPATIBILITY_3_0
/**
Returns property flags.
*/
wxDEPRECATED_MSG("Use HasFlag or HasFlagsExact functions instead.")
FlagType GetFlags() const
{
return m_flags;
}
#endif
const wxPGEditor* GetEditorClass() const;
@@ -2105,7 +2123,7 @@ public:
example, if you want to disable a property, call
Enable(false) instead of setting wxPG_PROP_DISABLED flag.
@see HasFlag(), GetFlags()
@see HasFlag(), HasFlagsExact()
*/
void ChangeFlag( wxPGPropertyFlags flag, bool set )
{