X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f631217a9acf6073c95f9d8ce6e3df794e5953e..6968a3b87cee46f5c5af9b46e1ef97f17133cef7:/include/wx/propgrid/property.h diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 5ef99831b9..5bae8cc4af 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -306,6 +306,13 @@ public: return *this; } + // Used mostly internally to figure out if this cell is supposed + // to have default values when attached to a grid. + bool IsInvalid() const + { + return ( m_refData == NULL ); + } + private: virtual wxObjectRefData *CreateRefData() const { return new wxPGCellData(); } @@ -403,8 +410,8 @@ wxPG_PROP_COLLAPSED = 0x0020, If property is selected, then indicates that validation failed for pending value. - If property is not selected, then indicates that the the actual property - value has failed validation (NB: this behavior is not currently supported, + If property is not selected, that indicates that the actual property + value has failed validation (NB: this behaviour is not currently supported, but may be used in future). */ wxPG_PROP_INVALID_VALUE = 0x0040, @@ -643,13 +650,18 @@ wxPG_PROP_BEING_DELETED = 0x00200000 */ #define wxPG_FILE_DIALOG_TITLE wxS("DialogTitle") +/** Specific to wxFileProperty and derivatives, long, default is 0. + Sets a specific wxFileDialog style for the file dialog. +*/ +#define wxPG_FILE_DIALOG_STYLE wxS("DialogStyle") + /** Specific to wxDirProperty, wxString, default is empty. Sets a specific message for the dir dialog. */ #define wxPG_DIR_DIALOG_MESSAGE wxS("DialogMessage") /** - wxArrayStringProperty's string delimiter character. If this is aquotation + wxArrayStringProperty's string delimiter character. If this is a quotation mark or hyphen, then strings will be quoted instead (with given character). @@ -667,7 +679,7 @@ wxPG_PROP_BEING_DELETED = 0x00200000 #define wxPG_DATE_PICKER_STYLE wxS("PickerStyle") /** SpinCtrl editor, int or double. How much number changes when button is - pressed (or up/down on keybard). + pressed (or up/down on keyboard). */ #define wxPG_ATTR_SPINCTRL_STEP wxS("Step") @@ -690,6 +702,12 @@ wxPG_PROP_BEING_DELETED = 0x00200000 */ #define wxPG_COLOUR_ALLOW_CUSTOM wxS("AllowCustom") +/** + wxColourProperty and its kind: Set to True in order to support editing + alpha colour component. +*/ +#define wxPG_COLOUR_HAS_ALPHA wxS("HasAlpha") + /** @} */ @@ -953,7 +971,7 @@ public: } /** Gets a unsigned number identifying this list. */ - wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; }; + wxPGChoicesId GetId() const { return (wxPGChoicesId) m_data; } const wxString& GetLabel( unsigned int ind ) const { @@ -1176,7 +1194,7 @@ public: You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if - you explicitly enabled that sort behavior). + you explicitly enabled that sort behaviour). */ virtual bool StringToValue( wxVariant& variant, const wxString& text, @@ -1208,7 +1226,7 @@ public: instead of OnEvent. - You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you - explicitly enabled that sort behavior). + explicitly enabled that sort behaviour). */ virtual bool IntToValue( wxVariant& value, int number, @@ -1234,7 +1252,7 @@ public: virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const; /** Converts string to a value, and if successful, calls SetValue() on it. - Default behavior is to do nothing. + Default behaviour is to do nothing. @param text String to get the value from. @return @@ -1242,8 +1260,8 @@ public: */ bool SetValueFromString( const wxString& text, int flags = wxPG_PROGRAMMATIC_VALUE ); - /** Converts integer to a value, and if succesful, calls SetValue() on it. - Default behavior is to do nothing. + /** Converts integer to a value, and if successful, calls SetValue() on it. + Default behaviour is to do nothing. @param value Int to get the value from. @param flags @@ -1262,7 +1280,7 @@ public: @param item Normally -1, but can be an index to the property's list of items. @remarks - - Default behavior is to return wxSize(0,0), which means no image. + - Default behaviour is to return wxSize(0,0), which means no image. - Default image width or height is indicated with dimension -1. - You can also return wxPG_DEFAULT_IMAGE_SIZE, i.e. wxSize(-1, -1). */ @@ -1296,7 +1314,7 @@ public: /** Called after value of a child property has been altered. Must return - new value of the whole property (after any alterations warrented by + new value of the whole property (after any alterations warranted by child's new value). Note that this function is usually called at the time that value of @@ -1694,7 +1712,7 @@ public: /** Returns true if property has editable wxTextCtrl when selected. @remarks - Altough disabled properties do not displayed editor, they still + Although disabled properties do not displayed editor, they still return True here as being disabled is considered a temporary condition (unlike being read-only or having limited editing enabled). */ @@ -1917,9 +1935,9 @@ public: modifying the value of the editor control (usually by clearing it). Currently, this can work with following properties: wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty. - + @param enable - Whether to enable or disable this behavior (it is disabled by + Whether to enable or disable this behaviour (it is disabled by default). */ void SetAutoUnspecified( bool enable = true ) @@ -2374,6 +2392,11 @@ protected: void InitAfterAdded( wxPropertyGridPageState* pageState, wxPropertyGrid* propgrid ); + /** + Returns true if child property is selected. + */ + bool IsChildSelected( bool recursive = false ) const; + // Removes child property with given pointer. Does not delete it. void RemoveChild( wxPGProperty* p ); @@ -2395,6 +2418,11 @@ protected: void ClearFlag( FlagType flag ) { m_flags &= ~(flag); } + // Called when the property is being removed from the grid and/or + // page state (but *not* when it is also deleted). + void OnDetached(wxPropertyGridPageState* state, + wxPropertyGrid* propgrid); + // Call after fixed sub-properties added/removed after creation. // if oldSelInd >= 0 and < new max items, then selection is // moved to it.