-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFPDialog.cpp
More file actions
74 lines (59 loc) · 1.37 KB
/
FPDialog.cpp
File metadata and controls
74 lines (59 loc) · 1.37 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
// FPDialog.cpp : implementation file
//
#include "stdafx.h"
#include "wineve.h"
#include "FPDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFPDialog dialog
CFPDialog::CFPDialog(CWnd* pParent /*=NULL*/)
: CDialog(CFPDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CFPDialog)
m_contents = _T("");
m_addr = _T("");
//}}AFX_DATA_INIT
}
void CFPDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFPDialog)
DDX_Text(pDX, IDC_CONTENTS, m_contents);
DDV_MaxChars(pDX, m_contents, 16);
DDX_Text(pDX, IDC_LOCATION, m_addr);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFPDialog, CDialog)
//{{AFX_MSG_MAP(CFPDialog)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFPDialog message handlers
void CFPDialog::OnOK()
{
int i;
char txt[2000];
UpdateData(TRUE);
strcpy_s(txt,2000,m_contents);
i=0;
while (txt[i]!=0 && txt[i]!=' ')
{
if (!isdigit(txt[i]) && txt[i]!='.')
{
if (i!=0 || txt[i]!='-') return;
}
i++;
}
CDialog::OnOK();
}
void CFPDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}