Changeset 4477 for extensions/pLoader
- Timestamp:
- Dec 13, 2009, 5:17:20 PM (14 years ago)
- Location:
- extensions/pLoader/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/res/photo_properties_wdr.pl
r4476 r4477 17 17 use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW ); 18 18 use Wx qw( wxALIGN_RIGHT wxALIGN_BOTTOM wxALIGN_CENTER wxALIGN_CENTER_VERTICAL wxALIGN_CENTER_HORIZONTAL ); 19 use Wx qw( wxTE_MULTILINE );19 use Wx qw( wxTE_MULTILINE wxDP_DROPDOWN ); 20 20 21 21 # Bitmap functions … … 67 67 $item2->AddWindow( $item9, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); 68 68 69 my( $item10 ) = Wx:: TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CREATE_DATE, "", wxDefaultPosition, [200,-1], 0);69 my( $item10 ) = Wx::DatePickerCtrl->new( $parent, $main::PHOTO_PROPERTIES_CREATE_DATE, Wx::DateTime->new(), wxDefaultPosition, [200,-1], wxDP_DROPDOWN ); 70 70 $item2->AddWindow( $item10, 0, wxALIGN_CENTER_VERTICAL, 5 ); 71 71 -
extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
r4476 r4477 1 1 package Uploader::GUI::DlgCommon; 2 2 use strict; 3 use Wx::Calendar; 3 4 4 5 use base qw/ … … 19 20 'Wx::TextCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_TEXT( $ctrl, $ctrl, sub { $self->OnTextCtrl(@_) } ); }, 20 21 'Wx::Choice' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_CHOICE( $ctrl, $ctrl, sub { $self->OnChoice(@_) } ); }, 22 'Wx::DatePickerCtrl' => sub { my ( $ctrl ) = @_; Wx::Event::EVT_DATE_CHANGED( $ctrl, $ctrl, sub { $self->OnDatePicker(@_) } ); }, 21 23 }; 22 24 … … 63 65 } 64 66 67 sub OnDatePicker { 68 my ( $self, $ctrl, $event ) = @_; 69 70 my $id = $ctrl->GetId; 71 72 # change the property value 73 $self->properties->{$id}->{value}->( 74 $event->GetDate->FormatISODate 75 ) if exists $self->properties->{$id}->{value}; 76 # exec the callback 77 $self->properties->{$id}->{frame_callback}->() if exists 78 $self->properties->{$id}->{frame_callback}; 79 80 } 81 65 82 66 83 my $change_value = { 67 84 'Wx::TextCtrl' => sub { my ($ctrl, $value ) = @_; $ctrl->ChangeValue($value)}, 68 85 'Wx::CheckBox' => sub { my ($ctrl, $value ) = @_; $ctrl->SetValue($value)}, 86 'Wx::DatePickerCtrl' => sub { my ($ctrl, $value ) = @_; 87 my $date = Wx::DateTime->new; 88 my ($yyyy, $mm, $dd, $hh, $mi, $ss ) = split(/[:\/\\\-\.\s]/, $value); 89 $date->ParseDate( 90 sprintf("%s/%s/%s", $yyyy, $mm, $dd) 91 ); 92 $ctrl->SetValue($date); 93 }, 69 94 }; 70 95 … … 74 99 map { 75 100 my $ctrl =$self->FindWindow($_); 76 #printf("ctrl %s : %s\n", $_, $ctrl);77 101 if(defined $ctrl){ 78 102 # checkbox, static text … … 141 165 if(defined $ctrl){ 142 166 # checkbox, static text 167 $self->properties->{$_}->{value}->( 168 $ctrl->GetValue() 169 ) if exists $self->properties->{$_}->{value}; 143 170 144 $self->properties->{$_}->{value}->( 145 $ctrl->GetValue() 146 ) if exists $self->properties->{$_}->{value}; 147 148 $self->properties->{$_}->{selection}->( 149 $ctrl->GetSelection() 150 ) if exists $self->properties->{$_}->{selection}; 151 152 printf("selection %s\n", $ctrl->GetSelection())if exists $self->properties->{$_}->{selection}; 153 171 $self->properties->{$_}->{selection}->( 172 $ctrl->GetSelection() 173 ) if exists $self->properties->{$_}->{selection}; 154 174 } 155 175 } -
extensions/pLoader/trunk/src/Uploader/GUI/wxPhotoProperties.pm
r4476 r4477 23 23 wxDefaultSize 24 24 wxDefaultPosition 25 wxTAB_TRAVERSAL 25 26 wxID_CANCEL 26 27 wxID_OK … … 43 44 44 45 # my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, [600, 350]); 45 my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, wxDefaultSize );46 my $self = $class->SUPER::new( $params->{parentwnd}, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); 46 47 #$self->SetMinSize([600, 350]); 47 48 # load controls -
extensions/pLoader/trunk/src/Uploader/Image.pm
r4476 r4477 45 45 sub Init { 46 46 my ( $self ) = @_; 47 47 48 } 48 49 … … 56 57 57 58 sub create_date { 58 my ( $self ) = @_;59 my ( $self, $date ) = @_; 59 60 60 61 my $exif = $self->exif_metadata ; 61 62 $exif->{CreateDate}; 62 63 $self->{-create_date} ||= $exif->{CreateDate}; 64 65 $self->{-create_date} = $date if defined $date; 66 67 $self->{-create_date}; 63 68 } 64 69
Note: See TracChangeset
for help on using the changeset viewer.