scalesetdlg.cpp
来自「用VC+SuperMap开发的校园GIS系统」· C++ 代码 · 共 66 行
CPP
66 行
// ScaleSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "CampusGis.h"
#include "ScaleSetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScaleSetDlg dialog
CScaleSetDlg::CScaleSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CScaleSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScaleSetDlg)
m_strEdit1 = _T("1:");
//}}AFX_DATA_INIT
}
void CScaleSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScaleSetDlg)
DDX_Control(pDX, IDC_EDIT2, m_EditScale);
DDX_Text(pDX, IDC_EDIT1, m_strEdit1);
DDV_MaxChars(pDX, m_strEdit1, 2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScaleSetDlg, CDialog)
//{{AFX_MSG_MAP(CScaleSetDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
void CScaleSetDlg::OnOK()
{
CString strScale;
double dScale;
m_EditScale.GetWindowText(strScale);
if(!strScale.IsEmpty())
{
dScale=1.00000000/(atof((LPCTSTR )strScale));
m_pSupermap->SetViewScale(dScale);
}
m_pSupermap->Refresh();
CDialog::OnOK();
}
void CScaleSetDlg::OnCancel()
{
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?