source: extensions/pLoader/trunk/src/Uploader/GUI/Layout/ImageProgress.pm @ 6538

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

Ability to clear progress list. Only available when no batch is running. The cancel processing is available when a batch is running.

File size: 2.3 KB
Line 
1package Uploader::GUI::Layout::ImageProgress;
2use Wx;
3use Uploader::GUI::ListCtrlProgress;
4use strict;
5
6use Wx qw( wxDefaultSize wxDefaultPosition wxNullAnimation wxNullFont wxBLACK );
7use Wx qw( wxID_OK wxID_APPLY wxID_SAVE wxID_SAVEAS wxID_CANCEL wxID_YES wxID_NO wxID_EXIT wxID_ABOUT wxID_HELP );
8use Wx qw( wxVERTICAL wxHORIZONTAL wxALL wxLEFT wxRIGHT wxTOP wxBOTTOM wxCENTRE wxGROW );
9use Wx qw( wxALIGN_RIGHT wxALIGN_BOTTOM wxALIGN_CENTER wxALIGN_CENTER_VERTICAL wxALIGN_CENTER_HORIZONTAL wxALIGN_LEFT);
10use Wx qw( wxLI_HORIZONTAL wxLC_REPORT wxSUNKEN_BORDER wxLC_VIRTUAL);
11use Wx::Locale qw/:default/;
12
13
14use vars qw($ID_TEXT); $ID_TEXT = 10000;
15use vars qw($ID_BUTTON); $ID_BUTTON = 10001;
16use vars qw($ID_LINE); $ID_LINE = 10002;
17use vars qw($ID_LISTCTRL); $ID_LISTCTRL = 10003;
18
19sub Init {
20    my( $parent_wnd ) = @_;
21
22    my $panel = Wx::Panel->new($parent_wnd, -1, wxDefaultPosition, wxDefaultSize);
23   
24    my( $topsizer ) = Wx::BoxSizer->new( wxVERTICAL );
25   
26
27    $parent_wnd->listctrl(
28        Uploader::GUI::ListCtrlProgress->new( 
29            $panel, 
30            $main::ID_LISTCTRL, 
31            wxDefaultPosition, [600, 400],
32            wxLC_REPORT|wxLC_VIRTUAL
33        )
34    );
35
36    $topsizer->AddWindow( $parent_wnd->listctrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
37
38
39    my( $item6 ) = Wx::StaticLine->new( $panel, $main::ID_LINE, wxDefaultPosition, [20,-1], wxLI_HORIZONTAL );
40    $topsizer->AddWindow( $item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
41
42    my( $item7 ) = Wx::BoxSizer->new( wxHORIZONTAL );
43    my( $bt_clear ) = Wx::Button->new(
44        $panel,
45        -1,
46        gettext("Clear list"),
47        wxDefaultPosition, wxDefaultSize, 0 
48    );
49    $parent_wnd->{_bt_clear} = $bt_clear;
50
51    $item7->AddWindow( $bt_clear, 0, wxALIGN_CENTER|wxALL, 5 );
52
53    my( $bt_cancel ) = Wx::Button->new(
54        $panel,
55        -1,
56        gettext("Cancel upload"),
57        wxDefaultPosition, wxDefaultSize, 0 
58    );
59    $parent_wnd->{_bt_cancel} = $bt_cancel;
60    #$item7->AddButton( Wx::Button->new( $panel, wxID_OK, "" ) );
61    $item7->AddWindow( $bt_cancel, 0, wxALIGN_CENTER|wxALL, 5 );
62    $topsizer->Add( $item7, 0, wxGROW|wxALL, 5 );
63
64    $panel->SetSizer( $topsizer );
65    $topsizer->SetSizeHints( $parent_wnd );
66   
67    $topsizer;
68}
69
701;
Note: See TracBrowser for help on using the repository browser.