source: extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm @ 4750

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

Re-upload management dialog : add wxSTAY_ON_TOP attribute to make it always visible.

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