gpsdlg.cpp

来自「在PDA上接收GPS信号」· C++ 代码 · 共 79 行

CPP
79
字号
// GpsDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GpsTracker.h"
#include "GpsDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGpsDlg dialog


CGpsDlg::CGpsDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGpsDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGpsDlg)
	m_strGpsLatitude = _T("");
	m_strGpsLongitude = _T("");
	//}}AFX_DATA_INIT
}


void CGpsDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGpsDlg)
	DDX_Text(pDX, IDC_EDIT_GPS_LATITUDE, m_strGpsLatitude);
	DDV_MaxChars(pDX, m_strGpsLatitude, 4);
	DDX_Text(pDX, IDC_EDIT_GPS_LONGITUDE, m_strGpsLongitude);
	DDV_MaxChars(pDX, m_strGpsLongitude, 4);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGpsDlg, CDialog)
	//{{AFX_MSG_MAP(CGpsDlg)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDC_BUTTON_EXIT, OnButtonExit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGpsDlg message handlers

BOOL CGpsDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_nTimer=SetTimer(1,1000,NULL);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CGpsDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
//	UpdateData(false);
	GetDlgItem(IDC_EDIT_GPS_LATITUDE)->SetWindowText(m_strGpsLatitude);	
	GetDlgItem(IDC_EDIT_GPS_LONGITUDE)->SetWindowText(m_strGpsLongitude);	
	CDialog::OnTimer(nIDEvent);
}

void CGpsDlg::OnButtonExit() 
{
	// TODO: Add your control notification handler code here
	KillTimer(m_nTimer);

    DestroyWindow();
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?