-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgressDlg.cpp
More file actions
71 lines (57 loc) · 1.58 KB
/
ProgressDlg.cpp
File metadata and controls
71 lines (57 loc) · 1.58 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
////////////////////////////////////////////////////////////////////////////////
//! \file ProgressDlg.cpp
//! \brief The ProgressDlg class definition.
//! \author Chris Oldwood
#include "Common.hpp"
#include "ProgressDlg.hpp"
#include "TheApp.hpp"
////////////////////////////////////////////////////////////////////////////////
//! Default constructor.
ProgressDlg::ProgressDlg(CWnd& parent)
: CDialog(IDD_PROGRESS)
, m_parent(parent)
{
DEFINE_CTRL_TABLE
CTRL(IDC_STATUS, &m_statusLabel)
CTRL(IDC_PROGRESS, &m_progressBar)
END_CTRL_TABLE
DEFINE_CTRLMSG_TABLE
END_CTRLMSG_TABLE
// Create dialog.
m_parent.Enable(false);
RunModeless(parent);
g_app.m_MainThread.ProcessMsgQueue();
}
////////////////////////////////////////////////////////////////////////////////
//! Destructor.
ProgressDlg::~ProgressDlg()
{
// Destroy dialog.
m_parent.Enable(true);
Destroy();
}
////////////////////////////////////////////////////////////////////////////////
//! Dialog initialisation handler.
void ProgressDlg::OnInitDialog()
{
// Initialise controls.
m_statusLabel.Text(TXT("Initialising..."));
m_progressBar.Range(0, 5);
// Display it.
Centre();
Show();
}
////////////////////////////////////////////////////////////////////////////////
//! Set the status message.
void ProgressDlg::setStatus(const tchar* status)
{
m_statusLabel.Text(status);
m_statusLabel.Update();
}
////////////////////////////////////////////////////////////////////////////////
//! Update the progress bar.
void ProgressDlg::updateProgressBar(uint progress)
{
m_progressBar.Pos(progress);
m_progressBar.Update();
}