The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tickit::Widget::Table::Paged - table widget with support for scrolling/paging

VERSION

version 0.001

SYNOPSIS

 use Tickit;
 use Tickit::Widget::Table::Paged;

 my $tbl = Tickit::Widget::Table::Paged->new;
 $tbl->{row_offset} = 0;
 $tbl->add_column(
        label => 'Left',
        align => 'left',
        width => 8,
 );
 $tbl->add_column(
        label => 'Second column',
        align => 'centre'
 );
 $tbl->add_row('left', 'middle') for 1..100;
 Tickit->new(root => $tbl)->run;

DESCRIPTION

WARNING: This is a preview release. API is subject to change in future, please get in contact if you're using this, or wait for version 1.000.

This widget provides a scrollable table implementation.

Paged table widget in action

METHODS

new

Instantiate. Will attempt to take focus.

lines

Number of lines to request.

cols

Number of columns to request.

vscroll

True if there's a vertical scrollbar.

hscroll

True if there's a horizontal scrollbar.

row_offset

Current row offset (vertical scroll position).

visible_lines

Returns the list of lines currently visible in the display.

header_rect

Returns the Tickit::Rect representing the header area.

body_rect

Returns the Tickit::Rect representing the body area.

scrollbar_rect

Returns the Tickit::Rect representing the scroll bar.

render_header

Render the header area.

render_to_rb

Render the table.

render_body

Render the body area.

apply_column_widget

Add widgets for the column.

render_scrollbar

Render the scrollbar.

render_cell

Render a given cell.

reshape

Handle reshape requests.

distribute_columns

Distribute space between columns.

window_gained

Called when a window has been assigned to the widget.

expose_rows

Expose the given rows.

highlight_row

Returns the index of the currently-highlighted row.

highlight_visible_row

Returns the position of the highlighted row taking scrollbar into account.

key_previous_row

Go to the previous row.

scroll_highlight

Update scroll information after changing highlight position.

move_highlight

Change the highlighted row.

key_next_row

Move to the next row.

key_first_row

Move to the first row.

key_last_row

Move to the last row.

key_previous_page

Go up a page.

key_next_page

Go down a page.

scroll_position

Current vertical scrollbar position.

row_count

Total number of rows.

sb_height

Current scrollbar height.

scroll_rows

Positions of the scrollbar indicator.

active_scrollbar_rect

Rectangle representing the area covered by the current scrollbar.

scroll_dimension

Size of the vertical scrollbar.

clear

Clear all data in the table.

add_row

Add a row to the table.

add_column

Add a new column. Takes some parameters.

key_next_column

Move to the next column.

key_previous_column

Move to the previous column.

key_first_column

Move to the first column.

key_last_column

Move to the last column.

key_activate

Activate the highlighted item.

TODO

Current list of pending features:

  • Storage abstraction - the main difference between this widget and Tickit::Widget::Table is that this is designed to work with a storage abstraction. The current abstraction implementation needs more work before it's reliable enough for release, so this version only has basic arrayref support.

  • Column and cell highlighting modes

  • Multiselection

  • Proper widget-in-cell support

  • Formatters for converting raw cell data into printable format (without having to go through a separate widget)

SEE ALSO

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, resized, set_parent, set_pen, set_style, set_style_tag, set_window, style_classes, take_focus, window, window_lost

AUTHOR

Tom Molesworth <cpan@entitymodel.com>

LICENSE

Copyright Tom Molesworth 2012-2013. Licensed under the same terms as Perl itself.