source: extensions/pLoader/trunk/src/Uploader/GUI/wxPhotoProperties.pm @ 4779

Last change on this file since 4779 was 4779, checked in by ronosman, 14 years ago

Change copyright notice to add 2010.

File size: 2.9 KB
Line 
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# +-----------------------------------------------------------------------+
20package Uploader::GUI::wxPhotoProperties;
21use strict;
22use Wx qw/
23             wxDefaultSize
24             wxDefaultPosition
25             wxTAB_TRAVERSAL
26             wxID_CANCEL
27             wxID_OK
28             wxGREEN
29         /;
30use base qw/Wx::Panel Uploader::GUI::DlgCommon/;
31use Wx::Event qw/
32                    EVT_UPDATE_UI
33                    EVT_BUTTON
34                    EVT_CLOSE
35                /;
36
37use Carp;
38
39sub new {
40    my ($this, $params) = @_;
41    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
42    my $class = ref($this) || $this;
43
44
45    my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, [-1, -1], wxTAB_TRAVERSAL );
46    # load controls
47    eval {
48      &main::PhotoProperties($self, $params->{tags});
49
50            $self->properties(
51            $params->{properties}
52        );
53
54        $self->InitLabels();
55                $self->InitChoices();
56        $self->SetProperties();
57                $self->InitHandler();
58        $self->_initEventHandlers();
59
60                if($@){
61                        Wx::LogMessage("Error during dialogbox initialization");
62                }
63        };
64
65    $self;   
66}
67
68
69
70sub _initEventHandlers {
71    my ( $self ) = @_;
72   
73    EVT_BUTTON( $self, $main::ID_REUPLOAD_OK, \&OnOK );
74    EVT_CLOSE( $self, \&OnClose );
75   
76       
77}
78
79
80sub OnOK {
81    my ( $self, $event ) = @_;
82   
83    $self->_close;
84}
85
86sub OnClose {
87    my ( $self, $event ) = @_;
88       
89        $self->_close;
90}
91
92sub _close {
93    my ( $self ) = @_;
94
95    $self->GetProperties();
96
97    $self->Destroy;
98}
99
1001;
Note: See TracBrowser for help on using the repository browser.