dlgmapattset.cpp
资源名称:QGIS.rar [点击查看]
上传用户:oybseng
上传日期:2015-04-27
资源大小:7831k
文件大小:3k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // dlgmapattset.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..qgis.h"
- #include "dlgmapattset.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDlgMapAttSet dialog
- CDlgMapAttSet::CDlgMapAttSet(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgMapAttSet::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgMapAttSet)
- m_fRightY = 0.0;
- m_fRightX = 0.0;
- m_fLeftY = 0.0;
- m_fLeftX = 0.0;
- m_lMapScale = 0;
- //}}AFX_DATA_INIT
- }
- void CDlgMapAttSet::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgMapAttSet)
- DDX_Control(pDX, IDC_COMBO_UNIT_DLG_MAP_ATT, m_comUnit);
- DDX_Text(pDX, IDC_EDIT_RIGHT_Y_DLG_MAP_ATT, m_fRightY);
- DDV_MinMaxDouble(pDX, m_fRightY, 0., 10000.);
- DDX_Text(pDX, IDC_EDIT_RIGHT_X_DLG_MAP_ATT, m_fRightX);
- DDV_MinMaxDouble(pDX, m_fRightX, 0., 10000.);
- DDX_Text(pDX, IDC_EDIT_LEFT_Y_DLG_MAP_ATT, m_fLeftY);
- DDV_MinMaxDouble(pDX, m_fLeftY, 0., 10000.);
- DDX_Text(pDX, IDC_EDIT_LEFT_X_DLG_MAP_ATT, m_fLeftX);
- DDV_MinMaxDouble(pDX, m_fLeftX, 0., 10000.);
- DDX_Text(pDX, IDC_EDIT_SCALE_DLG_MAP_ATT, m_lMapScale);
- DDV_MinMaxLong(pDX, m_lMapScale, 1, 1000000);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgMapAttSet, CDialog)
- //{{AFX_MSG_MAP(CDlgMapAttSet)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgMapAttSet message handlers
- BOOL CDlgMapAttSet::OnInitDialog()
- {
- CDialog::OnInitDialog();
- UpdateData(TRUE);
- m_lMapScale = 500;
- m_fLeftX = 0.0;
- m_fLeftY = 0.0;
- m_fRightX = 600.0;
- m_fRightY = 800.0;
- InitCombox(); // 初始化
- // TODO: Add extra initialization here
- UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDlgMapAttSet::InitCombox()
- {
- m_comUnit.Clear();
- m_comUnit.AddString("米------M");
- m_comUnit.AddString("厘米---CM");
- m_comUnit.AddString("毫米---MM");
- m_comUnit.AddString("英尺--INCH");
- m_comUnit.AddString("公里---KM");
- m_comUnit.AddString("度分秒-DMS");
- m_comUnit.AddString("度------D");
- m_comUnit.SetCurSel(0);
- }
- CString CDlgMapAttSet::GetMapUnit()
- {
- CString szUint = "";
- int nMapUnit = m_comUnit.GetCurSel();
- switch(nMapUnit)
- {
- case 0:
- szUint = "米";
- break;
- case 1:
- szUint = "厘米";
- break;
- case 2:
- szUint = "毫米";
- break;
- case 3:
- szUint = "英尺";
- break;
- case 4:
- szUint = "公里";
- break;
- case 5:
- szUint = "度分秒";
- break;
- case 6:
- szUint = "度";
- break;
- default:
- break;
- }
- return szUint;
- }
- void CDlgMapAttSet::OnOK()
- {
- // TODO: Add extra validation her
- UpdateData(TRUE);
- m_nUnitType = m_comUnit.GetCurSel();
- UpdateData(FALSE);
- CDialog::OnOK();
- }