RegDLG.cpp
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:2k
- // RegDLG.cpp : implementation file
- //
- #include "stdafx.h"
- #include "tiffsample.h"
- #include "RegDLG.h"
- #include <geo.h>
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // RegDLG dialog
- RegDLG::RegDLG(CWnd* pParent /*=NULL*/)
- : CDialog(RegDLG::IDD, pParent)
- {
- //{{AFX_DATA_INIT(RegDLG)
- //}}AFX_DATA_INIT
- }
- void RegDLG::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(RegDLG)
- DDX_Control(pDX, IDC_LASTPT_CHECK, m_lastCheck);
- DDX_Control(pDX, IDC_LONGITUDE_EDIT, m_long_edit);
- DDX_Control(pDX, IDC_LATITUDE_EDIT, m_lat_edit);
- DDX_Control(pDX, IDC_XPT_EDIT, m_xpt_edit);
- DDX_Control(pDX, IDC_YPT_EDIT, m_ypt_edit);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(RegDLG, CDialog)
- //{{AFX_MSG_MAP(RegDLG)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // RegDLG message handlers
- BOOL RegDLG::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- char txt[24];
- memset(txt, 0, (size_t)24);
- sprintf(txt,"%f",m_x);
- m_xpt_edit.SetWindowText(txt);
- memset(txt, 0, (size_t)24);
- sprintf(txt,"%f",m_y);
- m_ypt_edit.SetWindowText(txt);
- m_last = false;
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void RegDLG::OnOK()
- {
- char txt[24];
- memset(txt, 0, (size_t)24);
- m_lat_edit.GetWindowText(txt,23);
- m_lat = GeoCalc::DecodeLatitude(txt);
- memset(txt, 0, (size_t)24);
- m_long_edit.GetWindowText(txt,23);
- m_lon = GeoCalc::DecodeLongitude(txt);
- if (m_lastCheck.GetCheck())
- {
- m_last = true;
- }
-
- CDialog::OnOK();
- }