-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSkinProgressTestScanned.cpp
99 lines (74 loc) · 2.27 KB
/
SkinProgressTestScanned.cpp
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// SkinProgressTestScanned.cpp : implementation file
//
#include "stdafx.h"
#include "skinprogresstest.h"
#include "SkinProgressTestScanned.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSkinProgressTestScanned dialog
#ifdef dCSP_DIALOG_PROGRESS
CSkinProgressTestScanned::CSkinProgressTestScanned(CWnd* pParent /*=NULL*/)
: CDialog(CSkinProgressTestScanned::IDD, pParent)
{
//{{AFX_DATA_INIT(CSkinProgressTestScanned)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSkinProgressTestScanned::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSkinProgressTestScanned)
DDX_Control(pDX, IDOK, m_cButtonOk);
DDX_Control(pDX, IDC_THERMO, m_cStaticThermo);
DDX_Control(pDX, IDC_PEN, m_cStaticPencil);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSkinProgressTestScanned, CDialog)
//{{AFX_MSG_MAP(CSkinProgressTestScanned)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSkinProgressTestScanned message handlers
/*
*/
void CSkinProgressTestScanned::OnOK()
{
m_cButtonOk.EnableWindow(false);
// TODO: Add extra validation here
int nMultiplyDelay = 100000; // 100000 : Dummy value, sorry, I've got a super strong computer
// It's also nice to test the <dCSP_TIMED_REDRAW> mode
//
CBitmap oBitmapThermo;
CBitmap oBitmapPencil;
// Init
oBitmapThermo.LoadBitmap(IDB_BMP_THERMO);
oBitmapPencil.LoadBitmap(IDB_BMP_PENCIL);
CSkinProgress oProgressThermo
(
&m_cStaticThermo,
11 * nMultiplyDelay, // 11 for not overwrite the end element of the thermometer
&oBitmapThermo
);
CSkinProgress oProgressPencil
(
&m_cStaticPencil,
10 * nMultiplyDelay,
&oBitmapPencil
);
oProgressPencil.SetPos(10 * nMultiplyDelay);
oProgressPencil.SetStep(-1);
//
for(int i = 0; i < 10 * nMultiplyDelay; i += 1)
{
oProgressThermo.StepIt();
oProgressPencil.StepIt();
PeekAndPump();
}
m_cButtonOk.EnableWindow(true);
CDialog::OnOK(); // Quit
}
#endif // dCSP_DIALOG_PROGRESS