X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ad10f30552aaeea5579388a7988504f4b4a2bf2..e12152104f6f3a24afe09284bf5ad7b3cedfff1c:/interface/wx/propgrid/property.h diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 235d7dc097..75efba3ce6 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -115,7 +115,8 @@ #define wxPG_DATE_FORMAT wxS("DateFormat") /** Sets wxDatePickerCtrl window style used with wxDateProperty. Default - is wxDP_DEFAULT | wxDP_SHOWCENTURY. + is wxDP_DEFAULT | wxDP_SHOWCENTURY. Using wxDP_ALLOWNONE will enable + better unspecified value support in the editor. */ #define wxPG_DATE_PICKER_STYLE wxS("PickerStyle") @@ -128,6 +129,11 @@ */ #define wxPG_ATTR_SPINCTRL_WRAP wxS("Wrap") +/** SpinCtrl editor, bool. If @true, value can also by changed by moving + mouse when left mouse button is being pressed. +*/ +#define wxPG_ATTR_SPINCTRL_MOTIONSPIN wxS("MotionSpin") + /** wxMultiChoiceProperty, int. If 0, no user strings allowed. If 1, user strings appear before list strings. If 2, user strings appear after list string. */ @@ -305,6 +311,7 @@ string wxDateTime::Format uses (altough default is recommended as it is locale-dependant), and wxPG_DATE_PICKER_STYLE allows changing window style given to DatePickerCtrl (default is wxDP_DEFAULT|wxDP_SHOWCENTURY). + Using wxDP_ALLOWNONE will enable better unspecified value support. @subsection wxEditEnumProperty @@ -848,10 +855,13 @@ public: virtual wxPGEditorDialogAdapter* GetEditorDialog() const; /** - Returns wxPGCell of given column, @NULL if none. If valid - object is returned, caller will gain its ownership. + Called whenever validation has failed with given pending value. + + @remarks If you implement this in your custom property class, please + remember to call the baser implementation as well, since they + may use it to revert property into pre-change state. */ - wxPGCell* AcquireCell( unsigned int column ); + virtual void OnValidationFailure( wxVariant& pendingValue ); /** Append a new choice to property's list of choices. @@ -908,6 +918,11 @@ public: */ bool AreChildrenComponents() const; + /** + Deletes children of the property. + */ + void DeleteChildren(); + /** Removes entry from property's wxPGChoices and editor control (if it is active). @@ -954,10 +969,9 @@ public: const wxString& GetBaseName() const; /** - Returns wxPGCell of given column, @NULL if none. wxPGProperty - will retain ownership of the cell object. + Returns wxPGCell of given column. */ - wxPGCell* GetCell( unsigned int column ) const; + const wxPGCell& GetCell( unsigned int column ) const; /** Returns number of child properties. @@ -1218,6 +1232,19 @@ public: */ void SetAttribute( const wxString& name, wxVariant value ); + /** + Sets property's background colour. + + @param colour + Background colour to use. + + @param recursively + If @true, children are affected recursively, and any categories + are not. + */ + void SetBackgroundColour( const wxColour& colour, + bool recursively = false ); + /** Sets editor for a property. @@ -1236,10 +1263,8 @@ public: /** Sets cell information for given column. - - Note that the property takes ownership of given wxPGCell instance. */ - void SetCell( int column, wxPGCell* cellObj ); + void SetCell( int column, const wxPGCell& cell ); /** Sets new set of choices for property. @@ -1248,12 +1273,6 @@ public: */ bool SetChoices( wxPGChoices& choices ); - /** - If property has choices and they are not yet exclusive, new such copy - of them will be created. - */ - void SetChoicesExclusive(); - /** Sets client data (void*) of a property. @@ -1319,6 +1338,19 @@ public: */ void SetParentalType( int flag ); + /** + Sets property's text colour. + + @param colour + Text colour to use. + + @param recursively + If @true, children are affected recursively, and any categories + are not. + */ + void SetTextColour( const wxColour& colour, + bool recursively = false ); + /** Sets wxValidator for a property */ void SetValidator( const wxValidator& validator ); @@ -1387,7 +1419,15 @@ public: @class wxPGChoices Helper class for managing choices of wxPropertyGrid properties. - Each entry can have label, value, bitmap, text colour, and background colour. + Each entry can have label, value, bitmap, text colour, and background + colour. + + wxPGChoices uses reference counting, similar to other wxWidgets classes. + This means that assignment operator and copy constructor only copy the + reference and not the actual data. Use Copy() member function to create a + real copy. + + @remarks If you do not specify value for entry, index is used. @library{wxpropgrid} @category{propgrid} @@ -1402,7 +1442,10 @@ public: */ wxPGChoices(); - /** Copy constructor. */ + /** + Copy constructor, uses reference counting. To create a real copy, + use Copy() member function instead. + */ wxPGChoices( const wxPGChoices& a ); /** Constructor. */ @@ -1443,7 +1486,8 @@ public: wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE ); /** - Assigns data from another set of choices. + Assigns choices data, using reference counting. To create a real copy, + use Copy() member function instead. */ void Assign( const wxPGChoices& a ); @@ -1457,6 +1501,11 @@ public: */ void Clear(); + /** + Returns a real copy of the choices. + */ + wxPGChoices Copy() const; + /** Returns labe of item. */ @@ -1544,7 +1593,7 @@ public: /** Creates exclusive copy of current choices. */ - void SetExclusive(); + void AllocExclusive(); /** Returns array of choice labels.