[dad864]: massclear.cpp  Maximize  Restore  History

Download this file

94 lines (76 with data), 2.0 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
83
84
85
86
87
88
89
90
91
92
93
// massclear.cpp : implementation file
//
#include "stdafx.h"
#include "chitem.h"
#include "massclear.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// massclear dialog
massclear::massclear(CWnd* pParent /*=NULL*/)
: CDialog(massclear::IDD, pParent)
{
//{{AFX_DATA_INIT(massclear)
m_from = 0;
m_to = 0;
//}}AFX_DATA_INIT
}
void massclear::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(massclear)
DDX_Control(pDX, IDC_FROM, m_from_control);
DDX_Control(pDX, IDC_TOSP, m_tosp_control);
DDX_Control(pDX, IDC_FROMSP, m_fromsp_control);
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_FROM, m_from);
if(m_from>m_maxval) m_from=m_maxval;
if(m_from<m_minval) m_from=m_minval;
DDV_MinMaxInt(pDX, m_from, m_minval, m_maxval);
DDX_Text(pDX, IDC_TO, m_to);
if(m_to>m_maxval) m_to=m_maxval;
if(m_to<m_from) m_to=m_from;
DDV_MinMaxInt(pDX, m_to, m_from, m_maxval);
m_fromsp_control.SetRange32(m_minval,m_maxval);
m_tosp_control.SetRange32(m_from,m_maxval);
}
BEGIN_MESSAGE_MAP(massclear, CDialog)
//{{AFX_MSG_MAP(massclear)
ON_EN_KILLFOCUS(IDC_FROM, OnKillfocusFrom)
ON_EN_KILLFOCUS(IDC_TO, OnKillfocusTo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// massclear message handlers
void massclear::SetRange(int minval, int maxval, int curval)
{
m_minval=minval;
m_maxval=maxval;
m_from=minval;
m_to=max(minval,curval);
}
void massclear::SetText(CString str)
{
m_caption=str;
}
void massclear::OnKillfocusFrom()
{
UpdateData(UD_RETRIEVE);
if(m_to<m_from) m_to=m_from;
UpdateData(UD_DISPLAY);
}
void massclear::OnKillfocusTo()
{
UpdateData(UD_RETRIEVE);
if(m_to<m_from) m_to=m_from;
UpdateData(UD_DISPLAY);
}
BOOL massclear::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowText(m_caption);
return TRUE;
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks