📄 dlgsettings.cpp
字号:
//////////////////////////////////////////////////////
//
// NRDB Pro - Spatial database and mapping application
//
// Copyright (c) 1989-2004 Richard D. Alexander
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// NRDB Pro is part of the Natural Resources Database Project
//
// Homepage: http://www.nrdb.co.uk/
// Users' Forum: http://nrdb.mypalawan.info/
//
#include "stdafx.h"
#include "nrdb.h"
#include "DlgSettings.h"
#include "docmap.h"
#include "viewmap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgSettings dialog
CDlgSettings::CDlgSettings(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSettings::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSettings)
//}}AFX_DATA_INIT
}
void CDlgSettings::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSettings)
DDX_Control(pDX, IDC_COORDASLATLON, m_ckCoordAsLatLon);
DDX_Control(pDX, IDC_TELEPHONE, m_eTelephone);
DDX_Control(pDX, IDC_PROVINCE, m_eProvince);
DDX_Control(pDX, IDC_ORGANIZATION, m_eOrganization);
DDX_Control(pDX, IDC_LOGO, m_eLogo);
DDX_Control(pDX, IDC_FAX, m_eFax);
DDX_Control(pDX, IDC_EMAIL, m_eEmail);
DDX_Control(pDX, IDC_COUNTRY, m_eCountry);
DDX_Control(pDX, IDC_CITY, m_eCity);
DDX_Control(pDX, IDC_ADDRESS, m_eAddress);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgSettings, CDialog)
//{{AFX_MSG_MAP(CDlgSettings)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSettings message handlers
BOOL CDlgSettings::OnInitDialog()
{
CDialog::OnInitDialog();
if (BDMain(BDHandle(), &m_main, BDGETINIT))
{
m_eOrganization.SetWindowText(m_main.m_Organization);
m_eAddress.SetWindowText(m_main.m_Address);
m_eCity.SetWindowText(m_main.m_City);
m_eProvince.SetWindowText(m_main.m_Province);
m_eCountry.SetWindowText(m_main.m_Country);
m_eTelephone.SetWindowText(m_main.m_Telephone);
m_eFax.SetWindowText(m_main.m_Fax);
m_eEmail.SetWindowText(m_main.m_Email);
m_eLogo.SetWindowText(m_main.m_Logo);
m_ckCoordAsLatLon.SetCheck(m_main.m_bCoordAsLatLon);
}
m_eTelephone.SetLimitText(50);
m_eProvince.SetLimitText(50);
m_eOrganization.SetLimitText(50);
m_eLogo.SetLimitText(50);
m_eFax.SetLimitText(50);
m_eEmail.SetLimitText(50);
m_eCountry.SetLimitText(50);
m_eCity.SetLimitText(50);
m_eAddress.SetLimitText(50);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
/////////////////////////////////////////////////////////////////////////////
void CDlgSettings::OnBrowse()
{
CString sType = BDString(IDS_JPGFILE) + "|*.jpg|" +
BDString(IDS_PNGFILE) + "|*.png|";
CFileDialog dlg(TRUE,"jpg",NULL,OFN_FILEMUSTEXIST, sType += "|");
if (dlg.DoModal() == IDOK)
{
m_eLogo.SetWindowText(dlg.GetPathName());
}
}
/////////////////////////////////////////////////////////////////////////////
void CDlgSettings::OnOK()
{
m_eOrganization.GetWindowText(m_main.m_Organization);
m_eAddress.GetWindowText(m_main.m_Address);
m_eCity.GetWindowText(m_main.m_City);
m_eProvince.GetWindowText(m_main.m_Province);
m_eCountry.GetWindowText(m_main.m_Country);
m_eTelephone.GetWindowText(m_main.m_Telephone);
m_eFax.GetWindowText(m_main.m_Fax);
m_eEmail.GetWindowText(m_main.m_Email);
m_eLogo.GetWindowText(m_main.m_Logo);
m_main.m_bCoordAsLatLon =m_ckCoordAsLatLon.GetCheck();
if (BDMain(BDHandle(), &m_main, BDUPDATE))
{
CDocMap* pDocMap = BDGetDocMap();
if (pDocMap != NULL)
{
pDocMap->GetViewMap()->InitialiseMapView();
pDocMap->GetViewMap()->Redraw();
}
CDialog::OnOK();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -