-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVARDLG.cpp
107 lines (84 loc) · 1.65 KB
/
VARDLG.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
100
101
102
103
104
105
106
107
// vardlg.cpp : implementation file
//
#include "stdafx.h"
#include "psx.h"
#include "vardlg.h"
#include "calc.h"
#include "prot.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVarDlg dialog
CVarDlg::CVarDlg(CWnd* pParent /*=NULL*/)
: CDialog(CVarDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CVarDlg)
m_k = "";
m_n = "";
m_erg = "";
m_wh = FALSE;
//}}AFX_DATA_INIT
}
void CVarDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVarDlg)
DDX_Text(pDX, IDC_K, m_k);
DDX_Text(pDX, IDC_N, m_n);
DDX_Text(pDX, IDC_ERG, m_erg);
DDX_Check(pDX, IDC_CHECK1, m_wh);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CVarDlg, CDialog)
//{{AFX_MSG_MAP(CVarDlg)
ON_BN_CLICKED(IDC_BERECH, OnClickedBerech)
ON_BN_CLICKED(IDC_NEU, OnClickedNeu)
ON_BN_CLICKED(IDC_CHECK1, OnClickedCheck1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVarDlg message handlers
int vwh = 0;
void CVarDlg::OnClickedBerech()
{
calc cal;
char ui[20];
long vn,vk,see;
double teich;
UpdateData(TRUE);
vn = atol(m_n);
vk = atol(m_k);
cal.vrt(vn,vk,vwh);
if(cal.komb < 10000000)
{
see = cal.komb;
sprintf(ui,"%ld",see);
}
else
{
teich = cal.komb;
sprintf(ui,"%ef",teich);
}
m_erg = ui;
UpdateData(FALSE);
}
void CVarDlg::OnClickedNeu()
{
m_n = "";
m_k = "";
m_erg = "";
UpdateData(FALSE);
}
void CVarDlg::OnClickedCheck1()
{
if(vwh == 1)
{
vwh = 0;
}
else
{
vwh = 1;
}
}