Changeset 6520 for extensions/pLoader/trunk
- Timestamp:
- Jun 11, 2010, 9:25:24 AM (14 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader/GUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/Frame.pm
r6494 r6520 707 707 cancel_cbk => sub { wxTheApp->cancel_queues }, 708 708 column_item_data => { 709 0 => sub { my ( $image ) = @_; $image->{site_name}},710 1 => sub { my ( $image ) = @_; 1+$image->{add_rank} },709 0 => sub { return undef }, 710 1 => sub { my ( $image ) = @_; $image->{site_name} }, 711 711 2 => sub { my ( $image ) = @_; sprintf("%u", $image->{progress}) }, 712 712 3 => sub { my ( $image ) = @_; $image->{status} }, 713 4 => sub { my ( $image ) = @_; $image->{file} },714 713 }, 714 columns => [ map{ gettext $_ } qw/ 715 Photo 716 Name 717 Progress 718 Status 719 / 720 ], 715 721 } 716 722 ) -
extensions/pLoader/trunk/src/Uploader/GUI/ImageProgressDlg.pm
r6494 r6520 65 65 66 66 $self->columns( 67 ['Name', 'Rank', '%', 'Status', 'File']67 $params->{columns}, 68 68 ); 69 69 … … 121 121 my $item = $image->{add_rank}; 122 122 $self->listctrl->replace_item_data($item, $image); 123 } 124 125 126 sub auto_size_columns { 127 my ( $self ) = @_; 128 129 map{ 130 $self->listctrl->SetColumnWidth($_, -1); 131 }(0..$self->listctrl->GetColumnCount); 132 123 $self->listctrl->replace_item_wximage( 124 $item, 125 $image->{wx_thumb_file} 126 ); 133 127 } 134 128 -
extensions/pLoader/trunk/src/Uploader/GUI/ListCtrlProgress.pm
r6494 r6520 5 5 wxDefaultSize 6 6 wxGA_SMOOTH 7 wxBITMAP_TYPE_JPEG 8 wxIMAGE_LIST_SMALL 7 9 /; 8 10 … … 14 16 column_item_data 15 17 item_data 18 wx_imagelist 19 wx_images 20 thumb_size 16 21 / 17 22 ); … … 25 30 my ( $self ) = $class->SUPER::new(@_); 26 31 32 $self->thumb_size(48); 33 27 34 $self->progress_bars([]); 28 35 $self->item_data([]); 36 $self->wx_imagelist( 37 Wx::ImageList->new( 38 $self->thumb_size, $self->thumb_size, 1 39 ) 40 ); 41 42 43 $self->SetImageList( $self->wx_imagelist, wxIMAGE_LIST_SMALL ) ; 44 45 46 $self->wx_images([]); 29 47 30 48 Wx::Event::EVT_PAINT( … … 62 80 63 81 82 sub replace_item_wximage { 83 my ( $self, $item, $filename ) = @_; 84 85 unless(defined $self->wx_images->[$item]){ 86 $self->wx_images->[$item] = resize_to( 87 Wx::Bitmap->new( 88 $filename, 89 wxBITMAP_TYPE_JPEG, 90 ), 91 $self->thumb_size 92 ); 93 94 $self->wx_imagelist->Add( 95 $self->wx_images->[$item] 96 ); 97 98 } 99 100 } 101 102 103 sub resize_to { 104 my( $image, $size ) = @_; 105 106 if( $image->GetWidth != $size || $image->GetHeight != $size ) { 107 return Wx::Bitmap->new 108 ( Wx::Image->new( $image )->Rescale( $size, $size ) ); 109 } else { 110 return $image; 111 } 112 } 113 64 114 sub add_progress_items { 65 115 my ( $self, $added_items ) = @_; … … 91 141 92 142 143 sub OnGetItemColumnImage { 144 my ( $self, $item, $column ) = @_; 145 146 my $indx = -1; 147 if( 0 == $column ){ 148 $indx = $item; 149 } 150 151 $indx; 152 } 153 93 154 94 155 sub get_item_progress_rect { … … 96 157 97 158 my $rect = $self->GetItemRect($item); 98 #my $pos = $self->GetItemPosition($item); 159 99 160 # cumulate columns widths. If progress bar is column 4, 100 161 # cumulate columns widths 0, 1, 2, 3 … … 154 215 155 216 $progress_bar->Move( 156 $bar_pos 217 Wx::Point->new( 218 $bar_pos->x, 219 $bar_pos->y + $self->thumb_size/3 220 ) 157 221 ); 158 222 159 223 $progress_bar->SetSize( 160 $rect->GetSize224 [ $rect->GetWidth, $self->thumb_size/3 ] 161 225 ); 162 226 }
Note: See TracChangeset
for help on using the changeset viewer.