|
|
|
|
// ModifyLinePointDlg.cpp : ʵ<><CAB5><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "ModifyLinePointDlg.h"
|
|
|
|
|
#include "afxdialogex.h"
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include "string"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
|
// CModifyLinePointDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CModifyLinePointDlg, CBCGPDialog)
|
|
|
|
|
|
|
|
|
|
CModifyLinePointDlg::CModifyLinePointDlg(CWnd* pParent /*=NULL*/)
|
|
|
|
|
: CBCGPDialog(CModifyLinePointDlg::IDD, pParent)
|
|
|
|
|
, m_bCirclingPoint(0)
|
|
|
|
|
{
|
|
|
|
|
EnableVisualManagerStyle(TRUE, TRUE);
|
|
|
|
|
m_gLat = 0.0;
|
|
|
|
|
m_gLon = 0.0;
|
|
|
|
|
|
|
|
|
|
m_bCheck = false;
|
|
|
|
|
|
|
|
|
|
splitSymbol = "EWNSs+\/-,;<3B><><EFBFBD>ȡ䣧<C8A1><E4A3A7><EFBFBD><EFBFBD>\"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ";
|
|
|
|
|
dSymbol = "<EFBFBD><EFBFBD>";
|
|
|
|
|
mSymbol = "<EFBFBD><EFBFBD>";
|
|
|
|
|
sSymbol = "\"";
|
|
|
|
|
|
|
|
|
|
m_bCirclingPointVisible = true;
|
|
|
|
|
|
|
|
|
|
m_selectedPointID = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CModifyLinePointDlg::~CModifyLinePointDlg()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
{
|
|
|
|
|
CBCGPDialog::DoDataExchange(pDX);
|
|
|
|
|
DDX_Control(pDX, IDC_COMBO_TYPE, m_PositionType);
|
|
|
|
|
DDX_Control(pDX, IDC_EDIT_LON, m_strLon);
|
|
|
|
|
DDX_Control(pDX, IDC_EDIT_LAT, m_strLat);
|
|
|
|
|
DDX_Control(pDX, IDC_COMBO_POINTID, m_PointID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CModifyLinePointDlg, CBCGPDialog)
|
|
|
|
|
ON_CBN_SELCHANGE(IDC_COMBO_PT, &CModifyLinePointDlg::OnCbnSelchangeComboPt)
|
|
|
|
|
ON_CBN_SELCHANGE(IDC_COMBO_TYPE, &CModifyLinePointDlg::OnCbnSelchangeComboType)
|
|
|
|
|
ON_BN_CLICKED(IDOK, &CModifyLinePointDlg::OnBnClickedOk)
|
|
|
|
|
ON_BN_CLICKED(IDCANCEL, &CModifyLinePointDlg::OnBnClickedCancel)
|
|
|
|
|
ON_BN_CLICKED(IDC_SETCIRCLINGPOINT, &CModifyLinePointDlg::OnBnClickedSetcirclingpoint)
|
|
|
|
|
ON_EN_KILLFOCUS(IDC_EDIT_LON, &CModifyLinePointDlg::OnEnKillfocusEditLon)
|
|
|
|
|
ON_EN_KILLFOCUS(IDC_EDIT_LAT, &CModifyLinePointDlg::OnEnKillfocusEditLat)
|
|
|
|
|
ON_CBN_SELCHANGE(IDC_COMBO_POINTID, &CModifyLinePointDlg::OnCbnSelchangeComboPointid)
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㰴ť<E3B0B4>Ƿ<EFBFBD><C7B7>ɼ<EFBFBD>
|
|
|
|
|
void CModifyLinePointDlg::SetCirclingPointRBTNVisible(bool isVisible)
|
|
|
|
|
{
|
|
|
|
|
m_bCirclingPointVisible = isVisible;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//<2F><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CModifyLinePointDlg::CheckedCirclingPoint()
|
|
|
|
|
{
|
|
|
|
|
m_bCheck = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::SetLonLat(double lon,double lat)
|
|
|
|
|
{
|
|
|
|
|
m_gLat = lat;
|
|
|
|
|
m_gLon = lon;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::GetLonLat(double &lon,double &lat, int &pointID)
|
|
|
|
|
{
|
|
|
|
|
lon = m_gLon;
|
|
|
|
|
lat = m_gLat;
|
|
|
|
|
pointID = m_selectedPointID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><>γ<EFBFBD><CEB3>ת<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>
|
|
|
|
|
void CModifyLinePointDlg::getDMSString(double lon,double lat,string &str_lon,string &str_lat)
|
|
|
|
|
{
|
|
|
|
|
int lon_d,lon_m,lat_d,lat_m;
|
|
|
|
|
double lon_s,lat_s;
|
|
|
|
|
angle.DegtoDms(lon,lon_d,lon_m,lon_s);
|
|
|
|
|
angle.DegtoDms(lat,lat_d,lat_m,lat_s);
|
|
|
|
|
|
|
|
|
|
string str_lat_s = angle.DoubleToString(lat_s,4);
|
|
|
|
|
string str_lon_s = angle.DoubleToString(lon_s,4);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
str_lon = angle.IntToString(lon_d) + splitSymbol + angle.IntToString(lon_m) + splitSymbol + str_lon_s;
|
|
|
|
|
str_lat = angle.IntToString(lat_d) + splitSymbol + angle.IntToString(lat_m) + splitSymbol + str_lat_s;*/
|
|
|
|
|
str_lon = angle.IntToString(lon_d) + dSymbol + angle.IntToString(lon_m) + mSymbol + str_lon_s + sSymbol;
|
|
|
|
|
str_lat = angle.IntToString(lat_d) + dSymbol + angle.IntToString(lat_m) + mSymbol + str_lat_s + sSymbol;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double CModifyLinePointDlg::getEditValue(const int ID)
|
|
|
|
|
{
|
|
|
|
|
double value = -200.0;
|
|
|
|
|
CString cstr;
|
|
|
|
|
GetDlgItemText(ID,cstr);
|
|
|
|
|
|
|
|
|
|
int typeID = m_PositionType.GetCurSel();
|
|
|
|
|
|
|
|
|
|
if (typeID==0) //<2F><>
|
|
|
|
|
{
|
|
|
|
|
value = _tstof(cstr);
|
|
|
|
|
}
|
|
|
|
|
else if (typeID==1) //<2F>ȷ<EFBFBD><C8B7><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
vector<string> vec_str = angle.split(cstr.GetBuffer(),splitSymbol);
|
|
|
|
|
|
|
|
|
|
int d = stoi(vec_str.at(0));
|
|
|
|
|
int m = stoi(vec_str.at(1));
|
|
|
|
|
double s = stod(vec_str.at(2));
|
|
|
|
|
angle.DmstoDeg(d,m,s,value);
|
|
|
|
|
}
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CModifyLinePointDlg::IsCirclingPoint()
|
|
|
|
|
{
|
|
|
|
|
return m_bCirclingPoint;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::InitEidtText()
|
|
|
|
|
{
|
|
|
|
|
string str_lon,str_lat;
|
|
|
|
|
if (posTypeID==0) //<2F><>
|
|
|
|
|
{
|
|
|
|
|
str_lon = angle.DoubleToString(m_gLon,7);
|
|
|
|
|
str_lat = angle.DoubleToString(m_gLat,7);
|
|
|
|
|
}
|
|
|
|
|
else if (posTypeID == 1) //<2F>ȷ<EFBFBD><C8B7><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
getDMSString(m_gLon,m_gLat,str_lon,str_lat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD>ʾ<EFBFBD>ľ<EFBFBD>γ<EFBFBD><CEB3>
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,str_lon.c_str());
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,str_lat.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CModifyLinePointDlg::checkLon(string strLon,int type)
|
|
|
|
|
{
|
|
|
|
|
if (type==0) //<2F><>
|
|
|
|
|
{
|
|
|
|
|
string str_match = "^\\-?(\\d{1,2}\\.?\\d*|1[0-7]?\\d{1}\\.?\\d*|180\\.?0*)$";
|
|
|
|
|
regex regexNumber1(str_match);
|
|
|
|
|
return regex_match(strLon,regexNumber1);
|
|
|
|
|
}
|
|
|
|
|
else if (type==1) //<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>,xx;xx;xx.xx
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
string str_match = "^[-]?((\\d|[1-9]\\d|1[0-7]\\d)[;](\\d|[0-5]\\d)[;](\\d|[0-5]\\d)(\\.\\d{1,6})?[;]?$)";
|
|
|
|
|
regex regexNumber1(str_match);
|
|
|
|
|
bool b = regex_match(strLon,regexNumber1);*/
|
|
|
|
|
|
|
|
|
|
wstring str_match = L"^[EW+-]?((\\d|[1-9]\\d|1[0-7]\\d)[s\\-,;<3B><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>](\\d|[0-5]\\d)[s\\-,;/<2F>䡢<EFBFBD><E4A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>](\\d|[0-5]\\d)(\\.\\d{1,})?[s\\-,;/\"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>]?$)";
|
|
|
|
|
wregex regexNumber1(str_match);
|
|
|
|
|
return regex_match(angle.String2WString(strLon),regexNumber1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CModifyLinePointDlg::checkLat(string strLat,int type)
|
|
|
|
|
{
|
|
|
|
|
if (type==0) //<2F><>
|
|
|
|
|
{
|
|
|
|
|
string sm = "^\\-?([0-8]?\\d{1}\\.?\\d*|90\\.?0*)$";
|
|
|
|
|
regex regexNumber(sm);
|
|
|
|
|
return regex_match(strLat,regexNumber);
|
|
|
|
|
}
|
|
|
|
|
else if (type==1) //<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>,xx;xx;xx.xx
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
string sm = "^[-]?((\\d|[1-8]\\d)[;](\\d|[0-5]\\d)[;](\\d|[0-5]\\d)(\\.\\d{1,6})?[;]?$)";
|
|
|
|
|
regex regexNumber(sm);
|
|
|
|
|
return regex_match(strLat,regexNumber);*/
|
|
|
|
|
|
|
|
|
|
wstring str_match2 = L"^[NS+-]?((\\d|[1-8]\\d)[s\\-,;<3B><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>](\\d|[0-5]\\d)[s\\-,;/<2F>䡢<EFBFBD><E4A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>](\\d|[0-5]\\d)(\\.\\d{1,})?[s\\-,;/\"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>]?$)";
|
|
|
|
|
wregex regexNumber2(str_match2);
|
|
|
|
|
return regex_match(angle.String2WString(strLat),regexNumber2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CModifyLinePointDlg <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
BOOL CModifyLinePointDlg::OnInitDialog()
|
|
|
|
|
{
|
|
|
|
|
CBCGPDialog::OnInitDialog();
|
|
|
|
|
|
|
|
|
|
CenterWindow();
|
|
|
|
|
|
|
|
|
|
m_PositionType.AddString(_T("<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
m_PositionType.AddString(_T("<EFBFBD><EFBFBD>"));
|
|
|
|
|
m_PositionType.SetCurSel(0);
|
|
|
|
|
posTypeID = 0;
|
|
|
|
|
lastTypeID = 0;
|
|
|
|
|
m_bCirclingPoint = 0;
|
|
|
|
|
|
|
|
|
|
// <20>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>ȸ衱
|
|
|
|
|
InitEidtText();
|
|
|
|
|
//SetDlgItemText(IDC_EDIT_LON,_T("119.623546"));
|
|
|
|
|
//SetDlgItemText(IDC_EDIT_LAT,_T("32.562147"));
|
|
|
|
|
|
|
|
|
|
GetDlgItem(IDC_SETCIRCLINGPOINT)->ShowWindow(m_bCirclingPointVisible);
|
|
|
|
|
|
|
|
|
|
if (m_bCheck) //<2F><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
((CButton *)GetDlgItem(IDC_SETCIRCLINGPOINT))->SetCheck(true);
|
|
|
|
|
m_bCheck = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString cstr;
|
|
|
|
|
for (int i=0;i<m_editLineDataGroup.pointNum;i++)
|
|
|
|
|
{
|
|
|
|
|
cstr.Format(_T("%d"), i+1);
|
|
|
|
|
m_PointID.InsertString(i,cstr);
|
|
|
|
|
}
|
|
|
|
|
m_PointID.SetCurSel(m_selectedPointID);
|
|
|
|
|
cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID].dX);
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,cstr);
|
|
|
|
|
cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID].dY);
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,cstr);
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::OnCbnSelchangeComboPt()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<CDB8><C4B1>¼<EFBFBD>
|
|
|
|
|
void CModifyLinePointDlg::OnCbnSelchangeComboType()
|
|
|
|
|
{
|
|
|
|
|
CString strLat,strLon;
|
|
|
|
|
m_strLat.GetWindowTextA(strLat);
|
|
|
|
|
m_strLon.GetWindowTextA(strLon);
|
|
|
|
|
|
|
|
|
|
posTypeID = m_PositionType.GetCurSel();
|
|
|
|
|
if (lastTypeID == posTypeID) //<2F><><EFBFBD><EFBFBD>δ<EFBFBD>ı䣬<C4B1><E4A3AC>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>任
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lastTypeID = posTypeID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (posTypeID==0) //<2F><>
|
|
|
|
|
{
|
|
|
|
|
double tarLon,tarLat;
|
|
|
|
|
|
|
|
|
|
vector<string> vec_lat = angle.split(strLat.GetBuffer(),splitSymbol);
|
|
|
|
|
vector<string> vec_lon = angle.split(strLon.GetBuffer(),splitSymbol);
|
|
|
|
|
|
|
|
|
|
int lon_d = stoi(vec_lon.at(0));
|
|
|
|
|
int lon_m = stoi(vec_lon.at(1));
|
|
|
|
|
double lon_s = stod(vec_lon.at(2));
|
|
|
|
|
angle.DmstoDeg(lon_d,lon_m,lon_s,tarLon);
|
|
|
|
|
|
|
|
|
|
int lat_d = stoi(vec_lat.at(0));
|
|
|
|
|
int lat_m = stoi(vec_lat.at(1));
|
|
|
|
|
double lat_s = stod(vec_lat.at(2));
|
|
|
|
|
angle.DmstoDeg(lat_d,lat_m,lat_s,tarLat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,angle.DoubleToString(tarLon).c_str());
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,angle.DoubleToString(tarLat).c_str());
|
|
|
|
|
}
|
|
|
|
|
else if (posTypeID==1) //<2F>ȷ<EFBFBD><C8B7><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
double lat,lon;
|
|
|
|
|
lat = _tstof(strLat);
|
|
|
|
|
lon = _tstof(strLon);
|
|
|
|
|
|
|
|
|
|
string str_lat,str_lon;
|
|
|
|
|
getDMSString(lon,lat,str_lon,str_lat);
|
|
|
|
|
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,str_lon.c_str());
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,str_lat.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ȷ<>ϰ<EFBFBD>ť
|
|
|
|
|
void CModifyLinePointDlg::OnBnClickedOk()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
m_gLon = getEditValue(IDC_EDIT_LON);
|
|
|
|
|
m_gLat = getEditValue(IDC_EDIT_LAT);
|
|
|
|
|
// <20>༭<EFBFBD><E0BCAD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD>ʾ<EFBFBD>ľ<EFBFBD>γ<EFBFBD><CEB3>
|
|
|
|
|
//SetDlgItemText(IDC_EDIT_LON,str_lon.c_str());
|
|
|
|
|
//SetDlgItemText(IDC_EDIT_LAT,str_lat.c_str());
|
|
|
|
|
m_bCirclingPoint = ((CButton *)GetDlgItem(IDC_SETCIRCLINGPOINT))->GetCheck();
|
|
|
|
|
CBCGPDialog::OnOK();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::OnBnClickedCancel()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CBCGPDialog::OnCancel();
|
|
|
|
|
//CBCGPDialog::OnClose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::OnBnClickedSetcirclingpoint()
|
|
|
|
|
{
|
|
|
|
|
if (!m_bCheck)
|
|
|
|
|
{
|
|
|
|
|
((CButton *)GetDlgItem(IDC_SETCIRCLINGPOINT))->SetCheck(true);
|
|
|
|
|
m_bCheck = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
((CButton *)GetDlgItem(IDC_SETCIRCLINGPOINT))->SetCheck(false);
|
|
|
|
|
m_bCheck = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::OnEnKillfocusEditLon()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString cstr;
|
|
|
|
|
GetDlgItemText(IDC_EDIT_LON,cstr);
|
|
|
|
|
int typeID = m_PositionType.GetCurSel();
|
|
|
|
|
|
|
|
|
|
bool b = checkLon(cstr.GetBuffer(),typeID);
|
|
|
|
|
if (!b)
|
|
|
|
|
{
|
|
|
|
|
BCGPMessageBox("<EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
m_strLon.SetFocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::OnEnKillfocusEditLat()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString cstr;
|
|
|
|
|
GetDlgItemText(IDC_EDIT_LAT,cstr);
|
|
|
|
|
int typeID = m_PositionType.GetCurSel();
|
|
|
|
|
|
|
|
|
|
bool b = checkLat(cstr.GetBuffer(),typeID);
|
|
|
|
|
if (!b)
|
|
|
|
|
{
|
|
|
|
|
BCGPMessageBox("γ<EFBFBD>ȷ<EFBFBD>Χ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
m_strLat.SetFocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CModifyLinePointDlg::SetSelectedPointID(int PointID){
|
|
|
|
|
m_selectedPointID = PointID + 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ѡ<><EFBFBD><F1BABDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>仯ʱ<E4BBAF><CAB1><EFBFBD><EFBFBD>
|
|
|
|
|
void CModifyLinePointDlg::OnCbnSelchangeComboPointid()
|
|
|
|
|
{
|
|
|
|
|
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ӿؼ<D3BF>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
m_selectedPointID = m_PointID.GetCurSel() + 1;
|
|
|
|
|
TRACE(_T("<EFBFBD><EFBFBD>ǰѡ<EFBFBD>к<EFBFBD><EFBFBD><EFBFBD>ID: %d \n"),m_selectedPointID);
|
|
|
|
|
//<2F>ľ<DEB8>γ<EFBFBD><CEB3><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
CString cstr;
|
|
|
|
|
if(posTypeID==0){ //<2F><>
|
|
|
|
|
cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dX);
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,cstr);
|
|
|
|
|
cstr.Format(_T("%f"), m_editLineDataGroup.pts[m_selectedPointID-1].dY);
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,cstr);
|
|
|
|
|
}
|
|
|
|
|
else if(posTypeID==1){ // <20>ȷ<EFBFBD><C8B7><EFBFBD>
|
|
|
|
|
string str_lon, str_lat;
|
|
|
|
|
getDMSString(m_editLineDataGroup.pts[m_selectedPointID-1].dX, m_editLineDataGroup.pts[m_selectedPointID-1].dY,str_lon, str_lat);
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LON,str_lon.c_str());
|
|
|
|
|
SetDlgItemText(IDC_EDIT_LAT,str_lat.c_str());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|