NAME
Tickit::Widget::Table::Column - a column in a Ticket::Widget::Table
VERSION
version 0.101
DESCRIPTION
A column includes a single header cell, and zero or more data cells.
METHODS
new
Instantiate a new column.
Takes the following named parameters:
table - the Tickit::Widget::Table which will hold this column
label (optional) - a label to use for the header cell, if appropriate
width (optional) - how wide we'd like to be
align (optional) - type of alignment, should be one of left, right, center|centre
format - any formatting to apply. currently a bit vague.
can_highlight - whether this column is highlightable, if not then any change to highlighting will skip this column.
Returns the new instance.
format_by_name
Returns the appropriate format coderef for the given string.
Currently the format can be one of:
datetime - %Y-%m-%dT%H:%M:%S
date - %Y-%m-%d
time - %H:%M:%S
format
Returns the format type for this column.
apply_format
Formats the given value according to the requirements of this column's formatting settings.
remove_row
Remove the given row from this column.
add_header_cell
Attach the given header cell to this column.
lines
Number of lines in this widget - since we draw indirectly via cells, this is left as 1.
cols
Returns the number of (screen) columns we'd like to have.
width_type
What sort of width this is. Probably something like left|right|auto
width
The width for this column. Should probably return a number.
displayed_width
This returns the actual displayed width, i.e. the real number of (screen) columns used. I think.
align
Returns the current alignment setting.
label
Returns the current label for this column.
set_displayed_width
Change the displayed width.
table
Accessor for the containing Tickit::Widget::Table.
add_cell
Adds a new Tickit::Widget::Cell to the end of this column.
add_row
Does nothing at all yet has a confusingly purposeful name.
autofit
Makes a wild guess as to how wide we should be then sets the displayed width accordingly.
render_to_rb
Does nothing, for cases where we're attached to something as a real widget.
idx
Our index in the containing Tickit::Widget::Table. Zero-based.
update_style
Updates the pen for all contained cells.
Returns $self.
cells
Returns a list of all contained Tickit::Widget::Cell instances.
INHERITED METHODS
- Tickit::Widget
-
get_style_pen, get_style_text, get_style_values, key_focus_next_after, key_focus_next_before, on_pen_changed, parent, pen, redraw, reshape, resized, set_parent, set_pen, set_style, set_style_tag, set_window, style_classes, take_focus, window, window_gained, window_lost
- Tickit::Widget::Table::Highlight
-
action, activate, can_highlight, highlighted, is_highlighted, is_selected
AUTHOR
Tom Molesworth <cpan@entitymodel.com>
LICENSE
Copyright Tom Molesworth 2011. Licensed under the same terms as Perl itself.