Changeset 4469 for extensions/pLoader/trunk/src
- Timestamp:
- Dec 10, 2009, 9:04:35 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
r4467 r4469 2 2 use strict; 3 3 4 use base qw/ 5 Class::Accessor::Fast 6 /; 7 8 __PACKAGE__->mk_accessors( 9 qw/ 10 properties 11 / 12 ); 13 14 4 15 sub SetProperties { 5 my ( $dlg, $properties) = @_;16 my ( $self ) = @_; 6 17 7 18 map { 8 my $ctrl =$ dlg->FindWindow($_);19 my $ctrl =$self->FindWindow($_); 9 20 #printf("ctrl %s : %s\n", $_, $ctrl); 10 21 if(defined $ctrl){ 11 22 # checkbox, static text 12 23 $ctrl->SetLabel( 13 $ dlg->properties->{$_}->{label}14 ) if exists$ dlg->properties->{$_}->{label};24 $self->properties->{$_}->{label} 25 ) if exists$self->properties->{$_}->{label}; 15 26 16 27 $ctrl->SetValue( 17 $ dlg->properties->{$_}->{value}->()18 ) if exists$ dlg->properties->{$_}->{value};28 $self->properties->{$_}->{value}->() 29 ) if exists$self->properties->{$_}->{value}; 19 30 20 31 # radiobox 21 my $labels =$ dlg->properties->{$_}->{labels};32 my $labels =$self->properties->{$_}->{labels}; 22 33 $labels||=[]; 23 34 for(my $i=0; $i < scalar @$labels ; $i++){ … … 26 37 # only works for control with items 27 38 $ctrl->SetSelection( 28 $ dlg->properties->{$_}->{selection}->()29 ) if exists $ dlg->properties->{$_}->{selection};39 $self->properties->{$_}->{selection}->() 40 ) if exists $self->properties->{$_}->{selection}; 30 41 31 42 } 32 43 } 33 keys % $properties;44 keys %{$self->properties}; 34 45 } 35 46 36 47 sub GetProperties { 37 my ( $dlg, $properties) = @_;48 my ( $self ) = @_; 38 49 39 50 map { 40 my $ctrl = $dlg->FindWindow($_);51 my $ctrl = $self->FindWindow($_); 41 52 #printf("ctrl %s : %s\n", $_, $ctrl); 42 53 if(defined $ctrl){ 43 54 # checkbox, static text 44 55 45 $ dlg->properties->{$_}->{value}->(56 $self->properties->{$_}->{value}->( 46 57 $ctrl->GetValue() 47 ) if exists $dlg->properties->{$_}->{value};58 ) if exists $self->properties->{$_}->{value}; 48 59 49 $ dlg->properties->{$_}->{selection}->(60 $self->properties->{$_}->{selection}->( 50 61 $ctrl->GetSelection() 51 ) if exists $ dlg->properties->{$_}->{selection};62 ) if exists $self->properties->{$_}->{selection}; 52 63 53 64 } 54 65 } 55 keys % $properties;66 keys %{$self->properties}; 56 67 } 57 68 1; -
extensions/pLoader/trunk/src/Uploader/GUI/wxImageReuploadDlg.pm
r4467 r4469 27 27 wxGREEN 28 28 /; 29 use base qw/Wx::Dialog Class::Accessor::Fast/; 29 #use base qw/Wx::Dialog Class::Accessor::Fast Uploader::GUI::DlgCommon/; 30 use base qw/Wx::Dialog Uploader::GUI::DlgCommon/; 30 31 use Wx::Event qw/ 31 32 EVT_UPDATE_UI … … 34 35 /; 35 36 36 __PACKAGE__->mk_accessors(37 qw/38 properties39 /40 );41 37 use Carp; 42 use Uploader::GUI::DlgCommon;43 38 44 39 sub new { … … 57 52 ); 58 53 59 Uploader::GUI::DlgCommon::SetProperties($self, $self->properties);54 $self->SetProperties(); 60 55 $self->_initEventHandlers(); 61 56 … … 95 90 my ( $self ) = @_; 96 91 97 Uploader::GUI::DlgCommon::GetProperties($self, $self->properties);92 $self->GetProperties(); 98 93 99 94 $self->Destroy;
Note: See TracChangeset
for help on using the changeset viewer.