// 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
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
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
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