-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCProgressDlg.cpp
More file actions
51 lines (40 loc) · 1.53 KB
/
Copy pathCProgressDlg.cpp
File metadata and controls
51 lines (40 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Proteus Controller - A Preset editor for E-mu Proteus compatible
sound modules
Copyright (C) 2004 John McCann
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
http://www.gnu.org/copyleft/gpl.html
*/
#include "CProgressDlg.h"
BEGIN_EVENT_TABLE(CProgressDlg, wxDialog)
EVT_BUTTON(CANCEL_BUTTON_ID, OnCancel)
END_EVENT_TABLE()
CProgressDlg::CProgressDlg(wxWindow* parent, char* text) : wxDialog(parent, -1, text,
wxDefaultPosition, wxSize(300, 130))
{
SetIcon(wxIcon("PRESET_ICON", wxBITMAP_TYPE_ICO_RESOURCE));
wxStaticBox* box = new wxStaticBox(this, -1, text, wxPoint(5, 5), wxSize(285, 90));
mGauge = new wxGauge(this, -1, 10, wxPoint(10, 20), wxSize(275, 35), wxGA_HORIZONTAL | wxGA_SMOOTH);
mCancel = new wxButton(this, CANCEL_BUTTON_ID, "Cancel", wxPoint(120, 60), wxSize(60, 25));
mCancelled = false;
}
void CProgressDlg::SetTotalSteps(int steps)
{
mGauge->SetRange(steps);
}
void CProgressDlg::Step()
{
mGauge->SetValue(mGauge->GetValue()+1);
}
void CProgressDlg::OnCancel(wxCommandEvent& event)
{
mCancelled = true;
Show(FALSE);
}