X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ea5af9c5356676a5c4d81b4d4915ad32ca3c9c6e..b545684e13530b21082bc2fc5c64c1c14b852994:/include/wx/propgrid/advprops.h?ds=inline diff --git a/include/wx/propgrid/advprops.h b/include/wx/propgrid/advprops.h index 5c6eb2eb17..388eb9349a 100644 --- a/include/wx/propgrid/advprops.h +++ b/include/wx/propgrid/advprops.h @@ -19,16 +19,13 @@ // ----------------------------------------------------------------------- +#ifndef SWIG + // // Additional Value Type Handlers // -#ifndef SWIG -bool WXDLLIMPEXP_PROPGRID operator==(const wxFont&, const wxFont&); - bool WXDLLIMPEXP_PROPGRID operator==(const wxArrayInt& array1, const wxArrayInt& array2); -#endif - // // Additional Property Editors @@ -41,6 +38,8 @@ WX_PG_DECLARE_EDITOR_WITH_DECL(SpinCtrl,WXDLLIMPEXP_PROPGRID) WX_PG_DECLARE_EDITOR_WITH_DECL(DatePickerCtrl,WXDLLIMPEXP_PROPGRID) #endif +#endif // !SWIG + // ----------------------------------------------------------------------- @@ -128,7 +127,8 @@ public: #ifndef SWIG void operator=(const wxColourPropertyValue& cpv) { - Init( cpv.m_type, cpv.m_colour ); + if (this != &cpv) + Init( cpv.m_type, cpv.m_colour ); } private: @@ -146,7 +146,7 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxColourPropertyValue, WXDLLIMPEXP_PROPGRID) #endif #ifndef SWIG - #define wxPG_EMPTY_CPV (*((wxColourPropertyValue*)NULL)) + #define wxPG_EMPTY_CPV (*(NULL)) #define wxPG_NORMAL_FONT (*wxNORMAL_FONT) #else #define wxPG_EMPTY_CPV wxCPV_wxPG_EMPTY @@ -157,7 +157,7 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxColourPropertyValue, WXDLLIMPEXP_PROPGRID) // ----------------------------------------------------------------------- // Declare part of custom colour property macro pairs. -#if wxUSE_IMAGE || defined(SWIG) +#if wxUSE_IMAGE #include "wx/image.h" #endif @@ -180,11 +180,12 @@ public: const wxFont& value = wxFont()); virtual ~wxFontProperty(); virtual void OnSetValue(); - virtual wxString GetValueAsString( int argFlags = 0 ) const; + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; virtual bool OnEvent( wxPropertyGrid* propgrid, wxWindow* primary, wxEvent& event ); - virtual void ChildChanged( wxVariant& thisValue, - int childIndex, wxVariant& childValue ) const; + virtual wxVariant ChildChanged( wxVariant& thisValue, + int childIndex, + wxVariant& childValue ) const; virtual void RefreshChildren(); protected: @@ -231,7 +232,7 @@ public: */ virtual int GetCustomColourIndex() const; - virtual wxString GetValueAsString( int argFlags = 0 ) const; + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; virtual bool StringToValue( wxVariant& variant, const wxString& text, int argFlags = 0 ) const; @@ -256,10 +257,10 @@ protected: // Special constructors to be used by derived classes. wxSystemColourProperty( const wxString& label, const wxString& name, - const wxChar** labels, const long* values, wxPGChoices* choicesCache, + const wxChar* const* labels, const long* values, wxPGChoices* choicesCache, const wxColourPropertyValue& value ); wxSystemColourProperty( const wxString& label, const wxString& name, - const wxChar** labels, const long* values, wxPGChoices* choicesCache, + const wxChar* const* labels, const long* values, wxPGChoices* choicesCache, const wxColour& value ); void Init( int type, const wxColour& colour ); @@ -282,14 +283,30 @@ protected: // ----------------------------------------------------------------------- -WX_PG_DECLARE_CUSTOM_COLOUR_PROPERTY_USES_WXCOLOUR_WITH_DECL( - wxColourProperty, class WXDLLIMPEXP_PROPGRID) +class WXDLLIMPEXP_PROPGRID wxColourProperty : public wxSystemColourProperty +{ + WX_PG_DECLARE_PROPERTY_CLASS(wxColourProperty) +public: + wxColourProperty( const wxString& label = wxPG_LABEL, + const wxString& name = wxPG_LABEL, + const wxColour& value = *wxWHITE ); + virtual ~wxColourProperty(); -// Exclude classes from wxPython bindings -#ifndef SWIG + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; + virtual wxColour GetColour( int index ) const; + +protected: + virtual wxVariant DoTranslateVal( wxColourPropertyValue& v ) const; + +private: + void Init( wxColour colour ); +}; // ----------------------------------------------------------------------- +// Exclude classes from wxPython bindings +#ifndef SWIG + /** @class wxCursorProperty @ingroup classes Property representing wxCursor. @@ -341,7 +358,7 @@ protected: #endif -#if wxUSE_CHOICEDLG || defined(SWIG) +#if wxUSE_CHOICEDLG /** @class wxMultiChoiceProperty @ingroup classes @@ -377,7 +394,7 @@ public: virtual ~wxMultiChoiceProperty(); virtual void OnSetValue(); - virtual wxString GetValueAsString( int flags = 0 ) const; + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; virtual bool StringToValue(wxVariant& variant, const wxString& text, int argFlags = 0) const; @@ -391,7 +408,7 @@ public: protected: - void GenerateValueAsString(); + void GenerateValueAsString( wxVariant& value, wxString* target ) const; // Returns translation of values into string indices. wxArrayInt GetValueAsIndices() const; @@ -415,7 +432,8 @@ protected: Supported special attributes: - "DateFormat": Determines displayed date format. - "PickerStyle": Determines window style used with wxDatePickerCtrl. - Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. + Default is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE + enables additional support for unspecified property value. */ class WXDLLIMPEXP_PROPGRID wxDateProperty : public wxPGProperty { @@ -427,7 +445,8 @@ public: const wxDateTime& value = wxDateTime() ); virtual ~wxDateProperty(); - virtual wxString GetValueAsString( int flags = 0 ) const; + virtual void OnSetValue(); + virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; virtual bool StringToValue(wxVariant& variant, const wxString& text, int argFlags = 0) const; @@ -499,13 +518,15 @@ protected: // used for event handling here. class WXDLLIMPEXP_PROPGRID wxPGSpinCtrlEditor : public wxPGTextCtrlEditor { - WX_PG_DECLARE_EDITOR_CLASS(wxPGSpinCtrlEditor) + DECLARE_DYNAMIC_CLASS(wxPGSpinCtrlEditor) public: virtual ~wxPGSpinCtrlEditor(); - // See below for short explanations of what these are suppposed to do. - wxPG_DECLARE_CREATECONTROLS - + wxString GetName() const; + virtual wxPGWindowList CreateControls(wxPropertyGrid* propgrid, + wxPGProperty* property, + const wxPoint& pos, + const wxSize& size) const; virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd, wxEvent& event ) const;