📄 standardlength.cpp
字号:
// StandardLength.cpp : implementation file
//
#include "stdafx.h"
#include "bxt.h"
#include "StandardLength.h"
#include "RegTools.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStandardLength dialog
CStandardLength::CStandardLength(CWnd* pParent /*=NULL*/)
: CDialog(CStandardLength::IDD, pParent)
{
CRegTools rt;
CHAR sLength[100];
rt.GetString("Length", sLength, 100, "5.0");
//{{AFX_DATA_INIT(CStandardLength)
m_unit = _T("");
m_length = sLength;
//}}AFX_DATA_INIT
m_sUnit = NULL;
}
void
CStandardLength::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStandardLength)
DDX_Control(pDX, IDC_COMBO_UNIT, m_unitcontrol);
DDX_CBString(pDX, IDC_COMBO_UNIT, m_unit);
DDX_Text(pDX, IDC_EDIT_LENGTH, m_length);
DDV_MaxChars(pDX, m_length, 5);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStandardLength, CDialog)
//{{AFX_MSG_MAP(CStandardLength)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStandardLength message handlers
VOID
CStandardLength::OnOK()
{
UpdateData(TRUE);
CRegTools rt;
rt.WriteString("Length", m_length.GetBuffer(m_length.GetLength()));
m_fLength = (FLOAT)(atof(m_length));
m_sUnit = m_unit.GetBuffer(m_unit.GetLength());
CDialog::OnOK();
}
VOID
CStandardLength::OnCancel()
{
CDialog::OnCancel();
}
BOOL
CStandardLength::OnInitDialog()
{
CDialog::OnInitDialog();
m_unitcontrol.AddString("毫米");
m_unitcontrol.AddString("厘米");
m_unitcontrol.AddString("分米");
m_unitcontrol.SetCurSel(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -