1 | # +-----------------------------------------------------------------------+ |
---|
2 | # | pLoader - a Perl photo uploader for Piwigo | |
---|
3 | # +-----------------------------------------------------------------------+ |
---|
4 | # | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | |
---|
5 | # +-----------------------------------------------------------------------+ |
---|
6 | # | This program is free software; you can redistribute it and/or modify | |
---|
7 | # | it under the terms of the GNU General Public License as published by | |
---|
8 | # | the Free Software Foundation | |
---|
9 | # | | |
---|
10 | # | This program is distributed in the hope that it will be useful, but | |
---|
11 | # | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
12 | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
13 | # | General Public License for more details. | |
---|
14 | # | | |
---|
15 | # | You should have received a copy of the GNU General Public License | |
---|
16 | # | along with this program; if not, write to the Free Software | |
---|
17 | # | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
18 | # | USA. | |
---|
19 | # +-----------------------------------------------------------------------+ |
---|
20 | package Uploader::GUI::wxImageView; |
---|
21 | use Wx qw/wxDefaultPosition wxDefaultSize wxLC_ICON wxIMAGE_LIST_NORMAL wxLC_LIST |
---|
22 | wxSUNKEN_BORDER wxLC_EDIT_LABELS/; |
---|
23 | use base qw/Wx::ListCtrl/; |
---|
24 | use strict; |
---|
25 | |
---|
26 | sub new { |
---|
27 | my ( $class, $parentwnd, $images ) = @_; |
---|
28 | |
---|
29 | |
---|
30 | my $self = $class->SUPER::new( $parentwnd, -1, wxDefaultPosition, wxDefaultSize, wxLC_LIST| |
---|
31 | wxSUNKEN_BORDER|wxLC_EDIT_LABELS ); |
---|
32 | $self->SetSingleStyle( wxLC_ICON ); |
---|
33 | $self->Initialize($images); |
---|
34 | |
---|
35 | return $self; |
---|
36 | } |
---|
37 | |
---|
38 | sub Initialize { |
---|
39 | my ( $self, $images ) = @_; |
---|
40 | |
---|
41 | $self->AssignImageList( $images, wxIMAGE_LIST_NORMAL ); |
---|
42 | |
---|
43 | for( my $i = 0 ; $i < $images->GetImageCount ; $i++ ) { |
---|
44 | my $idx = $self->InsertStringImageItem( $i, "Item $i", $i % 5 ); |
---|
45 | $self->SetItemData( $idx, $i ); |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | 1; |
---|