-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDLGProgress.cpp
More file actions
82 lines (67 loc) · 1.91 KB
/
DLGProgress.cpp
File metadata and controls
82 lines (67 loc) · 1.91 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
72
73
74
75
76
77
78
79
80
81
82
// DLGProgress.cpp : implementation file
//
#include "stdafx.h"
#include "HexEditor.h"
#include "DLGProgress.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDLGProgress dialog
CDLGProgress::CDLGProgress(CWnd* pParent /*=NULL*/)
: CDialog(CDLGProgress::IDD, pParent)
{
//{{AFX_DATA_INIT(CDLGProgress)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDLGProgress::SetProgress( int nProgress, CString szCurTask )
{
m_wndProgressBar.SetPos( nProgress );
m_wndTask.SetWindowText( szCurTask );
}
void CDLGProgress::SetSubProgress( int nProgress )
{
if( nProgress == -1 )
m_wndMiniProgressBar.EnableWindow( FALSE );
else
{
m_wndMiniProgressBar.EnableWindow( TRUE );
m_wndMiniProgressBar.SetPos( nProgress );
}
}
void CDLGProgress::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDLGProgress)
DDX_Control(pDX, IDC_ABORT, m_wndAbort);
DDX_Control(pDX, IDC_MINIPROGRESSBAR, m_wndMiniProgressBar);
DDX_Control(pDX, IDC_TASK, m_wndTask);
DDX_Control(pDX, IDC_PROGRESSBAR, m_wndProgressBar);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDLGProgress, CDialog)
//{{AFX_MSG_MAP(CDLGProgress)
ON_BN_CLICKED(IDC_ABORT, OnAbort)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDLGProgress message handlers
BOOL CDLGProgress::OnInitDialog()
{
CDialog::OnInitDialog();
// set ranges etc
m_wndProgressBar.SetRange( 0, 100 );
m_wndMiniProgressBar.SetRange( 0, 100 );
m_wndMiniProgressBar.EnableWindow( FALSE );
m_wndTask.SetWindowText( "" );
m_fAborted = FALSE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDLGProgress::OnAbort()
{
m_fAborted = TRUE;
}