Index: /extensions/pLoader/trunk/res/photo_properties_with_categories_tags_wdr.pl
===================================================================
--- /extensions/pLoader/trunk/res/photo_properties_with_categories_tags_wdr.pl	(revision 4799)
+++ /extensions/pLoader/trunk/res/photo_properties_with_categories_tags_wdr.pl	(revision 4800)
@@ -1,11 +1,5 @@
-#-----------------------------------------------------------------------------
-# Perl source generated by wxDesigner from file: photo_properties_with_categories_tags.wdr
-# Do not modify this file, all changes will be lost!
-#-----------------------------------------------------------------------------
-
 use Wx;
 use Wx::Calendar;
 use Wx::DateTime;
-use Wx::Grid;
 use strict;
 
@@ -15,5 +9,5 @@
 use Wx qw( wxDefaultSize wxDefaultPosition wxNullAnimation wxNullFont wxBLACK );
 use Wx qw( wxID_OK wxID_APPLY wxID_SAVE wxID_SAVEAS wxID_CANCEL wxID_YES wxID_NO wxID_EXIT wxID_ABOUT wxID_HELP );
-use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW );
+use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW wxEXPAND);
 use Wx qw( wxALIGN_RIGHT wxALIGN_BOTTOM wxALIGN_CENTER wxALIGN_CENTER_VERTICAL wxALIGN_CENTER_HORIZONTAL );
 use Wx qw( wxTR_HAS_BUTTONS wxTR_LINES_AT_ROOT wxSUNKEN_BORDER wxLI_HORIZONTAL wxTE_MULTILINE );
@@ -32,6 +26,6 @@
 
 sub PhotoPropertiesCategoriesTags {
-    my( $parent ) = $_[0];
-    my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
+    my( $parent ) = @_;
+    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
     
     my( $item2 ) = Wx::Notebook->new( $parent, $main::PHOTO_PROPERTIES_NB, wxDefaultPosition, [400,160], 0 );
@@ -41,26 +35,21 @@
     }
     
