X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/613de0e89efab1cbf8463ea06e0cf0b2914fbce9..247b70c6c79e76e8296ba63b21997b9ba0f2861b:/include/wx/headerctrl.h diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index e404f166db..64ca3c4540 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -130,9 +130,20 @@ public: // with wxHD_ALLOW_HIDE style bool ShowColumnsMenu(const wxPoint& pt, const wxString& title = wxString()); + // append the entries for all our columns to the given menu, with the + // currently visible columns being checked + // + // this is used by ShowColumnsMenu() but can also be used if you use your + // own custom columns menu but nevertheless want to show all the columns in + // it + // + // the ids of the items corresponding to the columns are consecutive and + // start from idColumnsBase + void AddColumnsItems(wxMenu& menu, int idColumnsBase = 0); + // show the columns customization dialog and return true if something was // changed using it (in which case UpdateColumnVisibility() and/or - // UpdateColumnWidth() will have been called) + // UpdateColumnsOrder() will have been called) // // this is called by the control itself from ShowColumnsMenu() (which in // turn is only called by the control if wxHD_ALLOW_HIDE style was @@ -154,7 +165,7 @@ public: protected: // this method must be implemented by the derived classes to return the // information for the given column - virtual wxHeaderColumn& GetColumn(unsigned int idx) = 0; + virtual const wxHeaderColumn& GetColumn(unsigned int idx) const = 0; // this method is called from the default EVT_HEADER_SEPARATOR_DCLICK // handler to update the fitting column width of the given column, it @@ -174,6 +185,15 @@ protected: wxFAIL_MSG( "must be overridden if called" ); } + // this method is called from ShowCustomizeDialog() to reorder all columns + // at once and should be implemented for controls using wxHD_ALLOW_REORDER + // style (there is no need to call SetColumnsOrder() from here, this is + // done by the control itself) + virtual void UpdateColumnsOrder(const wxArrayInt& WXUNUSED(order)) + { + wxFAIL_MSG( "must be overridden if called" ); + } + // this method can be overridden in the derived classes to do something // (e.g. update/resize some internal data structures) before the number of // columns in the control changes @@ -302,7 +322,7 @@ public: protected: // implement/override base class methods - virtual wxHeaderColumn& GetColumn(unsigned int idx); + virtual const wxHeaderColumn& GetColumn(unsigned int idx) const; virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle); // and define another one to be overridden in the derived classes: it