Ignore:
Timestamp:
Jan 30, 2010, 5:13:16 AM (14 years ago)
Author:
ronosman
Message:

Photo properties layout management. Use adaptive sizes with stretch factors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/res/photo_properties_with_categories_tags_wdr.pl

    r4793 r4800  
    1 #-----------------------------------------------------------------------------
    2 # Perl source generated by wxDesigner from file: photo_properties_with_categories_tags.wdr
    3 # Do not modify this file, all changes will be lost!
    4 #-----------------------------------------------------------------------------
    5 
    61use Wx;
    72use Wx::Calendar;
    83use Wx::DateTime;
    9 use Wx::Grid;
    104use strict;
    115
     
    159use Wx qw( wxDefaultSize wxDefaultPosition wxNullAnimation wxNullFont wxBLACK );
    1610use Wx qw( wxID_OK wxID_APPLY wxID_SAVE wxID_SAVEAS wxID_CANCEL wxID_YES wxID_NO wxID_EXIT wxID_ABOUT wxID_HELP );
    17 use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW );
     11use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW wxEXPAND);
    1812use Wx qw( wxALIGN_RIGHT wxALIGN_BOTTOM wxALIGN_CENTER wxALIGN_CENTER_VERTICAL wxALIGN_CENTER_HORIZONTAL );
    1913use Wx qw( wxTR_HAS_BUTTONS wxTR_LINES_AT_ROOT wxSUNKEN_BORDER wxLI_HORIZONTAL wxTE_MULTILINE );
     
    3226
    3327sub PhotoPropertiesCategoriesTags {
    34     my( $parent ) = $_[0];
    35     my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
     28    my( $parent ) = @_;
     29    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
    3630   
    3731    my( $item2 ) = Wx::Notebook->new( $parent, $main::PHOTO_PROPERTIES_NB, wxDefaultPosition, [400,160], 0 );
     
    4135    }
    4236   
    43     $item0->Add( $item1, 2, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     37    # the notebook has adaptive size : stretch factor 2, wxEXPAND
     38    $topsizer->Add( $item1, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    4439
    4540    my( $item3 ) = Wx::TreeCtrl->new( $parent, $main::PHOTO_PROPERTIES_CATEGORIES, wxDefaultPosition, [120,160], wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxSUNKEN_BORDER );
    46     $item0->AddWindow( $item3, 1, wxGROW|wxALL, 5 );
     41    # the notebook has adaptive size : stretch factor 1, wxEXPAND
     42    $topsizer->AddWindow( $item3, 1, wxGROW|wxALL, 5 );
    4743
    4844    my( $item4 ) = Wx::StaticLine->new( $parent, $main::ID_LINE, wxDefaultPosition, [20,-1], wxLI_HORIZONTAL );
    49     $item0->AddWindow( $item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     45    $topsizer->AddWindow( $item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    5046
    5147    my( $item5 ) = Wx::Button->new( $parent, $main::PHOTO_PROPERTIES_UPLOAD, "", wxDefaultPosition, [-1,40], 0 );
    52     $item0->AddWindow( $item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     48    $topsizer->AddWindow( $item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    5349
    54     my( $set_size ) = @_ >= 3 ? $_[2] : 1;
    55     my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
    56     if( $set_size == 1 ) {
    57          $_[0]->SetSizer( $item0 );
    58          
    59          if( $call_fit == 1 ) {
    60              $item0->SetSizeHints( $_[0] );
    61          }
    62     }
    63    
    64     $item0;
     50    $parent->SetSizer( $topsizer );
     51    $topsizer->SetSizeHints( $parent );
     52
     53    $topsizer;
    6554}
    6655
     
    6958
    7059sub photo_properties_tags {
    71     my( $parent ) = $_[0];
    72     my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
     60    my( $parent, $tags ) = @_;
     61    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
    7362   
    7463    my( $item1 ) = Wx::StaticText->new( $parent, $main::TAGS, "text", wxDefaultPosition, wxDefaultSize, 0 );
    75     $item0->AddWindow( $item1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
     64    $topsizer->AddWindow( $item1, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
    7665
    77     my $tags = $_[1];
    78 $tags->{parentwnd}=$parent;
    79 my( $item2 ) = Uploader::GUI::wxChoiceFilteredPanel->new($tags);
    80     $item0->AddWindow( $item2, 0, wxALIGN_CENTER_VERTICAL, 5 );
     66    $tags->{parentwnd}=$parent;
     67    my( $panel ) = Uploader::GUI::wxChoiceFilteredPanel->new($tags);
     68    # the panel has adaptive size : stretch factor 1, wxEXPAND
     69    $topsizer->AddWindow( $panel, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    8170
    82     my( $set_size ) = @_ >= 3 ? $_[2] : 1;
    83     my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
    84     if( $set_size == 1 ) {
    85          $_[0]->SetSizer( $item0 );
    86          
    87          if( $call_fit == 1 ) {
    88              $item0->SetSizeHints( $_[0] );
    89          }
    90     }
     71    $parent->SetSizer( $topsizer );
     72    $topsizer->SetSizeHints( $parent );
    9173   
    92     $item0;
     74    $topsizer;
    9375}
    9476
     
    10587
    10688sub photo_properties_caption_comments {
    107     my( $parent ) = $_[0];
    108     my( $item0 ) = Wx::BoxSizer->new( wxVERTICAL );
     89    my( $parent ) = @_;
     90    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
    10991   
    11092    my( $item1 ) = Wx::BoxSizer->new( wxVERTICAL );
     
    11395    $item1->AddWindow( $item2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    11496
    115     my( $item3 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CAPTION, "", wxDefaultPosition, [300,-1], 0 );
    116     $item1->AddWindow( $item3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     97    my( $item3 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_CAPTION, "", wxDefaultPosition, [-1,-1], 0 );
     98    $item1->AddWindow( $item3, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    11799
    118     $item0->Add( $item1, 0, 0, 5 );
     100    $topsizer->Add( $item1, 0, wxEXPAND, 5 );
    119101
    120102    my( $item4 ) = Wx::BoxSizer->new( wxVERTICAL );
     
    123105    $item4->AddWindow( $item5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    124106
    125     my( $item6 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_AUTHOR, "", wxDefaultPosition, [300,-1], 0 );
    126     $item4->AddWindow( $item6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     107    my( $item6 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_AUTHOR, "", wxDefaultPosition, [-1,-1], 0 );
     108    $item4->AddWindow( $item6, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    127109
    128110    my( $item7 ) = Wx::StaticText->new( $parent, $main::COMMENT, "text", wxDefaultPosition, wxDefaultSize, 0 );
    129111    $item4->AddWindow( $item7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    130112
    131     my( $item8 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_COMMENT, "", wxDefaultPosition, [300,50], wxTE_MULTILINE );
    132     $item4->AddWindow( $item8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     113    # adaptive size : stretch factor 1
     114    # the textctrl has a variable line number
     115    my( $item8 ) = Wx::TextCtrl->new( $parent, $main::PHOTO_PROPERTIES_COMMENT, "", wxDefaultPosition, [-1,-1], wxTE_MULTILINE );
     116    $item4->AddWindow( $item8, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    133117
    134118    my( $item9 ) = Wx::StaticText->new( $parent, $main::CREATE_DATE, "text", wxDefaultPosition, wxDefaultSize, 0 );
     
    137121    my( $item10 ) = Wx::DatePickerCtrl->new( $parent, $main::PHOTO_PROPERTIES_CREATE_DATE, Wx::DateTime->new(), wxDefaultPosition, [200,-1], wxDP_DROPDOWN );
    138122    $item4->AddWindow( $item10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    139 
    140     $item0->Add( $item4, 0, 0, 0 );
     123    # adaptive size : stretch factor 3
     124    $topsizer->Add( $item4, 3, wxEXPAND, 5 );
    141125
    142126    my( $item11 ) = Wx::BoxSizer->new( wxVERTICAL );
     
    145129    $item11->AddWindow( $item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    146130
    147     my( $item13 ) = Wx::Choice->new( $parent, $main::PHOTO_PROPERTIES_PRIVACY_LEVEL, wxDefaultPosition, [300,-1], [], 0 );
    148     $item11->AddWindow( $item13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
     131    my( $item13 ) = Wx::Choice->new( $parent, $main::PHOTO_PROPERTIES_PRIVACY_LEVEL, wxDefaultPosition, [-1,-1], [], 0 );
     132    $item11->AddWindow( $item13, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
    149133
    150     $item0->Add( $item11, 1, Wx::wxALIGN_TOP, 5 );
     134    # adaptive size : stretch factor 1
     135    $topsizer->Add( $item11, 1, wxEXPAND, 5 );
    151136
    152     my( $set_size ) = @_ >= 3 ? $_[2] : 1;
    153     my( $call_fit ) = @_ >= 2 ? $_[1] : 1;
    154     if( $set_size == 1 ) {
    155          $_[0]->SetSizer( $item0 );
    156          
    157          if( $call_fit == 1 ) {
    158              $item0->SetSizeHints( $_[0] );
    159          }
    160     }
     137    $parent->SetSizer( $topsizer );
     138    $topsizer->SetSizeHints( $parent );
    161139   
    162     $item0;
     140    $topsizer;
    163141}
    164 
    165 # Menu bar functions
    166 
    167 
    168 # Toolbar functions
    169142
    170143use Wx qw( wxITEM_NORMAL wxITEM_RADIO wxITEM_CHECK );
    171144
    172 
    173 # End of generated file
Note: See TracChangeset for help on using the changeset viewer.