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

📄 lcdprocsettings.cpp

📁 Powerful and Portable GPS application -- support Linux, Windows, Windows CE GPS navigation and Map m
💻 CPP
字号:
/* *  Roadnav *  LCDprocSettings.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 various classes used to represent the LCDproc related/// settings./////////////////////////////////////////////////////////////////////////////////#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 "LCDprocSettings.h"using namespace std;//////////////////////////////////////////////////////////////////////////////////// \brief Constructor for LCDprocWidgetInfo - Initialize variables to some/// default values./////////////////////////////////////////////////////////////////////////////////LCDprocWidgetInfo::LCDprocWidgetInfo(){	m_iRow = -1;	m_iCol = -1;}//////////////////////////////////////////////////////////////////////////////////// \brief Read the settings for this object from the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocWidgetInfo::Read(){	g_pConfig->Read(wxT("Row"), &m_iRow, 1);	g_pConfig->Read(wxT("Column"), &m_iCol, 1);	g_pConfig->Read(wxT("Type"), &m_strType, wxT("Text"));	g_pConfig->Read(wxT("Value"), &m_strValue, wxT(""));}//////////////////////////////////////////////////////////////////////////////////// \brief Write the settings in this object to the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocWidgetInfo::Write(){	g_pConfig->Write(wxT("Row"), m_iRow);	g_pConfig->Write(wxT("Column"), m_iCol);	g_pConfig->Write(wxT("Type"), m_strType);	g_pConfig->Write(wxT("Value"), m_strValue);}///////////////////////////////////////////////////////////////////////////////****************************************************************************/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// \brief Constructor for LCDprocScreenInfo - Initialize variables to/// some default values./////////////////////////////////////////////////////////////////////////////////LCDprocScreenInfo::LCDprocScreenInfo(){}//////////////////////////////////////////////////////////////////////////////////// \brief Read the settings for this object from the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocScreenInfo::Read(){	unsigned int iWidget;		g_pConfig->Read(wxT("Name"), &m_strName);		for (iWidget = 0; g_pConfig->Exists(wxString::Format(wxT("Widget%d"), iWidget)); iWidget++)	{		LCDprocWidgetInfo cWidgetInfo;				g_pConfig->SetPath(wxString::Format(wxT("Widget%d"), iWidget));				cWidgetInfo.Read();		m_vWidgets.push_back(cWidgetInfo);				g_pConfig->SetPath(wxT(".."));	}}//////////////////////////////////////////////////////////////////////////////////// \brief Write the settings in this object to the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocScreenInfo::Write(){	unsigned int iWidget;		g_pConfig->Write(wxT("Name"), m_strName);	for (iWidget = 0; iWidget < m_vWidgets.size(); iWidget++)	{		g_pConfig->SetPath(wxString::Format(wxT("Widget%d"), iWidget));				m_vWidgets[iWidget].Write();				g_pConfig->SetPath(wxT(".."));	}}///////////////////////////////////////////////////////////////////////////////****************************************************************************/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// \brief Constructor for LCDprocSettings - Initialize variables to/// some default values./////////////////////////////////////////////////////////////////////////////////LCDprocSettings::LCDprocSettings(){	m_bLCDprocEnabled = false;}//////////////////////////////////////////////////////////////////////////////////// \brief Read the settings for this object from the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocSettings::Read(){	unsigned int iScreen;		g_pConfig->Read(wxT("Enabled"), &m_bLCDprocEnabled);	g_pConfig->Read(wxT("HostAndPort"), &m_strHostAndPort, wxT("localhost:13666"));		for (iScreen = 0; g_pConfig->Exists(wxString::Format(wxT("Screen%d"), iScreen)); iScreen++)	{		LCDprocScreenInfo cScreenInfo;				g_pConfig->SetPath(wxString::Format(wxT("Screen%d"), iScreen));				cScreenInfo.Read();		m_vScreens.push_back(cScreenInfo);				g_pConfig->SetPath(wxT(".."));	}}//////////////////////////////////////////////////////////////////////////////////// \brief Write the settings in this object to the registry./////////////////////////////////////////////////////////////////////////////////void LCDprocSettings::Write(){	unsigned int iScreen;		g_pConfig->Read(wxT("Enabled"), m_bLCDprocEnabled);	g_pConfig->Read(wxT("HostAndPort"), m_strHostAndPort);	for (iScreen = 0; iScreen < m_vScreens.size(); iScreen++)	{		g_pConfig->SetPath(wxString::Format(wxT("Screen%d"), iScreen));				m_vScreens[iScreen].Write();				g_pConfig->SetPath(wxT(".."));	}}

⌨️ 快捷键说明

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