X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dcb6cbecc890c65e15ade46ca416b4c353bb7e8f..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/interface/wx/headercol.h diff --git a/interface/wx/headercol.h b/interface/wx/headercol.h index 5c63468e3e..f3ff0796cf 100644 --- a/interface/wx/headercol.h +++ b/interface/wx/headercol.h @@ -5,13 +5,25 @@ // Created: 2008-12-01 // RCS-ID: $Id$ // Copyright: (c) 2008 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** - Special value used for column width meaning unspecified or default. + Column width special values. */ -enum { wxCOL_WIDTH_DEFAULT = -1 }; +enum +{ + /// Special value used for column width meaning unspecified or default. + wxCOL_WIDTH_DEFAULT = -1, + + /** + Size the column automatically to fit all values. + + @note On OS X, this style is only implemented in the Cocoa build on + OS X >= 10.5; it behaves identically to wxCOL_WIDTH_DEFAULT otherwise. + */ + wxCOL_WIDTH_AUTOSIZE = -2 +}; /** Bit flags used as wxHeaderColumn flags. @@ -77,7 +89,8 @@ public: Returns the current width of the column. @return - Width of the column in pixels, never wxCOL_WIDTH_DEFAULT. + Width of the column in pixels, never wxCOL_WIDTH_DEFAULT or + wxCOL_WIDTH_AUTOSIZE. */ virtual int GetWidth() const = 0; @@ -199,15 +212,16 @@ public: Set the column width. @param width - The column width in pixels or the special wxCOL_WIDTH_DEFAULT value - meaning to use default width. + The column width in pixels or the special wxCOL_WIDTH_DEFAULT + (meaning to use default width) or wxCOL_WIDTH_AUTOSIZE (size to + fit the content) value. */ virtual void SetWidth(int width) = 0; /** Set the minimal column width. - This method can be used with resizeable columns (i.e. those for which + This method can be used with resizable columns (i.e. those for which wxCOL_RESIZABLE flag is set in GetFlags() or, alternatively, IsResizeable() returns @true) to prevent the user from making them narrower than the given width. @@ -288,11 +302,11 @@ public: Call this to enable or disable interactive resizing of the column by the user. - By default, the columns are resizeable. + By default, the columns are resizable. - Equivalent to ChangeFlag(wxCOL_RESIZABLE, resizeable). + Equivalent to ChangeFlag(wxCOL_RESIZABLE, resizable). */ - virtual void SetResizeable(bool resizeable); + virtual void SetResizeable(bool resizable); /** Allow clicking the column to sort the control contents by the field in @@ -324,38 +338,26 @@ public: virtual void SetHidden(bool hidden); - /** - Sets this column as the sort key for the associated control. - - Calling this function with @true argument means that this column is - currently used for sorting the control contents and so should typically - display an arrow indicating it (the direction of the arrow depends on - IsSortOrderAscending() return value). - - Don't confuse this function with SetSortable() which should be used to - indicate that the column @em may be used for sorting while this one is - used to indicate that it currently @em is used for sorting. Of course, - SetAsSortKey() can be only called for sortable columns. - - @param sort - Sort (default) or don't sort the control contents by this column. - */ - virtual void SetAsSortKey(bool sort = true) = 0; - /** Don't use this column for sorting. - This is equivalent to calling SetAsSortKey() with @false argument. + This is the reverse of SetSortOrder() and is called to indicate that + this column is not used for sorting any longer. */ void UnsetAsSortKey(); /** - Sets the sort order for this column. + Sets this column as the sort key for the associated control. - This only makes sense for sortable columns which are currently used as - sort key, i.e. for which IsSortKey() returns @true and is only taken - into account by the control in which this column is inserted, this - function just stores the sort order in the wxHeaderColumn object. + This function indicates that this column is currently used for sorting + the control and also sets the sorting direction. Notice that actual + sorting is only done in the control associated with the header, this + function doesn't do any sorting on its own. + + Don't confuse this function with SetSortable() which should be used to + indicate that the column @em may be used for sorting while this one is + used to indicate that it currently @em is used for sorting. Of course, + SetSortOrder() can be only called for sortable columns. @param ascending If @true, sort in ascending order, otherwise in descending order. @@ -393,7 +395,7 @@ public: @library{wxcore} @category{ctrl} */ -class wxHeaderColumnSimple : public wxHeaderColumn +class wxHeaderColumnSimple : public wxSettableHeaderColumn { public: //@{ @@ -409,7 +411,7 @@ public: int flags = wxCOL_DEFAULT_FLAGS); wxHeaderColumnSimple(const wxBitmap &bitmap, - int width = wxDVC_DEFAULT_WIDTH, + int width = wxCOL_WIDTH_DEFAULT, wxAlignment align = wxALIGN_CENTER, int flags = wxCOL_DEFAULT_FLAGS); //@} @@ -430,7 +432,6 @@ public: virtual wxAlignment GetAlignment() const; virtual void SetFlags(int flags); virtual int GetFlags() const; - virtual void SetAsSortKey(bool sort = true); virtual bool IsSortKey() const; virtual void SetSortOrder(bool ascending); virtual bool IsSortOrderAscending() const;