X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94f0292941b6520afbabc999da698ef5fe576a46..937d5b6075db060b98daa0f0fadbaa528bc85554:/include/wx/propgrid/manager.h diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index f0addd43ed..bfc3e6cdf8 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -23,6 +23,7 @@ #include "wx/button.h" #include "wx/textctrl.h" #include "wx/dialog.h" +#include "wx/headerctrl.h" // ----------------------------------------------------------------------- @@ -65,9 +66,7 @@ class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler, public wxPropertyGridPageState { friend class wxPropertyGridManager; -#ifndef SWIG DECLARE_CLASS(wxPropertyGridPage) -#endif public: wxPropertyGridPage(); @@ -163,8 +162,7 @@ protected: */ virtual void DoSetSplitterPosition( int pos, int splitterColumn = 0, - bool allPages = false, - bool fromAutoCenter = false ); + int flags = wxPG_SPLITTER_REFRESH ); /** Page label (may be referred as name in some parts of documentation). Can be set in constructor, or passed in @@ -190,6 +188,11 @@ private: // ----------------------------------------------------------------------- +#if wxUSE_HEADERCTRL +class wxPGHeaderCtrl; +#endif + + /** @class wxPropertyGridManager wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid, @@ -212,39 +215,18 @@ private: class WXDLLIMPEXP_PROPGRID wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface { -#ifndef SWIG DECLARE_CLASS(wxPropertyGridManager) -#endif friend class wxPropertyGridPage; public: -#ifdef SWIG - %pythonAppend wxPropertyGridManager { - self._setOORInfo(self) - self.DoDefaultTypeMappings() - self.edited_objects = {} - self.DoDefaultValueTypeMappings() - if not hasattr(self.__class__,'_vt2setter'): - self.__class__._vt2setter = {} - } - %pythonAppend wxPropertyGridManager() "" - - wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxPGMAN_DEFAULT_STYLE, - const wxChar* name = - wxPyPropertyGridManagerNameStr ); - %RenameCtor(PrePropertyGridManager, wxPropertyGridManager()); - -#else - +#ifndef SWIG /** Two step constructor. Call Create when this constructor is called to build up the wxPropertyGridManager. */ wxPropertyGridManager(); +#endif /** The default constructor. The styles to be used are styles valid for the wxWindow. @@ -259,8 +241,6 @@ public: /** Destructor */ virtual ~wxPropertyGridManager(); -#endif - /** Creates new property page. Note that the first page is not created automatically. @param label @@ -516,6 +496,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; + virtual void Refresh( bool eraseBackground = true, const wxRect* rect = (const wxRect*) NULL ); @@ -553,7 +539,21 @@ public: return p->GetParentState()->DoSelectProperty(p, focus); } - /** Sets number of columns on given page (default is current page). + /** + 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 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 ); @@ -574,31 +574,38 @@ public: */ void SetSplitterLeft( bool subProps = false, bool allPages = true ); - /** Sets splitter position on individual page. */ - void SetPageSplitterPosition( int page, int pos, int column = 0 ) - { - GetPage(page)->DoSetSplitterPosition( pos, column ); - } + /** + Sets splitter position on individual page. - /** 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 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. + + 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 ); -#ifdef SWIG - %pythoncode { - def GetValuesFromPage(self, - page, - dict_=None, - as_strings=False, - inc_attributes=False): - "Same as GetValues, but returns values from specific page only." - "For argument descriptions, see GetValues." - return page.GetPropertyValues(dict_, as_strings, inc_attributes) - } +#if wxUSE_HEADERCTRL + /** + 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); #endif protected: @@ -630,14 +637,13 @@ public: virtual void SetExtraStyle ( long exStyle ); virtual bool SetFont ( const wxFont& font ); virtual void SetWindowStyleFlag ( long style ); + virtual bool Reparent( wxWindowBase *newParent ); + +#ifndef SWIG protected: virtual wxSize DoGetBestSize() const; -public: - -#ifndef SWIG - // // Event handlers // @@ -651,8 +657,8 @@ public: void OnToolbarClick( wxCommandEvent &event ); void OnResize( wxSizeEvent& event ); void OnPropertyGridSelect( wxPropertyGridEvent& event ); + void OnPGColDrag( wxPropertyGridEvent& event ); -protected: wxPropertyGrid* m_pPropGrid; @@ -660,12 +666,17 @@ protected: #if wxUSE_TOOLBAR wxToolBar* m_pToolbar; +#endif +#if wxUSE_HEADERCTRL + wxPGHeaderCtrl* m_pHeaderCtrl; #endif wxStaticText* m_pTxtHelpCaption; wxStaticText* m_pTxtHelpContent; wxPropertyGridPage* m_emptyPage; + wxArrayString m_columnLabels; + long m_iFlags; // Selected page index. @@ -695,6 +706,8 @@ protected: unsigned char m_onSplitter; + bool m_showHeader; + virtual wxPGProperty* DoGetPropertyByName( const wxString& name ) const; /** Select and displays a given page. */