Make wxFontProperty and wxMultiChoiceProperty parents of wxEditorDialogProperty

wxFontProperty and wxMultiChoiceProperty use TextCtrlAndButton editor so they can be implemented as parents of wxEditorDialogProperty to share common functions and data.
This commit is contained in:
Artur Wieczorek
2019-07-02 20:54:25 +02:00
parent 37f9c6f083
commit a3ec84fdd1
3 changed files with 85 additions and 96 deletions

View File

@@ -66,22 +66,22 @@ public:
@ingroup classes
Property representing wxFont.
*/
class wxFontProperty : public wxPGProperty
class wxFontProperty : public wxEditorDialogProperty
{
public:
wxFontProperty(const wxString& label = wxPG_LABEL,
const wxString& name = wxPG_LABEL,
const wxFont& value = wxFont());
virtual ~wxFontProperty();
virtual void OnSetValue();
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const;
virtual bool OnEvent( wxPropertyGrid* propgrid,
wxWindow* primary, wxEvent& event );
virtual wxVariant ChildChanged( wxVariant& thisValue,
int childIndex,
wxVariant& childValue ) const;
virtual void RefreshChildren();
protected:
virtual bool DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& value);
};
@@ -254,7 +254,7 @@ protected:
user strings are preferably placed in front of valid choices. If value is
2, then those strings will placed behind valid choices.
*/
class wxMultiChoiceProperty : public wxPGProperty
class wxMultiChoiceProperty : public wxEditorDialogProperty
{
public:
@@ -278,12 +278,11 @@ public:
virtual bool StringToValue(wxVariant& variant,
const wxString& text,
int argFlags = 0) const;
virtual bool OnEvent( wxPropertyGrid* propgrid,
wxWindow* primary, wxEvent& event );
wxArrayInt GetValueAsArrayInt() const;
protected:
virtual bool DisplayEditorDialog(wxPropertyGrid* pg, wxVariant& value);
void GenerateValueAsString( wxVariant& value, wxString* target ) const;
@@ -294,6 +293,8 @@ protected:
// Cache displayed text since generating it is relatively complicated.
wxString m_display;
// How to handle user strings
int m_userStringMode;
};