-    $item0->Add( $item1, 2, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    # the notebook has adaptive size : stretch factor 2, wxEXPAND
+    $topsizer->Add( $item1, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
     my( $item3 ) = Wx::TreeCtrl->new( $parent, $main::PHOTO_PROPERTIES_CATEGORIES, wxDefaultPosition, [120,160], wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxSUNKEN_BORDER );
-    $item0->AddWindow( $item3, 1, wxGROW|wxALL, 5 );
+    # the notebook has adaptive size : stretch factor 1, wxEXPAND
+    $topsizer->AddWindow( $item3, 1, wxGROW|wxALL, 5 );
 
     my( $item4 ) = Wx::StaticLine->new( $parent, $main::ID_LINE, wxDefaultPosition, [20,-1], wxLI_HORIZONTAL );
-    $item0->AddWindow( $item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    $topsizer->AddWindow( $item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
     my( $item5 ) = Wx::Button->new( $parent, $main::PHOTO_PROPERTIES_UPLOAD, "", wxDefaultPosition, [-1,40], 0 );
-    $item0->AddWindow( $item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    $topsizer->AddWindow( $item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $set_size ) = @_ >= 3 ? $_[2] : 1;
-    my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
-    if( $set_size == 1 ) {
-         $_[0]->SetSizer( $item0 );
-         
-         if( $call_fit == 1 ) {
-             $item0->SetSizeHints( $_[0] );
-         }
-    }
-    
-    $item0;
+    $parent->SetSizer( $topsizer );
+    $topsizer->SetSizeHints( $parent );
+
+    $topsizer;
 }
 
@@ -69,26 +58,19 @@
 
 sub photo_properties_tags {
-    my( $parent ) = $_[0];
-    my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
+    my( $parent, $tags ) = @_;
+    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
     
     my( $item1 ) = Wx::StaticText->new( $parent, $main::TAGS, "text", wxDefaultPosition, wxDefaultSize, 0 );
-    $item0->AddWindow( $item1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
+    $topsizer->AddWindow( $item1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
 
-    my $tags = $_[1];
-$tags->{parentwnd}=$parent;
-my( $item2 ) = Uploader::GUI::wxChoiceFilteredPanel->new($tags);
-    $item0->AddWindow( $item2, 0, wxALIGN_CENTER_VERTICAL, 5 );
+    $tags->{parentwnd}=$parent;
+    my( $panel ) = Uploader::GUI::wxChoiceFilteredPanel->new($tags);
+    # the panel has adaptive size : stretch factor 1, wxEXPAND
+    $topsizer->AddWindow( $panel, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $set_size ) = @_ >= 3 ? $_[2] : 1;
-    my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
-    if( $set_size == 1 ) {
-         $_[0]->SetSizer( $item0 );
-         
-         if( $call_fit == 1 ) {
-             $item0->SetSizeHints( $_[0] );
-         }
-    }
+    $parent->SetSizer( $topsizer );
+    $topsizer->SetSizeHints( $parent );
     
-    $item0;
+    $topsizer;
 }
 
@@ -105,6 +87,6 @@
 
 sub photo_properties_caption_comments {
-    my( $parent ) = $_[0];
-    my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
+    my( $parent ) = @_;
+    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
     
     my( $item1 ) = Wx::BoxSizer->new( wxVERTICAL );
@@ -113,8 +95,8 @@
     $item1->AddWindow( $item2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $item3 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CAPTION, "", wxDefaultPosition, [300,-1], 0 );
-    $item1->AddWindow( $item3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    my( $item3 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CAPTION, "", wxDefaultPosition, [-1,-1], 0 );
+    $item1->AddWindow( $item3, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    $item0->Add( $item1, 0, 0, 5 );
+    $topsizer->Add( $item1, 0, wxEXPAND, 5 );
 
     my( $item4 ) = Wx::BoxSizer->new( wxVERTICAL );
@@ -123,12 +105,14 @@
     $item4->AddWindow( $item5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $item6 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_AUTHOR, "", wxDefaultPosition, [300,-1], 0 );
-    $item4->AddWindow( $item6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    my( $item6 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_AUTHOR, "", wxDefaultPosition, [-1,-1], 0 );
+    $item4->AddWindow( $item6, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
     my( $item7 ) = Wx::StaticText->new( $parent, $main::COMMENT, "text", wxDefaultPosition, wxDefaultSize, 0 );
     $item4->AddWindow( $item7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $item8 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_COMMENT, "", wxDefaultPosition, [300,50], wxTE_MULTILINE );
-    $item4->AddWindow( $item8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    # adaptive size : stretch factor 1
+    # the textctrl has a variable line number
+    my( $item8 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_COMMENT, "", wxDefaultPosition, [-1,-1], wxTE_MULTILINE );
+    $item4->AddWindow( $item8, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
     my( $item9 ) = Wx::StaticText->new( $parent, $main::CREATE_DATE, "text", wxDefaultPosition, wxDefaultSize, 0 );
@@ -137,6 +121,6 @@
     my( $item10 ) = Wx::DatePickerCtrl->new( $parent, $main::PHOTO_PROPERTIES_CREATE_DATE, Wx::DateTime->new(), wxDefaultPosition, [200,-1], wxDP_DROPDOWN );
     $item4->AddWindow( $item10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
-
-    $item0->Add( $item4, 0, 0, 0 );
+    # adaptive size : stretch factor 3
+    $topsizer->Add( $item4, 3, wxEXPAND, 5 );
 
     my( $item11 ) = Wx::BoxSizer->new( wxVERTICAL );
@@ -145,29 +129,16 @@
     $item11->AddWindow( $item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    my( $item13 ) = Wx::Choice->new( $parent, $main::PHOTO_PROPERTIES_PRIVACY_LEVEL, wxDefaultPosition, [300,-1], [], 0 );
-    $item11->AddWindow( $item13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+    my( $item13 ) = Wx::Choice->new( $parent, $main::PHOTO_PROPERTIES_PRIVACY_LEVEL, wxDefaultPosition, [-1,-1], [], 0 );
+    $item11->AddWindow( $item13, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
 
-    $item0->Add( $item11, 1, Wx::wxALIGN_TOP, 5 );
+    # adaptive size : stretch factor 1
+    $topsizer->Add( $item11, 1, wxEXPAND, 5 );
 
-    my( $set_size ) = @_ >= 3 ? $_[2] : 1;
-    my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
-    if( $set_size == 1 ) {
-         $_[0]->SetSizer( $item0 );
-         
-         if( $call_fit == 1 ) {
-             $item0->SetSizeHints( $_[0] );
-         }
-    }
+    $parent->SetSizer( $topsizer );
+    $topsizer->SetSizeHints( $parent );
     
-    $item0;
+    $topsizer;
 }
-
-# Menu bar functions
-
-
-# Toolbar functions
 
 use Wx qw( wxITEM_NORMAL wxITEM_RADIO wxITEM_CHECK );
 
-
-# End of generated file
Index: /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm
===================================================================
--- /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 4799)
+++ /extensions/pLoader/trunk/src/Uploader/GUI/wxChoiceFilteredPanel.pm	(revision 4800)
@@ -30,4 +30,6 @@
              wxTE_PROCESS_ENTER
              wxRA_SPECIFY_ROWS
+             wxGROW
+             wxEXPAND
          /;
 
@@ -52,12 +54,9 @@
         search_result
         previous_autocompleted
-		autocomplete_from
-		autocomplete_to
-		autocomplete_set_selection
+        autocomplete_from
+        autocomplete_to
+        autocomplete_set_selection
       /
 );
-
-use Wx::Event qw(EVT_CHECKLISTBOX EVT_LISTBOX EVT_SEARCHCTRL_SEARCH_BTN EVT_SEARCHCTRL_CANCEL_BTN
-                 EVT_TEXT EVT_TEXT_ENTER EVT_IDLE EVT_RADIOBOX);
 
 
@@ -74,24 +73,24 @@
     $self->Refresh;
 
-    EVT_CHECKLISTBOX( $self, $self->listchoices, \&OnCheck );
-    EVT_LISTBOX( $self, $self->listchoices, \&OnSelected );
-    EVT_SEARCHCTRL_SEARCH_BTN( $self, $self->search, \&OnSearch );
-    EVT_SEARCHCTRL_CANCEL_BTN( $self, $self->search, \&OnCancel );
-    EVT_TEXT( $self, $self->search, \&OnSearch );
-    EVT_TEXT_ENTER( $self, $self->search, \&OnSearchEnter );
-    EVT_RADIOBOX( $self, $self->btn_show, \&OnShow );
-	# fix for linux : can not call SetSelection before the current event is processed.
-	# call when idle
-	EVT_IDLE(
-	    $self,
-		sub {
-		    my ($self, $event)=@_;
-			$self->search->SetSelection(
-			    $self->autocomplete_from,
-			    $self->autocomplete_to
-			) if $self->autocomplete_set_selection;
-			$self->autocomplete_set_selection(0);
-		}
-	);
+    Wx::Event::EVT_CHECKLISTBOX( $self, $self->listchoices, \&OnCheck );
+    Wx::Event::EVT_LISTBOX( $self, $self->listchoices, \&OnSelected );
+    Wx::Event::EVT_SEARCHCTRL_SEARCH_BTN( $self, $self->search, \&OnSearch );
+    Wx::Event::EVT_SEARCHCTRL_CANCEL_BTN( $self, $self->search, \&OnCancel );
+    Wx::Event::EVT_TEXT( $self, $self->search, \&OnSearch );
+    Wx::Event::EVT_TEXT_ENTER( $self, $self->search, \&OnSearchEnter );
+    Wx::Event::EVT_RADIOBOX( $self, $self->btn_show, \&OnShow );
+    # fix for linux : can not call SetSelection before the current event is processed.
+    # call when idle
+    Wx::Event::EVT_IDLE(
+        $self,
+        sub {
+            my ($self, $event)=@_;
+            $self->search->SetSelection(
+                $self->autocomplete_from,
+                $self->autocomplete_to
+            ) if $self->autocomplete_set_selection;
+            $self->autocomplete_set_selection(0);
+        }
+    );
 
     $self;
@@ -99,6 +98,6 @@
 
 sub _init_properties {
-    my ( $self, $params ) = @_;	
-	
+    my ( $self, $params ) = @_;    
+    
     $self->choices(
         $params->{choices}|| sub { [] }
@@ -132,31 +131,31 @@
 
 sub _init_panel {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     my( $vsizer ) = Wx::BoxSizer->new( wxVERTICAL );
     
     $self->search(
-        Wx::SearchCtrl->new( $self, -1, "", wxDefaultPosition, [320,-1],wxTE_PROCESS_ENTER )
+        Wx::SearchCtrl->new( $self, -1, "", wxDefaultPosition, [-1,-1],wxTE_PROCESS_ENTER )
     );
 
     $self->search->ShowCancelButton( 1 );
 
-    $vsizer->AddWindow( $self->search, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 );
+    $vsizer->AddWindow( $self->search, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 2 );
 
     $self->btn_show(
-        Wx::RadioBox->new( $self, -1, sprintf("%s :", gettext("Show")), wxDefaultPosition, [320, -1], 
+        Wx::RadioBox->new( $self, -1, sprintf("%s :", gettext("Show")), wxDefaultPosition, [-1, -1], 
             [gettext("All"),gettext("Selected"),gettext("Not selected")] , 1, wxRA_SPECIFY_ROWS )
     );
-    $vsizer->AddWindow( $self->btn_show, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 );
+    $vsizer->AddWindow( $self->btn_show, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 2 );
 
 
     $self->listchoices(
-        Wx::CheckListBox->new( $self, -1, wxDefaultPosition, [320,200], [], 0 )
-    );
-    $vsizer->AddWindow( $self->listchoices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 );
+        Wx::CheckListBox->new( $self, -1, wxDefaultPosition, [-1,-1], [], 0 )
+    );
+    $vsizer->AddWindow( $self->listchoices, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 2 );
 
     $self->SetSizer( $vsizer );
+    $vsizer->SetSizeHints( $self );
          
-    $vsizer->SetSizeHints( $self );
 }
 
@@ -164,5 +163,5 @@
     my ( $self, $choices ) = @_;
 
-	$self->listchoices->Freeze;
+    $self->listchoices->Freeze;
     $self->listchoices->Clear;
     $self->id_lookup({});
@@ -174,13 +173,13 @@
     #print Dumper $self->properties;
     map {
-    	$self->listchoices->Append(
-    	    $_->{name},
-    	);
+        $self->listchoices->Append(
+            $_->{name},
+        );
         $self->id_lookup->{$row} = $_->{id};
         $self->row_lookup->{$_->{id}} = $row;
         $self->id_from_name->{$_->{name}} = $_->{id};
-    	$row++;	
+        $row++;    
     }@{$choices};
-	$self->listchoices->Thaw;
+    $self->listchoices->Thaw;
 
 }
@@ -198,5 +197,5 @@
     $self->_init_choices($choices);
     $self->SetSelection($selected);
-	
+    
 }
 
@@ -209,6 +208,6 @@
     $self->listchoices->Freeze;
     map {
-        $self->listchoices->Check($row, 0) ;	
-    	$row++;
+        $self->listchoices->Check($row, 0) ;    
+        $row++;
     }@$choices;
     $self->listchoices->Thaw;
@@ -224,11 +223,11 @@
     $self->listchoices->Freeze;
     map {
-    	$self->listchoices->Check(
-    	    $self->row_lookup->{$_},
-    	    exists $self->row_lookup->{$_},
-    	) if defined $self->row_lookup->{$_};
-    	$self->is_selected->{$_} = 1;	
-    }
-    @{$selection};	
+        $self->listchoices->Check(
+            $self->row_lookup->{$_},
+            exists $self->row_lookup->{$_},
+        ) if defined $self->row_lookup->{$_};
+        $self->is_selected->{$_} = 1;    
+    }
+    @{$selection};    
     $self->listchoices->Thaw;
 }
@@ -244,11 +243,11 @@
            
         my $id = $self->id_lookup->{$row};
-        $self->is_selected->{$id} = $self->listchoices->IsChecked($row) ;	
-    	$row++;
+        $self->is_selected->{$id} = $self->listchoices->IsChecked($row) ;    
+        $row++;
     }@$choices;
 
     [
         grep { $self->is_selected->{$_} } keys %{$self->is_selected}
-    ];	
+    ];    
 }
 
@@ -258,5 +257,5 @@
     $self->selection->(
         $self->GetSelection
-    );	
+    );    
 }
 
@@ -321,5 +320,5 @@
 
 sub _refresh_selected_searched {
-    my ( $self, $searched ) = @_;    	
+    my ( $self, $searched ) = @_;        
 
     $self->Refresh;
@@ -348,22 +347,22 @@
     # autocompletion
     if(1== scalar @{$self->search_result}){
-    	my $value = $self->search_result->[0]->{name};
-    	unless(  $value eq $self->previous_autocompleted ){
-    	    $self->autocomplete_from(
-			    $self->search->GetLastPosition
-		    );
-    	    $self->search->ChangeValue($value);
-    	    $self->autocomplete_to(
-			    $self->search->GetLastPosition
-		    );
-    	    $self->autocomplete_set_selection(1);
-    	    $self->previous_autocompleted($value);
-    	}	
+        my $value = $self->search_result->[0]->{name};
+        unless(  $value eq $self->previous_autocompleted ){
+            $self->autocomplete_from(
+                $self->search->GetLastPosition
+            );
+            $self->search->ChangeValue($value);
+            $self->autocomplete_to(
+                $self->search->GetLastPosition
+            );
+            $self->autocomplete_set_selection(1);
+            $self->previous_autocompleted($value);
+        }    
     }
     else{
-    	$self->previous_autocompleted(undef);
-    }
-	
-	$event->Skip;
+        $self->previous_autocompleted(undef);
+    }
+    
+    $event->Skip;
 }
 
@@ -389,5 +388,5 @@
 
 sub _show_notselected {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     $self->Refresh(
@@ -397,5 +396,5 @@
 
 sub _show_selected {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     $self->Refresh(
@@ -405,5 +404,5 @@
 
 sub _show_all {
-    my ( $self ) = @_;	
+    my ( $self ) = @_;    
 
     $self->Refresh(
@@ -418,5 +417,5 @@
     [
         grep { $self->is_selected->{$_->{id}} } @$choices
-    ]	
+    ]    
 }
 
@@ -427,5 +426,5 @@
     [
         grep { !$self->is_selected->{$_->{id}} } @$choices
-    ]	
+    ]    
 }
 
