⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 preferencespageunits.cpp

📁 Powerful and Portable GPS application -- support Linux, Windows, Windows CE GPS navigation and Map m
💻 CPP
字号:
/* *  Roadnav *  PreferencesPageUnits.cpp * *  Copyright (c) 2004 - 2007 Richard L. Lynch <rllynch@users.sourceforge.net> * *  This program is free software; you can redistribute it and/or *  modify it under the terms of version 2 of the GNU General Public License *  as published by the Free Software Foundation. * *  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *////////////////////////////////////////////////////////////////////////////////// \file////// Contains the Units page of the preferences dialog box./////////////////////////////////////////////////////////////////////////////////#ifdef HAVE_CONFIG_H#  include <config.h>#endif#ifdef _MSC_VER#pragma warning(disable: 4786)#pragma warning(disable: 4800)#endif#include <wx/wx.h>#include "App.h"#include "PreferencesPageUnits.h"#include "libroadnav/MapRepresentations.h"BEGIN_EVENT_TABLE(PreferencesPageUnits, wxPanel)END_EVENT_TABLE()//////////////////////////////////////////////////////////////////////////////////// \brief PreferencesPageUnits constructor - create and initialize controls/////////////////////////////////////////////////////////////////////////////////PreferencesPageUnits::PreferencesPageUnits(wxWindow *parent)             : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL){	wxBoxSizer * psizerWnd;	wxFlexGridSizer * psizerGrid;	int iSel;	wxString strSel;		psizerGrid = new wxFlexGridSizer(2, 5, 10);		//////////////////////////////////////////////////////////////////////////	// Position Format label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Position Format")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Postion Format selection	//////////////////////////////////////////////////////////////////////////	m_pctlPositionFormat = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxSize(200, -1), 0, NULL, wxCB_READONLY);	m_pctlPositionFormat->Append(POSITION_FORMAT_1);	m_pctlPositionFormat->Append(POSITION_FORMAT_2);	m_pctlPositionFormat->Append(POSITION_FORMAT_3);	g_pConfig->Read(wxT("PositionFormat"), &strSel, POSITION_FORMAT_3);	iSel = m_pctlPositionFormat->FindString(strSel);	if (iSel >= 0)		m_pctlPositionFormat->SetSelection(iSel);	else		m_pctlPositionFormat->SetSelection(0);   // add to the sizer	psizerGrid->Add(m_pctlPositionFormat,				0,				wxGROW,				0	);		//////////////////////////////////////////////////////////////////////////	// Units section	//////////////////////////////////////////////////////////////////////////	wxString strUnits[] = {wxString(wxT("US (English)")),wxString(wxT("SI (metric)")) };	m_pctlUnits = new wxRadioBox(this,-1,wxT("Units"),wxDefaultPosition,wxDefaultSize,2,strUnits,1);	long units;	g_pConfig->Read(wxT("Units"),&units,0);	m_pctlUnits->SetSelection(units);	wxBoxSizer* sizerUnits = new wxBoxSizer(wxHORIZONTAL);	sizerUnits->Add(m_pctlUnits,1,wxGROW,0);			//////////////////////////////////////////////////////////////////////////	// psizerWnd just adds a border to psizerGrid	//////////////////////////////////////////////////////////////////////////		psizerWnd = new wxBoxSizer(wxVERTICAL);	psizerWnd->Add(psizerGrid,0,wxALL | wxGROW, 10);	psizerWnd->Add(sizerUnits,0,wxALL | wxGROW, 10);		//////////////////////////////////////////////////////////////////////////	// Set up the sizer	//////////////////////////////////////////////////////////////////////////	m_pctlPositionFormat->SetFocus();	psizerWnd->Fit(this);	SetSizer(psizerWnd);	Layout();	psizerWnd->SetSizeHints(this);	}//////////////////////////////////////////////////////////////////////////////////// \brief Ok was pressed .. save the settings/////////////////////////////////////////////////////////////////////////////////void PreferencesPageUnits::OnOk(wxCommandEvent& event){	g_pConfig->Write(wxT("PositionFormat"), m_pctlPositionFormat->GetValue());	g_pConfig->Write(wxT("Units"),m_pctlUnits->GetSelection());}

⌨️ 快捷键说明

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