📄 preferencespageurls.cpp
字号:
/* * Roadnav * PreferencesPageURLs.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 URLs 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 "PreferencesPageURLs.h"#include "libroadnav/URLs.h"using namespace std;//////////////////////////////////////////////////////////////////////////////////// PreferencesPageGeneral event table/////////////////////////////////////////////////////////////////////////////////BEGIN_EVENT_TABLE(PreferencesPageURLs, wxPanel)END_EVENT_TABLE()//////////////////////////////////////////////////////////////////////////////////// \brief PreferencesPageURLs constructor - create controls and initialize them/////////////////////////////////////////////////////////////////////////////////PreferencesPageURLs::PreferencesPageURLs(wxWindow *parent) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL){ wxBoxSizer * psizerWnd; wxFlexGridSizer * psizerGrid; int i; psizerGrid = new wxFlexGridSizer(2, 5, 10); for (i = 0; GetURLName(i) != wxT(""); i++) { ////////////////////////////////////////////////////////////////////////// // Label ////////////////////////////////////////////////////////////////////////// psizerGrid->Add( new wxStaticText(this, -1, GetURLName(i)), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT, 0 ); ////////////////////////////////////////////////////////////////////////// // Entry ////////////////////////////////////////////////////////////////////////// m_pctlEntries.push_back(new wxTextCtrl(this, -1, GetURL(GetURLName(i)), wxDefaultPosition, wxSize(250, -1))); psizerGrid->Add( m_pctlEntries.back(), 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_pctlEntries.front()->SetFocus(); psizerWnd->Fit(this); SetSizer(psizerWnd); Layout(); psizerWnd->SetSizeHints(this); }//////////////////////////////////////////////////////////////////////////////////// \brief Ok was pressed .. save the settings/////////////////////////////////////////////////////////////////////////////////void PreferencesPageURLs::OnOk(wxCommandEvent& event){ unsigned int i; for (i = 0; i < m_pctlEntries.size(); i++) { wxString strName; wxString strValue; strName = GetURLName(i); strValue = m_pctlEntries[i]->GetValue(); SetURL(strName, strValue); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -