-
Notifications
You must be signed in to change notification settings - Fork 2
/
DepthColorHelperDialog.cpp
84 lines (73 loc) · 2.34 KB
/
DepthColorHelperDialog.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
// DepthColorHelperDialog.cpp : implementation file
//
#include "stdafx.h"
#include "OnStation.h"
#include "DepthColorHelperDialog.h"
#include "settings.h"
extern COnStationApp theApp;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDepthColorHelperDialog dialog
CDepthColorHelperDialog::CDepthColorHelperDialog(float fStartDepth,float fIncr,int iNum,CWnd* pParent /*=NULL*/)
: CDialog(CDepthColorHelperDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CDepthColorHelperDialog)
m_iNumIntervals = iNum;
m_fDepth = fIncr;
m_fStartDepth = fStartDepth;
//}}AFX_DATA_INIT
if (!theApp.GetSettings()->IsMetric())
{
m_fStartDepth=MetersToFeet(m_fStartDepth);
m_fDepth=MetersToFeet(m_fDepth);
}
}
void CDepthColorHelperDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDepthColorHelperDialog)
DDX_Control(pDX, IDC_STATICSTARTDEPTH, m_szStartingText);
DDX_Control(pDX, IDC_STATICINTERVAL, m_szIntervalText);
DDX_Text(pDX, IDC_NUMINTERVALS, m_iNumIntervals);
DDV_MinMaxUInt(pDX, m_iNumIntervals, 2, 15);
DDX_Text(pDX, IDC_DEPTH, m_fDepth);
DDV_MinMaxFloat(pDX, m_fDepth, 5.f, 5000.f);
DDX_Text(pDX, IDC_STARTINGDEPTH, m_fStartDepth);
//}}AFX_DATA_MAP
if (!theApp.GetSettings()->IsMetric() && pDX->m_bSaveAndValidate)
{
m_fStartDepth=FeetToMeters(m_fStartDepth);
m_fDepth=FeetToMeters(m_fDepth);
}
}
BEGIN_MESSAGE_MAP(CDepthColorHelperDialog, CDialog)
//{{AFX_MSG_MAP(CDepthColorHelperDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDepthColorHelperDialog message handlers
BOOL CDepthColorHelperDialog::OnInitDialog()
{
CDialog::OnInitDialog();
CString CS;
if (theApp.GetSettings()->IsMetric())
{
CS.LoadString(IDS_STARTDEPTHM);
m_szStartingText.SetWindowText(CS);
CS.LoadString(IDS_INTERVALM);
m_szIntervalText.SetWindowText(CS);
}
else
{
CS.LoadString(IDS_STARTDEPTHFT);
m_szStartingText.SetWindowText(CS);
CS.LoadString(IDS_INTERVALFT);
m_szIntervalText.SetWindowText(CS);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}