www.pudn.com > MyGPSDemo.rar > MapXSetDlg.cpp


// MapXSetDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "MapDemo.h" 
#include "MapXSetDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// MapXSetDlg dialog 
 
 
MapXSetDlg::MapXSetDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(MapXSetDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(MapXSetDlg) 
	m_dCenterX = 0.0; 
	m_dCenterY = 0.0; 
	m_nRedrawTime = 0; 
	m_dZoomValue = 0.0; 
	//}}AFX_DATA_INIT 
	m_pMapX=NULL; 
} 
 
MapXSetDlg::MapXSetDlg(CMapX* pMapX,CWnd* pParent /*=NULL*/) 
	: CDialog(MapXSetDlg::IDD, pParent) 
{ 
	 
	m_dCenterX = 0.0; 
	m_dCenterY = 0.0; 
	m_nRedrawTime = 0; 
	m_dZoomValue = 0.0; 
 
	m_pMapX=pMapX; 
	 
} 
 
void MapXSetDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(MapXSetDlg) 
	DDX_Text(pDX, IDC_EDIT_CENTERX, m_dCenterX); 
	DDX_Text(pDX, IDC_EDIT_CENTERY, m_dCenterY); 
	DDX_Text(pDX, IDC_EDIT_REDRAWTIME, m_nRedrawTime); 
	DDX_Text(pDX, IDC_EDIT_ZOOMVALUE, m_dZoomValue); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(MapXSetDlg, CDialog) 
	//{{AFX_MSG_MAP(MapXSetDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// MapXSetDlg message handlers 
 
BOOL MapXSetDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	if(m_pMapX!=NULL){ 
		m_dCenterX = m_pMapX->GetCenterX(); 
		m_dCenterY = m_pMapX->GetCenterY(); 
		m_nRedrawTime = m_pMapX->GetRedrawInterval(); 
		m_dZoomValue = m_pMapX->GetZoom(); 
		UpdateData(FALSE); 
    } 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void MapXSetDlg::OnOK()  
{ 
	 
	CDialog::OnOK(); 
	if(m_pMapX!=NULL){ 
	 
		m_pMapX->SetCenterX(m_dCenterX); 
		m_pMapX->SetCenterY(m_dCenterY); 
		m_pMapX->SetRedrawInterval(m_nRedrawTime); 
		m_pMapX->SetZoom(m_dZoomValue);  
	 
    } 
 
}