Use enum class to implement wxPGPropValFormatFlags as bitmask
This is for better type safety of the flags.
This commit is contained in:
parent
031435bd39
commit
ca3acd7a03
21 changed files with 1155 additions and 431 deletions
|
|
@ -505,11 +505,11 @@ void wxArrayDoubleProperty::OnSetValue()
|
|||
}
|
||||
|
||||
wxString wxArrayDoubleProperty::ValueToString( wxVariant& value,
|
||||
int argFlags ) const
|
||||
wxPGPropValFormatFlags flags ) const
|
||||
{
|
||||
wxString s;
|
||||
|
||||
if ( argFlags & wxPG_FULL_VALUE )
|
||||
if ( !!(flags & wxPGPropValFormatFlags::FullValue) )
|
||||
{
|
||||
GenerateValueAsString(s,-1,false);
|
||||
}
|
||||
|
|
@ -571,7 +571,7 @@ bool wxArrayDoubleProperty::DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& v
|
|||
return false;
|
||||
}
|
||||
|
||||
bool wxArrayDoubleProperty::StringToValue( wxVariant& variant, const wxString& text, int ) const
|
||||
bool wxArrayDoubleProperty::StringToValue( wxVariant& variant, const wxString& text, wxPGPropValFormatFlags ) const
|
||||
{
|
||||
// Add values to a temporary array so that in case
|
||||
// of error we can opt not to use them.
|
||||
|
|
@ -707,12 +707,12 @@ wxColour MyColourProperty::GetColour(int index) const
|
|||
return wxColour();
|
||||
}
|
||||
|
||||
wxString MyColourProperty::ColourToString(const wxColour& col, int index, int argFlags) const
|
||||
wxString MyColourProperty::ColourToString(const wxColour& col, int index, wxPGPropValFormatFlags flags) const
|
||||
{
|
||||
if ( index == (int)(m_choices.GetCount() - 1) )
|
||||
return wxEmptyString;
|
||||
|
||||
return wxColourProperty::ColourToString(col, index, argFlags);
|
||||
return wxColourProperty::ColourToString(col, index, flags);
|
||||
}
|
||||
|
||||
int MyColourProperty::GetCustomColourIndex() const
|
||||
|
|
|
|||
|
|
@ -116,10 +116,16 @@ public:
|
|||
virtual ~wxArrayDoubleProperty() = default;
|
||||
|
||||
virtual void OnSetValue() override;
|
||||
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const override;
|
||||
#if WXWIN_COMPATIBILITY_3_2
|
||||
// To prevent warnings that obsolete methods are hidden by overloads with new signature.
|
||||
using wxEditorDialogProperty::ValueToString;
|
||||
using wxEditorDialogProperty::StringToValue;
|
||||
#endif // WXWIN_COMPATIBILITY_3_2
|
||||
virtual wxString ValueToString(wxVariant& value,
|
||||
wxPGPropValFormatFlags flags = wxPGPropValFormatFlags::Null) const override;
|
||||
virtual bool StringToValue( wxVariant& variant,
|
||||
const wxString& text,
|
||||
int argFlags = 0 ) const override;
|
||||
wxPGPropValFormatFlags flags = wxPGPropValFormatFlags::Null ) const override;
|
||||
virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) override;
|
||||
|
||||
// Generates cache for displayed text
|
||||
|
|
@ -150,8 +156,12 @@ public:
|
|||
|
||||
virtual wxColour GetColour(int index) const override;
|
||||
|
||||
virtual wxString ColourToString(const wxColour& col,
|
||||
int index, int argFlags = 0) const override;
|
||||
#if WXWIN_COMPATIBILITY_3_2
|
||||
// To prevent warning that obsolete method is hidden by overload with new signature.
|
||||
using wxColourProperty::ColourToString;
|
||||
#endif // WXWIN_COMPATIBILITY_3_2
|
||||
virtual wxString ColourToString(const wxColour& col, int index,
|
||||
wxPGPropValFormatFlags flags = wxPGPropValFormatFlags::Null) const override;
|
||||
|
||||
virtual int GetCustomColourIndex() const override;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue