| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
ColumnAutoSizeMixin
Enhancement to ListCtrl (Report mode only) to handle initial column sizing.
Resizes columns to a size based on the contents, or with a minimum, a maximum, or a fixed size. It is geared to create reasonable column sizes upon initial display of the ListCtrl, but is also used in response to resize events.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
Initialized required parameters. This constructor must be called within the init method of the associated ListCtrl class using this mixin in order to set up some required parameters. If the automatic scaling is used in response to user resize events and the ListCtrl class also binds the wx.EVT_SIZE event, it will have to manually call the mixin's OnSize method, otherwise the mixin will not automatically resize the columns in the list. Keyword arguments recognized: resize: True/False value indicating if the wx.EVT_SIZE event should be caught and the list columns should be resized in response to the user resizing the window. (Default is True)
|
Insert a column in the ListCtrl, used instead of InsertColumn. Insert a column into the ListCtrl, replacing a call to InsertColumn. Don't mix calls to InsertColumn and InsertSizedColumn, as undefined things will result. Once you decide to use the ColumnAutoSizeMixin, only use InsertSizedColumn to insert columns. You can insert a non-sized column by specifying the same value for min and max. All arguments to InsertColumn are accepted to this method, and are handled as expected. Keyword parameters control how the column resizing takes place. The following keyword arguments are accepted: min: minimum allowable width for the column. If min is an integer, that value is used. If min is a string, the width in pixels of the string in the current font is used as the minimum size. If min is not specified or is None, there is no minimum size and the column can be sized down to zero width. max: maximum allowable width for the column. As for min, the value for max can be an integer or a string or None, but in this case specifies the maximum width. If None, there is no maximum size. greedy: True/False value indicating whether or not the column should be scaled in rough proportion to its preferred width if all columns were allowed to be their preferred width as compared to the width based on attempting to fit as many columns in the list without using a horizontal scrollbar. To restate: if True, the column will be greedy and take as much space as it requires to satisfy its autosize, min, and max constraints. Otherwise it can be scaled smaller (or larger) as required in an attempt to fit more columns in the visible part of list. (Default is False) expand: True/False indicating if the column should be expanded to fill available width if there is some empty space after all columns are at their preferred sizes. This has no effect when the preferred sizes of all columns is larger than the available width, and is only used if you don't want empty space in your list. ok_offscreen: True/False value indicating if this column and subsequent columns are initially allowed to be placed offscreen if the width of the columns prior to it have preferred sizes that don't allow this column to be placed entirely on screen. (Default is False) -- Note that if both min and max are None, the column will be sized to its width as determined by wx.LIST_AUTOSIZE. (Unless 'greedy' is explicitly set for the column, in which case the column will also respect the value to greedy. |
User callable method to compute and display new sizes of all columns. Use this method to recompute and redisplay the column sizes when, for instance, you change the contents of the list. |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Feb 21 14:51:17 2008 | http://epydoc.sourceforge.net |