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

📄 preferencespagegeneral.cpp

📁 Powerful and Portable GPS application -- support Linux, Windows, Windows CE GPS navigation and Map m
💻 CPP
📖 第 1 页 / 共 2 页
字号:
		0,		wxALIGN_LEFT,		0	);		//////////////////////////////////////////////////////////////////////////	// Speed Controlled Zooming Cutoffs Label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Speed Controlled Zooming Cutoffs (mph)")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Speed Controlled Zooming Cutoffs Entry	//////////////////////////////////////////////////////////////////////////	wxString strSpeedControlledCutoffs;	g_pConfig->Read(wxT("SpeedControlledDetailLevelCutoffs"), &strSpeedControlledCutoffs, wxT("25, 50"));	m_pctlSpeedControlledCutoffs = new wxTextCtrl(this, -1, strSpeedControlledCutoffs, wxDefaultPosition, wxSize(250, -1));	psizerGrid->Add(		m_pctlSpeedControlledCutoffs,		0,		wxALIGN_LEFT,		0	);		//////////////////////////////////////////////////////////////////////////	// Home zip code label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Home Zip Code")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Home zip code	//////////////////////////////////////////////////////////////////////////   int zipHome;	g_pConfig->Read(wxT("HomeZipCode"), &zipHome, 0);	m_pctlHomeZip = new wxTextCtrl(this, -1, wxString::Format(wxT("%05d"), zipHome), wxDefaultPosition, wxSize(250, -1));	psizerGrid->Add(		m_pctlHomeZip,		0,		wxALIGN_LEFT,		0	);	//////////////////////////////////////////////////////////////////////////	// Enable exit command label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Enable Exit Command")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Enable exit command checkbox	//////////////////////////////////////////////////////////////////////////	m_pctlEnableExitCommand = new wxCheckBox(this, idEnableExitCommand, wxT(""));	m_pctlEnableExitCommand->SetValue(g_pConfig->Read(wxT("EnableExitCommand"), (long) 0));	psizerGrid->Add(		m_pctlEnableExitCommand,		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT,		0	);		//////////////////////////////////////////////////////////////////////////	// Exit command label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Exit Command")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Exit command itself	//////////////////////////////////////////////////////////////////////////	m_pctlExitCommand = new wxTextCtrl(this, -1, g_pConfig->Read(wxT("ExitCommand"), GetDefaultShutdownCommand()), wxDefaultPosition, wxSize(250, -1));	psizerGrid->Add(		m_pctlExitCommand,		0,		wxALIGN_LEFT,		0	);	wxCommandEvent ev;	OnCheckEnableExitCommand(ev);		//////////////////////////////////////////////////////////////////////////	// Always use advanced waypoint dialog box	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Always Use Advanced Waypoint Dialog Box")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Generate debug log checkbox	//////////////////////////////////////////////////////////////////////////	m_pctlAlwaysUseAdvancedWaypointsDialogBox = new wxCheckBox(this, -1, wxT(""));	m_pctlAlwaysUseAdvancedWaypointsDialogBox->SetValue(g_pConfig->Read(wxT("AlwaysUseAdvancedWaypointsDialog"), (long) 0));	psizerGrid->Add(		m_pctlAlwaysUseAdvancedWaypointsDialogBox,		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT,		0	);	#ifdef LIBROADNAV_DEBUG	//////////////////////////////////////////////////////////////////////////	// Generate debug log label	//////////////////////////////////////////////////////////////////////////	psizerGrid->Add(		new wxStaticText(this, -1, wxT("Generate debug log")),		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT,		0	);		//////////////////////////////////////////////////////////////////////////	// Generate debug log checkbox	//////////////////////////////////////////////////////////////////////////	m_pctlGenerateDebugLog = new wxCheckBox(this, -1, wxT(""));	m_pctlGenerateDebugLog->SetValue(g_pConfig->Read(wxT("GenerateDebugLog"), (long) 0));	psizerGrid->Add(		m_pctlGenerateDebugLog,		0,		wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT,		0	);	#endif		//////////////////////////////////////////////////////////////////////////	// Clear cache button	//////////////////////////////////////////////////////////////////////////	wxButton * pctlClearCache = new wxButton(this, idClearCache, wxT("Clear Cache"));	psizerGrid->Add(		pctlClearCache,		0,		wxALIGN_RIGHT,		0	);	//////////////////////////////////////////////////////////////////////////	// Clear maps button	//////////////////////////////////////////////////////////////////////////	wxButton * pctlClearMaps = new wxButton(this, idClearMaps, wxT("Clear Map Data"));	psizerGrid->Add(		pctlClearMaps,		0,		wxALIGN_LEFT,		0	);	//////////////////////////////////////////////////////////////////////////	// psizerWnd just adds a border to psizerGrid	//////////////////////////////////////////////////////////////////////////		psizerWnd = new wxBoxSizer(wxVERTICAL);	psizerWnd->Add(		psizerGrid,		0,		wxALL | wxGROW,		10	);		//////////////////////////////////////////////////////////////////////////	// Set up the sizer	//////////////////////////////////////////////////////////////////////////	m_pctlAutoDownloadMaps->SetFocus();	psizerWnd->Fit(this);	SetSizer(psizerWnd);	Layout();	psizerWnd->SetSizeHints(this);	}///////////////////////////////////////////////////////////////////////////////// /// \brief Clear cache button pressed - warn the user, then clear the cache./////////////////////////////////////////////////////////////////////////////////void PreferencesPageGeneral::OnClearCache(wxCommandEvent& event){	if (wxMessageBox(wxT("This will erase all cached downloads. It will not affect the data used to draw the maps. Are you sure you want to continue?"), wxT("Confirm"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this) == wxYES)	{		ClearDownloadCache();		wxMessageBox(wxT("Cache cleared."), wxT("Information"), wxOK | wxICON_INFORMATION, this);	}}///////////////////////////////////////////////////////////////////////////////// /// \brief Clear maps button pressed - warn user, then do wipe out compiled maps./////////////////////////////////////////////////////////////////////////////////void PreferencesPageGeneral::OnClearMaps(wxCommandEvent& event){	if (wxMessageBox(wxT("This will erase all compiled map data. It is recommended you restart Roadnav after performing this operation. Are you sure you want to continue?"), wxT("Confirm"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this) == wxYES)	{		ClearCompiledMapData();		wxMessageBox(wxT("Map data cleared. Please restart Roadnav."), wxT("Information"), wxOK | wxICON_INFORMATION, this);	}}//////////////////////////////////////////////////////////////////////////////////// \brief Ok was pressed .. save the settings/////////////////////////////////////////////////////////////////////////////////void PreferencesPageGeneral::OnOk(wxCommandEvent& event){	g_pConfig->Write(wxT("AutoDownloadMaps"), m_pctlAutoDownloadMaps->GetValue());	g_pConfig->Write(wxT("CacheDownloads"), m_pctlCacheDownloads->GetValue());	g_pConfig->Write(wxT("AntiAliasedMaps"), m_pctlAntiAliasedMaps->GetValue());	g_pConfig->Write(wxT("SkinPath-Day"), m_pctlSkinPathDay->GetValue());	g_pConfig->Write(wxT("SkinPath-Night"), m_pctlSkinPathNight->GetValue());	g_pConfig->Write(wxT("ProxyHost"), m_pctlProxyHost->GetValue());	g_pConfig->Write(wxT("SpeedControlledDetailLevelCutoffs"), m_pctlSpeedControlledCutoffs->GetValue());	g_pConfig->Write(wxT("EnableExitCommand"), m_pctlEnableExitCommand->GetValue());	g_pConfig->Write(wxT("ExitCommand"), m_pctlExitCommand->GetValue());	g_pConfig->Write(wxT("AlwaysUseAdvancedWaypointsDialog"), m_pctlAlwaysUseAdvancedWaypointsDialogBox->GetValue());#ifdef LIBROADNAV_DEBUG	long lPreviousDebugSetting = g_pConfig->Read(wxT("GenerateDebugLog"), (long) 0);	long lNewDebugSetting = m_pctlGenerateDebugLog->GetValue();	g_pConfig->Write(wxT("GenerateDebugLog"), lNewDebugSetting);		if (lNewDebugSetting && !lPreviousDebugSetting)	{		wxMessageBox(wxString::Format(wxT("Debugging is now enabled. Debug messages will be written to %s."), LibRoadnavDebugGetFilename().c_str()),						wxT("Information"),						wxOK | wxICON_INFORMATION, 						this);	}	if (!lNewDebugSetting && lPreviousDebugSetting)	{		wxMessageBox(wxT("Debugging will be disabled the next time you start Roadnav."),						wxT("Information"),						wxOK | wxICON_INFORMATION, 						this);	}#endif	long lPort = 0;	m_pctlProxyPort->GetValue().ToLong(&lPort);	g_pConfig->Write(wxT("ProxyPort"), lPort);	double fDrawingScaleFactor = 1;	m_pctlZoomMaps->GetValue().ToDouble(&fDrawingScaleFactor);	if (fDrawingScaleFactor < 1e-5)		fDrawingScaleFactor = 1e-5;	if (fDrawingScaleFactor > 10)		fDrawingScaleFactor = 10;	g_pConfig->Write(wxT("DrawingScaleFactor"), fDrawingScaleFactor);   long lHomeZip;   m_pctlHomeZip->GetValue().ToLong(&lHomeZip);   g_pConfig->Write(wxT("HomeZipCode"), lHomeZip);}//////////////////////////////////////////////////////////////////////////////////// \brief Enable shutdown command was checked/unchecked/////////////////////////////////////////////////////////////////////////////////void PreferencesPageGeneral::OnCheckEnableExitCommand(wxCommandEvent & event){	m_pctlExitCommand->Enable(m_pctlEnableExitCommand->GetValue());}

⌨️ 快捷键说明

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