You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.0 KiB
88 lines
2.0 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: ScaleDlg.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of ScaleDlg.cpp
|
|
//----------------------------------------------------------------------------
|
|
// ScaleDlg.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "setuplgs.h"
|
|
#include "ScaleDlg.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CScaleDlg dialog
|
|
|
|
|
|
CScaleDlg::CScaleDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CScaleDlg::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CScaleDlg)
|
|
m_nSystem = 0;
|
|
m_dDistance = 0.0;
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CScaleDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CScaleDlg)
|
|
DDX_Radio(pDX, IDC_RADIO_METRIC_SYSTEM_METERS, m_nSystem);
|
|
DDX_Text(pDX, IDC_EDIT_DISTANCE, m_dDistance);
|
|
DDV_MinMaxDouble(pDX, m_dDistance, 0.1, 100000.);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CScaleDlg, CDialog)
|
|
//{{AFX_MSG_MAP(CScaleDlg)
|
|
ON_BN_CLICKED(IDC_RADIO_METRIC_SYSTEM_FEET, OnRadioMetricSystem)
|
|
ON_BN_CLICKED(IDC_RADIO_METRIC_SYSTEM_METERS, OnRadioMetricSystem)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CScaleDlg message handlers
|
|
|
|
void CScaleDlg::OnRadioMetricSystem()
|
|
{
|
|
INT nSystem = m_nSystem;
|
|
UpdateData( TRUE );
|
|
if( nSystem != m_nSystem )
|
|
{
|
|
switch( m_nSystem )
|
|
{
|
|
case 0: m_dDistance /= 3.048; break;
|
|
case 1: m_dDistance *= 3.048; break;
|
|
}
|
|
UpdateData( FALSE );
|
|
}
|
|
}
|
|
|
|
double CScaleDlg::GetDistance()
|
|
{
|
|
switch( m_nSystem )
|
|
{
|
|
case 0:
|
|
return m_dDistance;
|
|
case 1:
|
|
// convert to metric and return
|
|
return m_dDistance /= 3.048;
|
|
}
|
|
return 1.0;
|
|
}
|