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

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

Feature 1539 added : When uploading, display a dialog box with the categories list when no category is selected

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