-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZTABDLG.cpp
78 lines (56 loc) · 1.25 KB
/
ZTABDLG.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
// ztabdlg.cpp : implementation file
//
#include "stdafx.h"
#include "psx.h"
#include "ztabdlg.h"
#include "calc.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CztabDlg dialog
CztabDlg::CztabDlg(CWnd* pParent /*=NULL*/)
: CDialog(CztabDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CztabDlg)
m_erg = "";
m_t = "";
//}}AFX_DATA_INIT
}
void CztabDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CztabDlg)
DDX_Text(pDX, IDC_TTABERG, m_erg);
DDX_Text(pDX, IDC_TTABT, m_t);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CztabDlg, CDialog)
//{{AFX_MSG_MAP(CztabDlg)
ON_BN_CLICKED(IDC_BERECH, OnClickedBerech)
ON_BN_CLICKED(IDC_NEU, OnClickedNeu)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CztabDlg message handlers
void CztabDlg::OnClickedBerech()
{
float yat;
double uitz;
char pzt[20];
calc cal;
UpdateData(TRUE);
yat = atof(m_t);
cal.per(yat);
uitz = cal.prozent;
sprintf(pzt,"%.13lf",uitz);
m_erg = pzt;
UpdateData(FALSE);
}
void CztabDlg::OnClickedNeu()
{
m_t = "";
m_erg = "";
UpdateData(FALSE);
}