| 1 | package Tk::ListBrowser::Bar; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Tk::ListBrowser::Bar - Bar organizer for Tk::ListBrowser. | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | require Tk::ListBrowser; | ||
| 10 | my $ib= $window->ListBrowser(@options, | ||
| 11 | -arrange => 'bar' | ||
| 12 | )->pack; | ||
| 13 | $ib->add('item_1', -image => $image1, -text => $text1); | ||
| 14 | $ib->add('item_2', -image => $image2, -text => $text2); | ||
| 15 | $ib->refresh; | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | Contains all the drawing routines for L<Tk::ListBrowser> to | ||
| 20 | draw and navigate the list in a bar organized manner. | ||
| 21 | |||
| 22 | No user serviceable parts inside. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | use strict; | ||
| 27 | use warnings; | ||
| 28 | use vars qw ($VERSION); | ||
| 29 | $VERSION = 0.04; | ||
| 30 | |||
| 31 | use base qw(Tk::ListBrowser::Row); | ||
| 32 | |||
| 33 | sub new { | ||
| 34 | my $class = shift; | ||
| 35 | my $self = $class->SUPER::new(@_); | ||
| 36 | return $self | ||
| 37 | } | ||
| 38 | |||
| 39 | sub nextPosition { | ||
| 40 | my ($self, $x, $y, $column, $row) = @_; | ||
| 41 | my $cellwidth = $self->cget('-cellwidth'); | ||
| 42 | $x = $x + $cellwidth + 1; | ||
| 43 | $column ++; | ||
| 44 | return ($x, $y, $column, $row) | ||
| 45 | } | ||
| 46 | |||
| 47 | |||
| 48 | sub scroll { | ||
| 49 | return 'horizontal' | ||
| 50 | } | ||
| 51 | |||
| 52 | sub type { | ||
| 53 | return 'bar' | ||
| 54 | } | ||
| 55 | |||
| 56 | =head1 LICENSE | ||
| 57 | |||
| 58 | Same as Perl. | ||
| 59 | |||
| 60 | =head1 AUTHOR | ||
| 61 | |||
| 62 | Hans Jeuken (hanje at cpan dot org) | ||
| 63 | |||
| 64 | =head1 TODO | ||
| 65 | |||
| 66 | =over 4 | ||
| 67 | |||
| 68 | =back | ||
| 69 | |||
| 70 | =head1 BUGS AND CAVEATS | ||
| 71 | |||
| 72 | If you find any bugs, please report them here: L<https://github.com/haje61/Tk-ListBrowser/issues>. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 1; |