Changeset 5390 for extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
- Timestamp:
- Mar 26, 2010, 9:04:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/DlgCommon.pm
r5184 r5390 50 50 Wx::Event::EVT_TEXT( $ctrl, $ctrl, sub { $self->OnComboBoxText(@_) } ); 51 51 }, 52 'Uploader::GUI::wxCategoryTreeCtrl' => sub { my ( $ctrl ) = @_; 53 Wx::Event::EVT_TREE_SEL_CHANGED( 54 $ctrl, 55 $ctrl, 56 sub { 57 $self->OnCategoryTreeSelChanged(@_); 58 } 59 ); 60 }, 52 61 }; 53 62 54 63 map { 55 64 my $ctrl =$self->FindWindow($_); 65 56 66 if(defined $ctrl){ 57 67 $ctrl_handlers->{ ref $ctrl}->($ctrl) if exists $ctrl_handlers->{ ref $ctrl}; … … 257 267 }; 258 268 269 270 sub OnCategoryTreeSelChanged { 271 my ( $self, $ctrl, $event ) = @_; 272 273 my $id = $ctrl->GetId; 274 275 # change the property value. 276 $self->properties->{$id}->{id_selection}->( 277 $event->GetEventObject->GetSelectionsIds 278 ) if exists $self->properties->{$id}->{id_selection}; 279 280 #printf("OnCategoryTreeSelChanged %s\n", Dumper $self->properties->{$id}->{id_selection}->()); 281 282 # exec the callback 283 $self->properties->{$id}->{frame_callback}->($self, $ctrl, $event) if exists 284 $self->properties->{$id}->{frame_callback}; 285 286 $event->Skip; 287 } 288 289 259 290 my $clear_value = { 260 291 'Wx::TextCtrl' => sub { my ($ctrl) = @_; $ctrl->Clear}, 261 292 'Wx::CheckBox' => sub { my ($ctrl) = @_; $ctrl->SetValue(0)}, 262 293 'Wx::DatePickerCtrl' => sub { my ($ctrl) = @_; $ctrl->SetValue(Wx::DateTime->new->SetToCurrent)}, 294 'Uploader::GUI::wxCategoryTreeCtrl' => sub { my ( $ctrl ) = @_; 295 $ctrl->SelectItem($ctrl->GetRootItem); 296 }, 263 297 }; 264 298
Note: See TracChangeset
for help on using the changeset viewer.