Changeset 3362


Ignore:
Timestamp:
May 28, 2009, 9:28:28 PM (11 years ago)
Author:
ronosman
Message:

Feature 1015 added : save current image selection and reload preview when pLoader starts.

Location:
extensions/pLoader/trunk/src/Uploader/GUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm

    r3357 r3362  
    894894    my $prev_h = $config->ReadInt( "PreviewHeight", 300 );
    895895    my $perspective = $config->Read( "Perspective" );
     896    my $imageviewer_index = $config->ReadInt( "ImageviewerIndex", 0 );
    896897   
    897898    #printf("Config x %s, y %s, w %s, h %s, prev_w %s, prev_h %s\n", $x, $y, $w, $h, $prev_w, $prev_h);
     
    915916            preview_h => $prev_h,
    916917            perspective => $perspective,
     918            imageviewer_index => $imageviewer_index,
    917919        }
    918920    );
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r3360 r3362  
    2424use Wx::DND;
    2525use Wx qw/
    26              wxAUI_DOCKART_PANE_BORDER_SIZE
    2726             wxNullBitmap
    2827             wxID_OK
     
    340339          preview_h
    341340          perspective
     341          current_imageviewer_index
    342342      /;
    343343__PACKAGE__->mk_accessors( @properties );
     
    392392        $params->{perspective}
    393393    );
     394   
     395    $self->current_imageviewer_index(
     396        $params->{imageviewer_index}||0
     397    );
    394398
    395399    $self->pwg( $params->{pwg} );
     
    452456    $self->_InitEventHandlers;
    453457    $self->_initImgTypes;   
     458
     459
     460    $self->imageviewer->SelectItem(
     461        $self->current_imageviewer_index
     462    ) if $self->imageviewer->GetItemCount;
    454463   
    455464    $self;
     
    734743    $self->init_panels;
    735744
    736     #if(!$self->imagelist->wx_thumb_imglist->GetImageCount){
    737     #    $self->imageviewer->Show(0);
    738     #}
    739 
    740     #    my $imglistpage = [
    741     #        [
    742     #            $self->imageviewer,
    743     #            gettext("Photo selection"),
    744     #            '../res/images.png',
    745     #            wxBITMAP_TYPE_PNG,
    746     #        ],
    747     #    ];
    748    
    749 
    750 
    751745    $self->init_aui;
    752746    $self->init_dnd_targets;
    753     #$self->_populate_notebook($self->notebook, $imglistpage, 1);
    754747
    755748    if( $self->imagelist->wx_thumb_imglist->GetImageCount){
     
    760753            $self->imagelist->wx_thumb_imglist
    761754        );
     755       
    762756    }
    763757
     
    980974        ->ToolbarPane->Top->Row( 1 )->LeftDockable( 0 )->RightDockable( 0 ) ) if defined $self->toolbar;
    981975
    982     if( $self->perspective){
     976    if($self->perspective){
    983977        $self->manager->LoadPerspective($self->perspective) if $self->perspective =~ /getting_started/;
    984978    }
     
    15041498sub OnImageViewerItemActivated {
    15051499    my( $self, $event ) = @_;
     1500   
     1501    $self->current_imageviewer_index(
     1502        $event->GetIndex
     1503    );
    15061504
    15071505    $self->OnPhotoProperties;
     
    15141512    my $indx = $event->GetIndex;
    15151513
     1514    $self->_on_imageviewer_item_selected($indx);
    15161515    # retrieve photo info for the last selected photo
    1517     $self->imagelist->SetCurrentImage($indx);
     1516    $event->Skip;
     1517}
     1518
     1519sub _on_imageviewer_item_selected {
     1520    my ( $self, $index ) = @_; 
     1521
     1522    $self->current_imageviewer_index($index);
     1523    $self->imagelist->SetCurrentImage($index);
    15181524   
    15191525    $self->imagelist->image_selection(
     
    15271533    $self->image_preview->Refresh;
    15281534
    1529     my $bmp =         Wx::Bitmap->new(
     1535    my $bmp = Wx::Bitmap->new(
    15301536            $self->imagelist->current_image->preview_file,
    15311537            $self->GetWxBitmapType($self->imagelist->type),
     
    17851791    ( $params->{'PreviewWidth'}, $params->{'PreviewHeight'} ) = $self->image_preview->GetSizeWH ;
    17861792    $params->{Perspective} = $self->manager->SavePerspective;
     1793    $params->{ImageviewerIndex} = $self->current_imageviewer_index;
    17871794   
    17881795
  • extensions/pLoader/trunk/src/Uploader/GUI/wxImageListCtrl.pm

    r3359 r3362  
    3939             wxLIST_NEXT_ALL
    4040             wxLIST_STATE_SELECTED
    41              wxLIST_STATE_DONTCARE
     41             wxLIST_STATE_DONTCARE
     42             wxLIST_STATE_FOCUSED
    4243         /;
    4344use Wx::Event qw/
     
    154155}
    155156
     157sub SelectItem {
     158    my ( $self, $index ) = @_;
    156159
     160    $self->SetItemState(
     161        $index,
     162        wxLIST_STATE_SELECTED,
     163        wxLIST_STATE_SELECTED
     164    ); 
     165}
    157166
    1581671;
Note: See TracChangeset for help on using the changeset viewer.