source: extensions/pLoader/trunk/src/Uploader/GUI/wxImageView.pm @ 4118

Last change on this file since 4118 was 2597, checked in by ronosman, 16 years ago

pLoader initial release

  • Property svn:eol-style set to LF
File size: 2.2 KB
Line 
1# +-----------------------------------------------------------------------+
2# | pLoader - a Perl photo uploader for Piwigo                            |
3# +-----------------------------------------------------------------------+
4# | Copyright(C) 2008      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# +-----------------------------------------------------------------------+
20package Uploader::GUI::wxImageView;
21use Wx qw/wxDefaultPosition wxDefaultSize wxLC_ICON wxIMAGE_LIST_NORMAL wxLC_LIST
22                                       wxSUNKEN_BORDER wxLC_EDIT_LABELS/;
23use base qw/Wx::ListCtrl/;
24use strict;
25
26sub 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
38sub 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
491;
Note: See TracBrowser for help on using the repository browser.