~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/UI/FileManager/ProgressDialog2_rc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ProgressDialog2_rc.cpp
 
2
 
 
3
#include "StdAfx.h"
 
4
 
 
5
// For compilers that support precompilation, includes "wx/wx.h".
 
6
#include "wx/wxprec.h"
 
7
 
 
8
#ifdef __BORLANDC__
 
9
    #pragma hdrstop
 
10
#endif
 
11
 
 
12
// for all others, include the necessary headers (this file is usually all you
 
13
// need because it includes almost all "standard" wxWidgets headers)
 
14
#ifndef WX_PRECOMP
 
15
    #include "wx/wx.h"
 
16
#endif
 
17
 
 
18
#include "ProgressDialog2Res.h"
 
19
 
 
20
#include "Windows/Control/DialogImpl.h"
 
21
 
 
22
/*
 
23
IDD_DIALOG_PROGRESS  DIALOG  0, 0, xSize, ySize  MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX 
 
24
CAPTION "Progress"
 
25
MY_FONT
 
26
BEGIN
 
27
  PUSHBUTTON  "&Background", IDC_BUTTON_PROGRESS_PRIORITY,  bXPos3, bYPos, bXSize, bYSize
 
28
  PUSHBUTTON  "&Pause",      IDC_BUTTON_PAUSE,              bXPos2, bYPos, bXSize, bYSize
 
29
  PUSHBUTTON  "Cancel",      IDCANCEL,                      bXPos1, bYPos, bXSize, bYSize
 
30
  LTEXT  "Elapsed time:",   IDC_PROGRESS_ELAPSED,   marg, y0, x0Size, 8
 
31
  LTEXT  "Remaining time:", IDC_PROGRESS_REMAINING, marg, y1, x0Size, 8
 
32
  LTEXT  "Files:",          IDC_PROGRESS_FILES,     marg, y2, x0Size, 8
 
33
  LTEXT  "Compression ratio:",IDC_PROGRESS_RATIO,   marg, y3, x0Size, 8
 
34
 
 
35
  LTEXT  "Total size:",      IDC_PROGRESS_TOTAL,    x2, y0, x2Size, 8
 
36
  LTEXT  "Speed:",           IDC_PROGRESS_SPEED,    x2, y1, x2Size, 8
 
37
  LTEXT  "Processed:",       IDC_PROGRESS_UNPACKED, x2, y2, x2Size, 8
 
38
  LTEXT  "Compressed size:", IDC_PROGRESS_PACKED,   x2, y3, x2Size, 8
 
39
 
 
40
  RTEXT  "00:00:00",  IDC_PROGRESS_ELAPSED_VALUE,     x1, y0, x1Size, 8
 
41
  RTEXT  "",          IDC_PROGRESS_REMAINING_VALUE,   x1, y1, x1Size, 8
 
42
  RTEXT  "",          IDC_PROGRESS_FILES_VALUE,       x1, y2, x1Size, 8
 
43
  RTEXT  "",          IDC_PROGRESS_RATIO_VALUE,       x1, y3, x1Size, 8
 
44
 
 
45
  RTEXT  "",          IDC_PROGRESS_TOTAL_VALUE,       x3, y0, x3Size, 8
 
46
  RTEXT  "",          IDC_PROGRESS_SPEED_VALUE,       x3, y1, x3Size, 8
 
47
  RTEXT  "",          IDC_PROGRESS_UNPACKED_VALUE,    x3, y2, x3Size, 8
 
48
  RTEXT  "",          IDC_PROGRESS_PACKED_VALUE,      x3, y3, x3Size, 8
 
49
 
 
50
  LTEXT  "", IDC_PROGRESS_FILE_NAME, marg, bYPos - 30, xSize2, 8, SS_NOPREFIX
 
51
  CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, marg, bYPos - 20, xSize2, 13
 
52
END
 
53
 
 
54
 
 
55
STRINGTABLE DISCARDABLE 
 
56
BEGIN
 
57
  IDS_PROGRESS_PAUSED     "Paused"
 
58
  IDS_PROGRESS_FOREGROUND "&Foreground"
 
59
  IDS_PROGRESS_CONTINUE   "&Continue"
 
60
  IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?"
 
61
END
 
62
 
 
63
*/
 
64
class CProgressDialogImpl : public NWindows::NControl::CModalDialogImpl
 
