source: extensions/pLoader/trunk/src/Uploader/GUI/wxDestinationCategoryDlg.pm @ 5538

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

Feature 1562 : remove STAY_ON_TOP attribute.

File size: 3.2 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::wxDestinationCategoryDlg;
21use strict;
22use Wx qw/
23             wxDefaultSize
24             wxDefaultPosition
25             wxDIALOG_NO_PARENT
26             wxDEFAULT_DIALOG_STYLE
27             wxMAXIMIZE_BOX
28             wxMINIMIZE_BOX
29             wxID_CANCEL
30             wxID_OK
31         /;
32use base qw/Wx::Dialog Uploader::GUI::DlgCommon Class::Accessor::Fast/;
33use Wx::Event qw/
34                    EVT_BUTTON
35                /;
36
37__PACKAGE__->mk_accessors( 
38    qw/
39           btok
40      / 
41);
42use Carp;
43use Uploader::GUI::wxCategoryTreeCtrl;
44
45sub new {
46    my ($this, $params) = @_;
47    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
48    my $class = ref($this) || $this;
49
50
51    my $self = $class->SUPER::new(
52        undef, 
53        -1,
54        $params->{caption},
55        wxDefaultPosition,
56        [450, 300],
57             wxDIALOG_NO_PARENT|
58             wxDEFAULT_DIALOG_STYLE|
59             wxMAXIMIZE_BOX|
60             wxMINIMIZE_BOX
61    );
62    # load controls
63    &main::DestinationCategory($self, $params );
64
65    $self->properties(
66        $params->{properties}
67    );
68
69    $self->InitLabels();
70    $self->InitChoices();
71    $self->SetProperties();
72    $self->InitHandler();
73
74    $self->init_event_handlers();
75   
76    $self->btok( $self->FindWindow($main::DESTINATION_CATEGORIES_OK) );
77    $self->btok->Enable(0);
78
79    $self;
80}
81
82
83sub init_event_handlers {
84    my ( $self ) = @_;
85   
86    EVT_BUTTON( $self, $main::DESTINATION_CATEGORIES_OK, \&OnOK );
87    EVT_BUTTON( $self, $main::DESTINATION_CATEGORIES_CANCEL, \&OnCancel );
88   
89}
90
91# Update progress information
92
93sub OnOK {
94    my ( $self, $event ) = @_;
95   
96    $self->EndModal(wxID_OK);
97}
98
99
100sub OnCancel {
101    my ( $self, $event ) = @_;
102   
103    $self->ClearProperties;
104    $self->EndModal(wxID_CANCEL);
105}
106
1071;
Note: See TracBrowser for help on using the repository browser.