X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3a43801df2f05c057892481df9d3cfe30fd8800..72594e90b2da8c167ba63b89b2c168c57a19cab4:/include/wx/prop.h diff --git a/include/wx/prop.h b/include/wx/prop.h index e753c0293e..9207cb2d93 100644 --- a/include/wx/prop.h +++ b/include/wx/prop.h @@ -16,6 +16,8 @@ #pragma interface "prop.h" #endif +#if wxUSE_PROPSHEET + #include "wx/defs.h" #include "wx/string.h" #include "wx/hash.h" @@ -26,6 +28,7 @@ #include "wx/textctrl.h" #include "wx/gdicmn.h" #include "wx/layout.h" +#include "wx/sizer.h" class wxWindow; class wxProperty; @@ -38,25 +41,35 @@ class wxPropertyValidatorRegistry; #define wxPROPERTY_VERSION 2.0 // A storable sheet of values -class wxPropertySheet: public wxObject +class WXDLLEXPORT wxPropertySheet: public wxObject { DECLARE_DYNAMIC_CLASS(wxPropertySheet) public: - wxPropertySheet(void); + wxPropertySheet(const wxString& name = ""); ~wxPropertySheet(void); + // Set the name of the sheet + inline virtual void SetName(const wxString& name) { m_name=name; } + inline virtual wxString GetName() const { return m_name; } + // Does this sheet contain a property with this name + virtual bool HasProperty(const wxString& name) const; + + // Set property name to value + virtual bool SetProperty(const wxString& name, const wxPropertyValue& value); + + // Remove property from sheet by name, deleting it + virtual void RemoveProperty(const wxString& name); + + // Get the name of the sheet // Add a property virtual void AddProperty(wxProperty *property); // Get property by name - virtual wxProperty *GetProperty(wxString name); + virtual wxProperty *GetProperty(const wxString& name) const; // Clear all properties virtual void Clear(void); - virtual bool Save(ostream& str); - virtual bool Load(ostream& str); - virtual void UpdateAllViews(wxPropertyView *thisView = NULL); inline virtual wxList& GetProperties(void) const { return (wxList&) m_properties; } @@ -67,13 +80,13 @@ class wxPropertySheet: public wxObject wxObject* m_viewedObject; wxList m_properties; wxPropertyView* m_propertyView; - + wxString m_name; }; // Base class for property sheet views. There are currently two directly derived // classes: wxPropertyListView, and wxPropertyFormView. -class wxPropertyView: public wxEvtHandler +class WXDLLEXPORT wxPropertyView: public wxEvtHandler { DECLARE_DYNAMIC_CLASS(wxPropertyView) public: @@ -99,9 +112,11 @@ class wxPropertyView: public wxEvtHandler inline virtual void SetPropertySheet(wxPropertySheet *sheet) { m_propertySheet = sheet; } inline virtual wxPropertySheet *GetPropertySheet(void) const { return m_propertySheet; } +/* virtual void OnOk(void) {}; virtual void OnCancel(void) {}; virtual void OnHelp(void) {}; +*/ inline virtual bool OnClose(void) { return FALSE; } inline long GetFlags(void) { return m_buttonFlags; } @@ -115,7 +130,7 @@ class wxPropertyView: public wxEvtHandler }; -class wxPropertyValidator: public wxEvtHandler +class WXDLLEXPORT wxPropertyValidator: public wxEvtHandler { DECLARE_DYNAMIC_CLASS(wxPropertyValidator) public: @@ -126,14 +141,14 @@ class wxPropertyValidator: public wxEvtHandler inline void SetValidatorProperty(wxProperty *prop) { m_validatorProperty = prop; } inline wxProperty *GetValidatorProperty(void) const { return m_validatorProperty; } - virtual bool StringToFloat (char *s, float *number); - virtual bool StringToDouble (char *s, double *number); - virtual bool StringToInt (char *s, int *number); - virtual bool StringToLong (char *s, long *number); - virtual char *FloatToString (float number); - virtual char *DoubleToString (double number); - virtual char *IntToString (int number); - virtual char *LongToString (long number); + virtual bool StringToFloat (wxChar *s, float *number); + virtual bool StringToDouble (wxChar *s, double *number); + virtual bool StringToInt (wxChar *s, int *number); + virtual bool StringToLong (wxChar *s, long *number); + virtual wxChar *FloatToString (float number); + virtual wxChar *DoubleToString (double number); + virtual wxChar *IntToString (int number); + virtual wxChar *LongToString (long number); protected: long m_validatorFlags; @@ -143,7 +158,7 @@ class wxPropertyValidator: public wxEvtHandler // extern wxPropertyValidator *wxDefaultPropertyValidator; -class wxPropertyValidatorRegistry: public wxHashTable +class WXDLLEXPORT wxPropertyValidatorRegistry: public wxHashTable { DECLARE_DYNAMIC_CLASS(wxPropertyValidatorRegistry) public: @@ -172,13 +187,13 @@ typedef enum { wxPropertyValueStringPtr } wxPropertyValueType; -class wxPropertyValue: public wxObject +class WXDLLEXPORT wxPropertyValue: public wxObject { DECLARE_DYNAMIC_CLASS(wxPropertyValue) wxPropertyValue(void); // Unknown type wxPropertyValue(const wxPropertyValue& copyFrom); // Copy constructor - wxPropertyValue(const char *val); + wxPropertyValue(const wxChar *val); wxPropertyValue(const wxString& val); wxPropertyValue(long val); wxPropertyValue(bool val); @@ -187,7 +202,7 @@ class wxPropertyValue: public wxObject wxPropertyValue(wxList *val); wxPropertyValue(wxStringList *val); // Pointer versions - wxPropertyValue(char **val); + wxPropertyValue(wxChar **val); wxPropertyValue(long *val); wxPropertyValue(bool *val); wxPropertyValue(float *val); @@ -199,11 +214,11 @@ class wxPropertyValue: public wxObject virtual long IntegerValue(void) const; virtual float RealValue(void) const; virtual bool BoolValue(void) const; - virtual char *StringValue(void) const; + virtual wxChar *StringValue(void) const; virtual long *IntegerValuePtr(void) const; virtual float *RealValuePtr(void) const; virtual bool *BoolValuePtr(void) const; - virtual char **StringValuePtr(void) const; + virtual wxChar **StringValuePtr(void) const; // Get nth arg of clause (starting from 1) virtual wxPropertyValue *Arg(wxPropertyValueType type, int arg) const; @@ -216,8 +231,8 @@ class wxPropertyValue: public wxObject virtual wxPropertyValue *NewCopy(void) const; virtual void Copy(wxPropertyValue& copyFrom); - virtual void WritePropertyClause(ostream& stream); // Write this expression as a top-level clause - virtual void WritePropertyType(ostream& stream); // Write as any other subexpression + virtual void WritePropertyClause(wxString &stream); // Write this expression as a top-level clause + virtual void WritePropertyType(wxString &stream); // Write as any other subexpression // Append an expression to a list virtual void Append(wxPropertyValue *expr); @@ -257,7 +272,7 @@ class wxPropertyValue: public wxObject void operator=(const long val); void operator=(const bool val); void operator=(const float val); - void operator=(const char **val); + void operator=(const wxChar **val); void operator=(const long *val); void operator=(const bool *val); void operator=(const float *val); @@ -269,11 +284,11 @@ class wxPropertyValue: public wxObject union { long integer; // Also doubles as bool - char *string; + wxChar *string; float real; long *integerPtr; bool *boolPtr; - char **stringPtr; + wxChar **stringPtr; float *realPtr; wxPropertyValue *first; // If is a list expr, points to the first node } m_value; @@ -287,7 +302,7 @@ class wxPropertyValue: public wxObject * Property class: contains a name and a value. */ -class wxProperty: public wxObject +class WXDLLEXPORT wxProperty: public wxObject { DECLARE_DYNAMIC_CLASS(wxProperty) protected: @@ -321,5 +336,8 @@ class wxProperty: public wxObject inline bool IsEnabled(void) const { return m_enabled; } }; +#endif + // wxUSE_PROPSHEET + #endif // _WX_PROP_H_