source: extensions/pLoader/trunk/src/Uploader/GUI/wxPropertyListDlg.pm @ 4718

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

Feature 1389 added : remove AUI docking manager

File size: 2.0 KB
Line 
1package Uploader::GUI::wxPropertyListDlg;
2use strict;
3use Wx qw/
4             wxDefaultSize
5             wxDefaultPosition
6             wxLIST_AUTOSIZE
7             wxDEFAULT_DIALOG_STYLE
8
9             wxMAXIMIZE_BOX
10             wxMINIMIZE_BOX
11 
12             wxSTAY_ON_TOP
13         /;
14use Wx::Locale qw/:default/;
15use base qw/Wx::Dialog Uploader::Object2/;
16
17use Data::Dumper;
18__PACKAGE__->mk_accessors(     
19    qw/
20        properties
21        list
22      /
23);
24
25
26
27sub new {
28    my ($this, $params) = @_;
29    #on recupere le nom de la classe en fonction du type d'appel de la méthode.
30    my $class = ref($this) || $this;
31
32
33    my $self = $class->SUPER::new( 
34        undef,
35        -1,
36        gettext("Exif properties"), 
37        wxDefaultPosition, 
38        wxDefaultSize, 
39        wxDEFAULT_DIALOG_STYLE|
40
41        wxMAXIMIZE_BOX|
42        wxMINIMIZE_BOX|
43
44        wxSTAY_ON_TOP
45
46    );
47
48    &main::image_prop_exif($self);
49
50    $self->properties(
51        $params->{properties}
52    );
53    $self->list(
54        $self->FindWindow($main::IMG_PROP_EXIF_LIST)
55    );
56
57    $self->{img_exif_prop_close} = $self->FindWindow($main::IMG_PROP_EXIF_CLOSE);
58
59    $self->{img_exif_prop_close}->SetLabel(
60        gettext("Close")
61    );
62
63    Wx::Event::EVT_BUTTON( $self, $self->{img_exif_prop_close}, \&OnClose );
64
65    $self->list->InsertColumn(0, gettext("Property"));
66    $self->list->InsertColumn(1, gettext("Value"));
67    print Dumper $self->properties;
68   
69    $self;
70}
71
72
73sub Refresh {
74    my ( $self ) = @_;
75
76    $self->list->Freeze;
77    $self->list->DeleteAllItems;
78    my $i=0;
79    map {
80        $self->list->InsertStringItem($i, $_->{label});
81        $self->list->SetItem($i, 1, $_->{value}->());
82        $i++;
83    }@{$self->properties};
84    $self->list->SetColumnWidth(0, wxLIST_AUTOSIZE );
85    $self->list->SetColumnWidth(1, wxLIST_AUTOSIZE );
86    $self->list->Thaw;
87}
88
89
90sub OnClose {
91    my ( $self, $event ) = @_;
92   
93    $self->Hide;
94}
95
961;
Note: See TracBrowser for help on using the repository browser.