X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8ebb70d6c40f5ba8db6c24a6537cc65ac48ccd6..38534f596974042130716a26276e9564b0b72295:/interface/wx/propgrid/manager.h diff --git a/interface/wx/propgrid/manager.h b/interface/wx/propgrid/manager.h index 1b2e3a14cd..0391703b0f 100644 --- a/interface/wx/propgrid/manager.h +++ b/interface/wx/propgrid/manager.h @@ -3,7 +3,7 @@ // Purpose: interface of wxPropertyGridManager // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -128,8 +128,8 @@ public: @class wxPropertyGridManager wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, - which can optionally have toolbar for mode and page selection, and a help text - box. + which can optionally have toolbar for mode and page selection, a help text + box, and a header. wxPropertyGridManager inherits from wxPropertyGridInterface, and as such it has most property manipulation functions. However, only some of them affect @@ -147,7 +147,7 @@ public: acquire the internal grid (GetGrid()) or wxPropertyGridPage object (GetPage()). wxPropertyGridManager constructor has exact same format as wxPropertyGrid - constructor, and basicly accepts same extra window style flags (albeit also + constructor, and basically accepts same extra window style flags (albeit also has some extra ones). Here's some example code for creating and populating a wxPropertyGridManager: @@ -183,6 +183,9 @@ public: page->Append( "Text",wxPG_LABEL,"(no text)" ); page->Append( new wxFontProperty("Font",wxPG_LABEL) ); + + // Display a header above the grid + pgMan->ShowHeader(); @endcode @section propgridmanager_window_styles_ Window Styles @@ -253,7 +256,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxPGMAN_DEFAULT_STYLE, - const wxChar* name = wxPropertyGridManagerNameStr ); + const wxString& name = wxPropertyGridManagerNameStr ); /** Enables or disables (shows/hides) categories according to parameter enable. @@ -337,11 +340,11 @@ public: /** Returns index to currently selected page. */ int GetSelectedPage() const; - /** Shortcut for GetGrid()->GetSelection(). */ + /** Alias for GetSelection(). */ wxPGProperty* GetSelectedProperty() const; - /** Synonyme for GetSelectedPage. */ - int GetSelection() const; + /** Shortcut for GetGrid()->GetSelection(). */ + wxPGProperty* GetSelection() const; /** Returns a pointer to the toolbar currently associated with the @@ -388,6 +391,12 @@ public: */ bool IsPageModified( size_t index ) const; + /** + Returns true if property is selected. Since selection is page + based, this function checks every page in the manager. + */ + virtual bool IsPropertySelected( wxPGPropArg id ) const; + /** Removes a page. @@ -411,14 +420,32 @@ public: /** Select and displays a given page. */ void SelectPage( wxPropertyGridPage* page ); - /** Select a property. */ + /** + Select a property. + + @see wxPropertyGrid::SelectProperty(), + wxPropertyGridInterface::ClearSelection() + */ bool SelectProperty( wxPGPropArg id, bool focus = false ); /** Sets number of columns on given page (default is current page). + + @remarks If you use header, then you should always use this + member function to set the column count, instead of + ones present in wxPropertyGrid or wxPropertyGridPage. */ void SetColumnCount( int colCount, int page = -1 ); + /** + Sets a column title. Default title for column 0 is "Property", + and "Value" for column 1. + + @remarks If header is not shown yet, then calling this + member function will make it visible. + */ + void SetColumnTitle( int idx, const wxString& title ); + /** Sets label and text in description box. */ @@ -440,21 +467,42 @@ public: */ void SetSplitterLeft( bool subProps = false, bool allPages = true ); - /** Sets splitter position on individual page. */ + /** Moves splitter as left as possible on an individual page, while still allowing all + labels to be shown in full. + */ + void SetPageSplitterLeft(int page, bool subProps = false); + + /** + Sets splitter position on individual page. + + @remarks If you use header, then you should always use this + member function to set the splitter position, instead of + ones present in wxPropertyGrid or wxPropertyGridPage. + */ void SetPageSplitterPosition( int page, int pos, int column = 0 ); /** Sets splitter position for all pages. - @remarks Splitter position cannot exceed grid size, and therefore setting - it during form creation may fail as initial grid size is often - smaller than desired splitter position, especially when sizers - are being used. + @remarks Splitter position cannot exceed grid size, and therefore + setting it during form creation may fail as initial grid + size is often smaller than desired splitter position, + especially when sizers are being used. + + If you use header, then you should always use this + member function to set the splitter position, instead of + ones present in wxPropertyGrid or wxPropertyGridPage. */ void SetSplitterPosition( int pos, int column = 0 ); - /** Synonyme for SelectPage(name). */ - void SetStringSelection( const wxChar* name ); + /** + Show or hide the property grid header control. It is hidden + by the default. + + @remarks Grid may look better if you use wxPG_NO_INTERNAL_BORDER + window style when showing a header. + */ + void ShowHeader(bool show = true); protected: @@ -463,8 +511,11 @@ protected: // /** - Creates property grid for the manager. - Override to use subclassed wxPropertyGrid. + Creates property grid for the manager. Reimplement in derived class to + use subclassed wxPropertyGrid. However, if you do this then you + must also use the two-step construction (ie. default constructor and + Create() instead of constructor with arguments) when creating the + manager. */ virtual wxPropertyGrid* CreatePropertyGrid() const; };