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

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

Feature 1539. Missing file in r5390.

File size: 3.4 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_BUTTON
33                    EVT_CLOSE
34                /;
35
36use Carp;
37use Data::Dumper;
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    &main::PhotoPropertiesCategoriesTags( $self, $params->{categories} );
48
49    $self->_initNotebook($params->{tags});
50
51
52    $self->properties(
53        $params->{properties}
54    );
55
56    $self->InitLabels();
57    $self->InitChoices();
58    $self->SetProperties();
59    $self->InitHandler();
60    $self->_initEventHandlers();
61
62    if($@){
63        Wx::LogMessage("Error during dialogbox initialization");
64    }
65
66
67    $self;   
68}
69
70
71
72sub _initEventHandlers {
73    my ( $self ) = @_;
74   
75    EVT_BUTTON( $self, $main::ID_REUPLOAD_OK, \&OnOK );
76    EVT_CLOSE( $self, \&OnClose );
77   
78}
79
80
81sub _initNotebook{
82    my ( $self, $tags ) = @_;
83
84    my $nb = $self->FindWindow(
85        $main::PHOTO_PROPERTIES_NB
86    );
87
88    my( $page1 ) = Wx::Panel->new( $nb, -1 );
89    &main::photo_properties_caption_comments( $page1, 0 );
90    $nb->AddPage( $page1, "Photo informations" );
91
92    my( $page2 ) = Wx::Panel->new( $nb, -1 );
93    &main::photo_properties_tags( $page2, $tags );
94    $nb->AddPage( $page2, "Tags" );
95
96    $self->{notebook} = $nb;
97
98}
99
100
101sub OnOK {
102    my ( $self, $event ) = @_;
103   
104    $self->_close;
105}
106
107sub OnClose {
108    my ( $self, $event ) = @_;
109       
110        $self->_close;
111}
112
113sub _close {
114    my ( $self ) = @_;
115
116    $self->GetProperties();
117
118    $self->Destroy;
119}
120
1211;
Note: See TracBrowser for help on using the repository browser.