X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9fb1910b9579fa48eda10001af58b7d4b81d19f..7f4f5e8c24607ead9b5e2f4c60658dcd61f028f4:/interface/wx/propgrid/propgrid.h diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index c65a6d86be..4f540172f5 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -89,7 +89,12 @@ wxPG_TOOLBAR = 0x00001000, wxPropertyGridManager only: Show adjustable text box showing description or help text, if available, for currently selected property. */ -wxPG_DESCRIPTION = 0x00002000 +wxPG_DESCRIPTION = 0x00002000, + +/** wxPropertyGridManager only: don't show an internal border around the + property grid. Recommended if you use a header. +*/ +wxPG_NO_INTERNAL_BORDER = 0x00004000 }; @@ -178,7 +183,15 @@ wxPG_EX_MULTIPLE_SELECTION = 0x02000000, wxPropertyGrid's top-level parent window on its own, then you are recommended to enable this style. */ -wxPG_EX_ENABLE_TLP_TRACKING = 0x04000000 +wxPG_EX_ENABLE_TLP_TRACKING = 0x04000000, + +/** Don't show divider above toolbar, on Windows. +*/ +wxPG_EX_NO_TOOLBAR_DIVIDER = 0x04000000, + +/** Show a separator below the toolbar. +*/ +wxPG_EX_TOOLBAR_SEPARATOR = 0x08000000 }; @@ -258,7 +271,7 @@ public: /** Returns reference to pending value. */ - const wxVariant& GetValue() const; + wxVariant& GetValue(); /** Set validation failure behavior @@ -351,6 +364,9 @@ typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid, function. For instance, collapsing a parent property programmatically causes any selected child property to become unselected, and may therefore cause this event to be generated. + @event{EVT_PG_CHANGED(id, func)} + Respond to wxEVT_PG_CHANGED event, generated when property value + has been changed by the user. @event{EVT_PG_CHANGING(id, func)} Respond to wxEVT_PG_CHANGING event, generated when property value is about to be changed by user. Use wxPropertyGridEvent::GetValue() @@ -373,13 +389,24 @@ typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid, Respond to wxEVT_PG_ITEM_EXPANDED event, generated when user expands a property or category. @event{EVT_PG_LABEL_EDIT_BEGIN(id, func)} - Respond to wxEVT_PG_LABEL_EDIT_BEGIN event, generated when is about to - begin editing a property label. You can veto this event to prevent the - action. + Respond to wxEVT_PG_LABEL_EDIT_BEGIN event, generated when user is + about to begin editing a property label. You can veto this event to + prevent the action. @event{EVT_PG_LABEL_EDIT_ENDING(id, func)} - Respond to wxEVT_PG_LABEL_EDIT_ENDING event, generated when is about to - end editing of a property label. You can veto this event to prevent the - action. + Respond to wxEVT_PG_LABEL_EDIT_ENDING event, generated when user is + about to end editing of a property label. You can veto this event to + prevent the action. + @event{EVT_PG_COL_BEGIN_DRAG(id, func)} + Respond to wxEVT_PG_COL_BEGIN_DRAG event, generated when user + starts resizing a column - can be vetoed. + @event{EVT_PG_COL_DRAGGING,(id, func)} + Respond to wxEVT_PG_COL_DRAGGING, event, generated when a + column resize by user is in progress. This event is also generated + when user double-clicks the splitter in order to recenter + it. + @event{EVT_PG_COL_END_DRAG(id, func)} + Respond to wxEVT_PG_COL_END_DRAG event, generated after column + resize by user has finished. @endEventTable @remarks @@ -464,7 +491,7 @@ public: @see EndLabelEdit(), MakeColumnEditable() */ - void BeginLabelEdit( unsigned int column = 0 ); + void BeginLabelEdit( unsigned int colIndex = 0 ); /** Changes value of a property, as if from an editor. Use this instead of @@ -476,11 +503,13 @@ public: bool ChangePropertyValue( wxPGPropArg id, wxVariant newValue ); /** - Centers the splitter. If argument is true, automatic splitter centering - is enabled (only applicable if style wxPG_SPLITTER_AUTO_CENTER was - defined). + Centers the splitter. + + @param enableAutoResizing + If @true, automatic column resizing is enabled (only applicapple + if window style wxPG_SPLITTER_AUTO_CENTER is used). */ - void CenterSplitter( bool enable_auto_centering = false ); + void CenterSplitter( bool enableAutoResizing = false ); /** Deletes all properties. @@ -571,7 +600,7 @@ public: Returns wxWindow that the properties are painted on, and which should be used as the parent for editor controls. */ - wxPanel* GetPanel() const; + wxWindow* GetPanel(); /** Returns current category caption background colour. @@ -708,7 +737,7 @@ public: /** Returns current splitter x position. */ - int GetSplitterPosition() const; + int GetSplitterPosition( unsigned int splitterIndex = 0 ) const; /** Returns wxTextCtrl active in currently selected property, if any. Takes @@ -716,6 +745,21 @@ public: */ wxTextCtrl* GetEditorTextCtrl() const; + /** + Returns current appearance of unspecified value cells. + + @see SetUnspecifiedValueAppearance() + */ + const wxPGCell& GetUnspecifiedValueAppearance() const; + + /** + Returns (visual) text representation of the unspecified + property value. + + @param argFlags For internal use only. + */ + wxString GetUnspecifiedValueText( int argFlags = 0 ) const; + /** Returns current vertical spacing. */ @@ -751,6 +795,8 @@ public: /** Makes given column editable by user. + @param column + The index of the column to make editable. @param editable Using @false here will disable column from being editable. @@ -797,6 +843,17 @@ public: */ void ResetColours(); + /** + Resets column sizes and splitter positions, based on proportions. + + @param enableAutoResizing + If @true, automatic column resizing is enabled (only applicapple + if window style wxPG_SPLITTER_AUTO_CENTER is used). + + @see wxPropertyGridInterface::SetColumnProportion() + */ + void ResetColumnSizes( bool enableAutoResizing = false ); + /** Removes given property from selection. If property is not selected, an assertion failure will occur. @@ -949,6 +1006,19 @@ public: */ void SetSplitterLeft( bool privateChildrenToo = false ); + /** + Sets appearance of value cells representing an unspecified property + value. Default appearance is blank. + + @remarks If you set the unspecified value to have any + textual representation, then that will override + "InlineHelp" attribute. + + @see wxPGProperty::SetValueToUnspecified(), + wxPGProperty::IsValueUnspecified() + */ + void SetUnspecifiedValueAppearance( const wxPGCell& cell ); + /** Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font height. Value of 2 should be default on most platforms. @@ -1043,6 +1113,13 @@ public: */ bool CanVeto() const; + /** + Returns the column index associated with this event. + For the column dragging events, it is the column to the left + of the splitter being dragged + */ + unsigned int GetColumn() const; + /** Returns highest level non-category, non-root parent of property for which event occurred. Useful when you have nested properties with @@ -1055,6 +1132,11 @@ public: /** Returns property associated with this event. + + @remarks You should assume that this property can always be NULL. + For instance, wxEVT_PG_SELECTED is emitted not only when + a new property is selected, but also when selection is + cleared by user activity. */ wxPGProperty* GetProperty() const; @@ -1064,9 +1146,30 @@ public: wxPGVFBFlags GetValidationFailureBehavior() const; /** - Returns value that is about to be set for wxEVT_PG_CHANGING. + Returns name of the associated property. + + @remarks Property name is stored in event, so it remains + accessible even after the associated property or + the property grid has been deleted. + */ + wxString GetPropertyName() const; + + /** + Returns value of the associated property. Works for all event + types, but for wxEVT_PG_CHANGING this member function returns + the value that is pending, so you can call Veto() if the + value is not satisfactory. + + @remarks Property value is stored in event, so it remains + accessible even after the associated property or + the property grid has been deleted. + */ + wxVariant GetPropertyValue() const + + /** + @see GetPropertyValue() */ - const wxVariant& GetValue() const; + wxVariant GetValue() const; /** Set if event can be vetoed.