X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a8312bced9d3f3415383a79a15cad2acf447b7e..5267aefd85739afd26bd19bfba998005119db446:/interface/wx/propgrid/propgrid.h diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 70dd99174c..eec0ae3842 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -2,7 +2,7 @@ // Name: propgrid.h // Purpose: interface of wxPropertyGrid // Author: wxWidgets team -// RCS-ID: $Id: +// RCS-ID: $Id$ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -32,7 +32,7 @@ wxPG_AUTO_SORT = 0x00000010, */ wxPG_HIDE_CATEGORIES = 0x00000020, -/* +/** This style combines non-categoric mode and automatic sorting. */ wxPG_ALPHABETIC_MODE = (wxPG_HIDE_CATEGORIES|wxPG_AUTO_SORT), @@ -149,12 +149,6 @@ wxPG_EX_AUTO_UNSPECIFIED_VALUES = 0x00200000, */ wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES = 0x00400000, -/** - With this style Validators on properties will work same as in wxPropertyGrid - 1.2. -*/ -wxPG_EX_LEGACY_VALIDATORS = 0x00800000, - /** Hides page selection buttons from tool bar. */ @@ -219,15 +213,14 @@ typedef wxByte wxPGVFBFlags; wxPGValidationInfo Used to convey validation information to and from functions that - actually perform validation. Mostly used in custom property - classes. + actually perform validation. Mostly used in custom property classes. */ class wxPGValidationInfo { public: /** @return Returns failure behavior which is a combination of - @ref propgrid_vfbflags. + @ref propgrid_vfbflags. */ wxPGVFBFlags GetFailureBehavior(); @@ -258,6 +251,7 @@ public: /** @section propgrid_keyboard_actions wxPropertyGrid Action Identifiers + These are used with wxPropertyGrid::AddActionTrigger() and wxPropertyGrid::ClearActionTriggers(). @{ @@ -271,9 +265,6 @@ enum wxPG_KEYBOARD_ACTIONS wxPG_ACTION_EXPAND_PROPERTY, wxPG_ACTION_COLLAPSE_PROPERTY, wxPG_ACTION_CANCEL_EDIT, - wxPG_ACTION_CUT, - wxPG_ACTION_COPY, - wxPG_ACTION_PASTE, wxPG_ACTION_MAX }; @@ -282,9 +273,10 @@ enum wxPG_KEYBOARD_ACTIONS // ----------------------------------------------------------------------- -/** @class wxPropertyGrid +/** + @class wxPropertyGrid - wxPropertyGrid is a specialized grid for editing properties - in other + wxPropertyGrid is a specialized grid for editing properties - in other words name = value pairs. List of ready-to-use property classes include strings, numbers, flag sets, fonts, colours and many others. It is possible, for example, to categorize properties, set up a complete tree-hierarchy, @@ -333,35 +325,34 @@ enum wxPG_KEYBOARD_ACTIONS @endEventTable @remarks - - - Use Freeze() and Thaw() respectively to disable and enable drawing. This - will also delay sorting etc. miscellaneous calculations to the last - possible moment. + Use Freeze() and Thaw() respectively to disable and enable drawing. + This will also delay sorting etc. miscellaneous calculations to the last + possible moment. @library{wxpropgrid} @category{propgrid} + @appearance{propertygrid.png} */ class wxPropertyGrid : public wxScrolledWindow, public wxPropertyGridInterface { public: - - /** - Two step constructor. Call Create when this constructor is called to - build up the wxPropertyGrid - */ + /** + Two step constructor. + Call Create() when this constructor is called to build up the wxPropertyGrid + */ wxPropertyGrid(); /** - Constructor. The styles to be used are styles valid for - the wxWindow and wxScrolledWindow. + Constructor. + The styles to be used are styles valid for the wxWindow and wxScrolledWindow. @see @ref propgrid_window_styles. */ wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxPG_DEFAULT_STYLE, - const wxChar* name = wxPropertyGridNameStr ); + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxPG_DEFAULT_STYLE, + const wxChar* name = wxPropertyGridNameStr ); /** Destructor */ virtual ~wxPropertyGrid(); @@ -371,10 +362,8 @@ public: @param action Which action to trigger. See @ref propgrid_keyboard_actions. - @param keycode Which keycode triggers the action. - @param modifiers Which key event modifiers, in addition to keycode, are needed to trigger the action. @@ -436,10 +425,10 @@ public: @see @ref propgrid_window_styles. */ bool Create( wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxPG_DEFAULT_STYLE, - const wxChar* name = wxPropertyGridNameStr ); + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxPG_DEFAULT_STYLE, + const wxChar* name = wxPropertyGridNameStr ); /** Call when editor widget's contents is modified. For example, this is @@ -450,17 +439,14 @@ public: @see wxPGProperty::OnEvent() */ - void EditorsValueWasModified() { m_iFlags |= wxPG_FL_VALUE_MODIFIED; } + void EditorsValueWasModified(); /** Reverse of EditorsValueWasModified(). @remarks This function should only be called by custom properties. */ - void EditorsValueWasNotModified() - { - m_iFlags &= ~(wxPG_FL_VALUE_MODIFIED); - } + void EditorsValueWasNotModified(); /** Enables or disables (shows/hides) categories according to parameter @@ -531,7 +517,7 @@ public: /** Returns number of columns currently on grid. */ - int GetColumnCount() const; + unsigned int GetColumnCount() const; /** Returns colour of empty space below properties. @@ -592,6 +578,14 @@ public: */ wxColour GetMarginColour() const; + /** + Returns most up-to-date value of selected property. This will return + value different from GetSelectedProperty()->GetValue() only when text + editor is activate and string edited by user represents valid, + uncommitted property value. + */ + wxVariant GetUncommittedPropertyValue(); + /** Returns cell background colour of a property. */ @@ -647,7 +641,7 @@ public: /** Returns current vertical spacing. */ - int GetVerticalSpacing() const { return (int)m_vspacing; } + int GetVerticalSpacing() const; /** Returns true if editor's value was marked modified. @@ -670,6 +664,22 @@ public: */ bool IsFrozen() const; + /** + When creating custom property editors, connect required editor events to + this function. For instance: + + @code + control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED, + wxEventHandler(wxPropertyGrid::OnCustomEditorEvent), + NULL, propgrid); + @endcode + + @remarks You should never need to call this function directly! + + @see wxPGEditor::CreateControls(), wxEvtHandler::Connect() + */ + void OnCustomEditorEvent( wxEvent &event ); + /** Redraws given property. */ @@ -786,15 +796,19 @@ public: void SetPropertyTextColour( wxPGPropArg id, const wxColour& col, bool recursively = true ); - /** Sets selection background colour - applies to selected property name - background. */ + /** + Sets selection background colour - applies to selected property name + background. + */ void SetSelectionBackgroundColour(const wxColour& col); - /** Sets selection foreground colour - applies to selected property name - text. */ + /** + Sets selection foreground colour - applies to selected property name text. + */ void SetSelectionTextColour(const wxColour& col); - /** Sets x coordinate of the splitter. + /** + Sets x coordinate of the splitter. @remarks Splitter position cannot exceed grid size, and therefore setting it during form creation may fail as initial grid size is often @@ -803,17 +817,6 @@ public: */ void SetSplitterPosition( int newxpos, int col = 0 ); - /** - Sets name of a property. - - @param id - Name or pointer of property which name to change. - - @param newname - New name. - */ - void SetPropertyName( wxPGPropArg id, const wxString& newname ); - /** Moves splitter as left as possible, while still allowing all labels to be shown in full. @@ -821,10 +824,7 @@ public: @param privateChildrenToo If @false, will still allow private children to be cropped. */ - void SetSplitterLeft( bool privateChildrenToo = false ) - { - m_pState->SetSplitterLeft(subProps); - } + void SetSplitterLeft( bool privateChildrenToo = false ); /** Sets vertical spacing. Can be 1, 2, or 3 - a value relative to font @@ -874,7 +874,7 @@ public: /** Returns true if you can veto the action that the event is signaling. */ - bool CanVeto() const { return m_canVeto; } + bool CanVeto() const; /** Copyer. */ virtual wxEvent* Clone() const; @@ -908,7 +908,7 @@ public: Set if event can be vetoed. */ void SetCanVeto( bool canVeto ); - + /** Changes the property associated with this event. */ void SetProperty( wxPGProperty* p );