65
{
 
66
  public:
 
67
   CProgressDialogImpl(NWindows::NControl::CModalDialog *dialog,wxWindow * parent , int id) : CModalDialogImpl(dialog,parent, id, wxT("Progress"))
 
68
  {
 
69
// FIXME : ProgressDialog2 but ProgressDialog ...
 
70
 
 
71
        ///Sizer for adding the controls created by users
 
72
        wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
 
73
 
 
74
        wxStaticText *pStaticTextElapsedTime = new wxStaticText(this, IDC_PROGRESS_ELAPSED, wxT("Elapsed time:"));
 
75
        wxStaticText *m_pStaticTextElapsedTime = new wxStaticText(this, IDC_PROGRESS_ELAPSED_VALUE, wxT("00:00:00"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
76
        wxStaticText *pStaticTextRemainingTime = new wxStaticText(this, IDC_PROGRESS_REMAINING, wxT("Remaining time"));
 
77
        wxStaticText *m_pStaticTextRemainingTime = new wxStaticText(this, IDC_PROGRESS_REMAINING_VALUE, wxT("00:00:00"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
78
 
 
79
        wxStaticText *pStaticTextFiles = new wxStaticText(this, IDC_PROGRESS_FILES, wxT("Files:"));
 
80
        wxStaticText *m_pStaticTextFiles = new wxStaticText(this, IDC_PROGRESS_FILES_VALUE, wxT("      "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
81
 
 
82
        wxStaticText *pStaticTextRatio = new wxStaticText(this, IDC_PROGRESS_RATIO, wxT("Compression ratio:"));
 
83
        wxStaticText *m_pStaticTextRatio = new wxStaticText(this, IDC_PROGRESS_RATIO_VALUE, wxT("       "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
84
 
 
85
 
 
86
        wxStaticText *pStaticTextSize = new wxStaticText(this, IDC_PROGRESS_TOTAL, wxT("Total Size:"));
 
87
        wxStaticText *m_pStaticTextSize = new wxStaticText(this, IDC_PROGRESS_TOTAL_VALUE, wxT("          "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
88
        wxStaticText *pStaticTextSpeed = new wxStaticText(this, IDC_PROGRESS_SPEED, wxT("Speed:"));
 
89
        wxStaticText *m_pStaticTextSpeed = new wxStaticText(this, IDC_PROGRESS_SPEED_VALUE, wxT("          "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
90
 
 
91
        wxStaticText *pStaticTextUnpacked = new wxStaticText(this, IDC_PROGRESS_UNPACKED, wxT("Processed:"));
 
92
        wxStaticText *m_pStaticTextUnpacked = new wxStaticText(this, IDC_PROGRESS_UNPACKED, wxT("          "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
93
        
 
94
        wxStaticText *pStaticTextPacked = new wxStaticText(this, IDC_PROGRESS_PACKED, wxT("Compressed size:"));
 
95
        wxStaticText *m_pStaticTextPacked = new wxStaticText(this, IDC_PROGRESS_PACKED_VALUE, wxT("          "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
 
96
 
 
97
        wxBoxSizer *pInfoSizer = new wxBoxSizer(wxHORIZONTAL);
 
98
        wxBoxSizer *pTimeSizer = new wxBoxSizer(wxHORIZONTAL);
 
99
        wxBoxSizer *pTimeLabelSizer = new wxBoxSizer(wxVERTICAL);
 
100
        pTimeLabelSizer->Add(pStaticTextElapsedTime  , 0, wxALL|wxEXPAND, 5);
 
101
        pTimeLabelSizer->Add(pStaticTextRemainingTime, 0, wxALL|wxEXPAND, 5);
 
102
        pTimeLabelSizer->Add(pStaticTextFiles        , 0, wxALL|wxEXPAND, 5);
 
103
        pTimeLabelSizer->Add(pStaticTextRatio        , 0, wxALL|wxEXPAND, 5);
 
104
        wxBoxSizer *pTimeInfoSizer = new wxBoxSizer(wxVERTICAL);
 
105
        pTimeInfoSizer->Add(m_pStaticTextElapsedTime  , 0, wxALL|wxEXPAND, 5);
 
106
        pTimeInfoSizer->Add(m_pStaticTextRemainingTime, 0, wxALL|wxEXPAND, 5);
 
107
        pTimeInfoSizer->Add(m_pStaticTextFiles        , 0, wxALL|wxEXPAND, 5);
 
108
        pTimeInfoSizer->Add(m_pStaticTextRatio        , 0, wxALL|wxEXPAND, 5);
 
109
        pTimeSizer->Add(pTimeLabelSizer               , 0, wxALL|wxEXPAND, 5);
 
110
        pTimeSizer->Add(pTimeInfoSizer                , 0, wxALL|wxEXPAND, 5);
 
111
        wxBoxSizer *pSizeSpeedSizer = new wxBoxSizer(wxHORIZONTAL);
 
112
        wxBoxSizer *pSizeSpeedLabelSizer = new wxBoxSizer(wxVERTICAL);
 
113
        pSizeSpeedLabelSizer->Add(pStaticTextSize     , 0, wxALL|wxEXPAND, 5);
 
114
        pSizeSpeedLabelSizer->Add(pStaticTextSpeed    , 0, wxALL|wxEXPAND, 5);
 
115
        pSizeSpeedLabelSizer->Add(pStaticTextUnpacked , 0, wxALL|wxEXPAND, 5);
 
116
        pSizeSpeedLabelSizer->Add(pStaticTextPacked   , 0, wxALL|wxEXPAND, 5);
 
117
 
 
118
        wxBoxSizer *pSizeSpeedInfoSizer = new wxBoxSizer(wxVERTICAL);
 
119
        pSizeSpeedInfoSizer->Add(m_pStaticTextSize    , 0, wxALL|wxEXPAND, 5);
 
120
        pSizeSpeedInfoSizer->Add(m_pStaticTextSpeed   , 0, wxALL|wxEXPAND, 5);
 
121
        pSizeSpeedInfoSizer->Add(m_pStaticTextUnpacked, 0, wxALL|wxEXPAND, 5);
 
122
        pSizeSpeedInfoSizer->Add(m_pStaticTextPacked  , 0, wxALL|wxEXPAND, 5);
 
123
 
 
124
        pSizeSpeedSizer->Add(pSizeSpeedLabelSizer, 1, wxALL|wxEXPAND, 5);
 
125
        pSizeSpeedSizer->Add(pSizeSpeedInfoSizer, 1, wxALL|wxEXPAND, 5);
 
126
        pInfoSizer->Add(pTimeSizer, 0, wxALL|wxEXPAND, 5);
 
127
        pInfoSizer->Add(pSizeSpeedSizer, 0, wxALL|wxEXPAND, 5);
 
128
 
 
129
        wxStaticText *m_pStaticArchiveName = new wxStaticText(this, IDC_PROGRESS_FILE_NAME, wxT(" \n "));
 
130
        wxGauge *m_pGaugeProgress = new wxGauge(this, IDC_PROGRESS1, 100);
 
131
 
 
132
        wxBoxSizer *pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
 
133
        wxButton *m_pButtonBackground = new wxButton(this, IDC_BUTTON_PROGRESS_PRIORITY, wxT("&Background"));
 
134
        wxButton *m_pButtonPause = new wxButton(this, IDC_BUTTON_PAUSE, wxT("&Pause"));
 
135
        wxButton *m_pButtonCancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel"));
 
136
        // FIXME pButtonSizer->AddStretchSpacer(1);
 
137
        pButtonSizer->Add(m_pButtonBackground, 0, wxALL|wxEXPAND, 5);
 
138
        pButtonSizer->Add(m_pButtonPause, 0, wxALL|wxEXPAND, 5);
 
139
        pButtonSizer->Add(m_pButtonCancel, 0, wxALL|wxEXPAND, 5);
 
140
 
 
141
        topsizer->Add(pInfoSizer, 0, wxBOTTOM|wxEXPAND, 5);
 
142
        topsizer->Add(m_pStaticArchiveName, 0, wxLEFT|wxRIGHT|wxEXPAND, 10);
 
143
        topsizer->Add(m_pGaugeProgress, 0, wxALL|wxEXPAND, 10);
 
144
        topsizer->Add(pButtonSizer, 0, wxALL|wxEXPAND, 5);
 
145
 
 
146
        this->OnInit();
 
147
 
 
148
        SetSizer(topsizer); // use the sizer for layout
 
149
        topsizer->SetSizeHints(this); // set size hints to honour minimum size
 
150
  }
 
151
private:
 
152
        // Any class wishing to process wxWindows events must use this macro
 
153
        DECLARE_EVENT_TABLE()
 
154
};
 
155
 
 
156
static CStringTable g_stringTable[] =
 
157
{
 
158
        { IDS_PROGRESS_PAUSED     , L"Paused" },
 
159
        { IDS_PROGRESS_FOREGROUND , L"&Foreground" },
 
160
        { IDS_PROGRESS_CONTINUE   , L"&Continue" },
 
161
        { IDS_PROGRESS_ASK_CANCEL , L"Are you sure you want to cancel?" },
 
162
        { 0 , 0 }
 
163
};
 
164
 
 
165
REGISTER_DIALOG(IDD_DIALOG_PROGRESS,CProgressDialog,g_stringTable)
 
166
 
 
167
BEGIN_EVENT_TABLE(CProgressDialogImpl, wxDialog)
 
168
        EVT_TIMER(wxID_ANY, CModalDialogImpl::OnAnyTimer)
 
169
        EVT_BUTTON(wxID_ANY, CModalDialogImpl::OnAnyButton)
 
170
END_EVENT_TABLE()
 
171