forked from oott123/WinMTR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WinMTROptions.cpp
112 lines (88 loc) · 2.74 KB
/
WinMTROptions.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
108
109
110
111
112
//*****************************************************************************
// FILE: WinMTROptions.cpp
//
//
//*****************************************************************************
#include "WinMTRGlobal.h"
#include "WinMTROptions.h"
#include "WinMTRLicense.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//*****************************************************************************
// BEGIN_MESSAGE_MAP
//
//
//*****************************************************************************
BEGIN_MESSAGE_MAP(WinMTROptions, CDialog)
ON_BN_CLICKED(ID_LICENSE, OnLicense)
END_MESSAGE_MAP()
//*****************************************************************************
// WinMTROptions::WinMTROptions
//
//
//*****************************************************************************
WinMTROptions::WinMTROptions(CWnd* pParent) : CDialog(WinMTROptions::IDD, pParent)
{
}
//*****************************************************************************
// WinMTROptions::DoDataExchange
//
//
//*****************************************************************************
void WinMTROptions::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_SIZE, m_editSize);
DDX_Control(pDX, IDC_EDIT_INTERVAL, m_editInterval);
DDX_Control(pDX, IDC_EDIT_MAX_LRU, m_editMaxLRU);
DDX_Control(pDX, IDC_CHECK_DNS, m_checkDNS);
}
//*****************************************************************************
// WinMTROptions::OnInitDialog
//
//
//*****************************************************************************
BOOL WinMTROptions::OnInitDialog()
{
CDialog::OnInitDialog();
char strtmp[20];
sprintf(strtmp, "%.1f", interval);
m_editInterval.SetWindowText(strtmp);
sprintf(strtmp, "%d", pingsize);
m_editSize.SetWindowText(strtmp);
sprintf(strtmp, "%d", maxLRU);
m_editMaxLRU.SetWindowText(strtmp);
m_checkDNS.SetCheck(useDNS);
m_editInterval.SetFocus();
return FALSE;
}
//*****************************************************************************
// WinMTROptions::OnOK
//
//
//*****************************************************************************
void WinMTROptions::OnOK()
{
char tmpstr[20];
useDNS = m_checkDNS.GetCheck();
m_editInterval.GetWindowText(tmpstr, 20);
interval = atof(tmpstr);
m_editSize.GetWindowText(tmpstr, 20);
pingsize = atoi(tmpstr);
m_editMaxLRU.GetWindowText(tmpstr, 20);
maxLRU = atoi(tmpstr);
CDialog::OnOK();
}
//*****************************************************************************
// WinMTROptions::OnLicense
//
//
//*****************************************************************************
void WinMTROptions::OnLicense()
{
WinMTRLicense mtrlicense;
mtrlicense.DoModal();
}