📄 preferencespagelcdproc.cpp
字号:
/* * Roadnav * PreferencesPageLCDproc.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 LCDproc 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 "PreferencesPageLCDproc.h"#include "LCDprocInterface.h"using namespace std;enum{ idAdd, idUpdate, idDelete, idScreenSelection, idWidgetList};BEGIN_EVENT_TABLE(PreferencesPageLCDproc, wxPanel) EVT_COMBOBOX(idScreenSelection, PreferencesPageLCDproc::OnScreenSelection) EVT_TEXT(idScreenSelection, PreferencesPageLCDproc::OnScreenSelection) EVT_LISTBOX(idWidgetList, PreferencesPageLCDproc::OnWidgetSelection) EVT_BUTTON(idAdd, PreferencesPageLCDproc::OnWidgetAdd) EVT_BUTTON(idUpdate, PreferencesPageLCDproc::OnWidgetUpdate) EVT_BUTTON(idDelete, PreferencesPageLCDproc::OnWidgetDelete)END_EVENT_TABLE()//////////////////////////////////////////////////////////////////////////////////// \brief PreferencesPageLCDproc constructor - create and initialize controls/////////////////////////////////////////////////////////////////////////////////PreferencesPageLCDproc::PreferencesPageLCDproc(wxWindow *parent) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL){ wxFlexGridSizer * psizerWnd; wxFlexGridSizer * psizerTop; wxStaticBoxSizer * psizerBottom; wxFlexGridSizer * psizerWidgetList; wxFlexGridSizer * psizerWidgetSettings; wxFlexGridSizer * psizerRowCol; wxBoxSizer * psizerWidgetListActions; wxString strTmp; unsigned int iVariable; vector<wxString> vVariables; vVariables = GetLCDprocVariableNames(); m_cActiveSettings = GetLCDprocSettings(); psizerTop = new wxFlexGridSizer(2, 3, 10); ////////////////////////////////////////////////////////////////////////// // "Enable LCDproc Support" label ////////////////////////////////////////////////////////////////////////// psizerTop->Add( new wxStaticText(this, -1, wxT("Enable LCDproc Support")), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT, 0 ); ////////////////////////////////////////////////////////////////////////// // "Enable LCDproc Support" check box ////////////////////////////////////////////////////////////////////////// m_pctlEnableLCDproc = new wxCheckBox(this, -1, wxT("")); m_pctlEnableLCDproc->SetValue(m_cActiveSettings.m_bLCDprocEnabled); psizerTop->Add( m_pctlEnableLCDproc, 0, wxALIGN_LEFT, 0 ); ////////////////////////////////////////////////////////////////////////// // "Host and Port" label ////////////////////////////////////////////////////////////////////////// psizerTop->Add( new wxStaticText(this, -1, wxT("Host and Port")), 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT, 0 ); ////////////////////////////////////////////////////////////////////////// // "Host and Port" text control ////////////////////////////////////////////////////////////////////////// m_pctlHostAndPort = new wxTextCtrl(this, -1, m_cActiveSettings.m_strHostAndPort, wxDefaultPosition, wxSize(250, -1)); psizerTop->Add( m_pctlHostAndPort, 1, wxALIGN_LEFT, 0 ); ////////////////////////////////////////////////////////////////////////// // "Screen Selection" label ////////////////////////////////////////////////////////////////////////// psizerTop->Add( new wxStaticText(this, -1, wxT("Screen Selection")), 1, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT, 0 ); ////////////////////////////////////////////////////////////////////////// // "Screen Selection" check box ////////////////////////////////////////////////////////////////////////// m_pctlScreenSelection = new wxComboBox(this, idScreenSelection, wxT(""), wxDefaultPosition, wxSize(250, -1), 0, NULL, wxCB_DROPDOWN); psizerTop->Add( m_pctlScreenSelection, 1, wxALIGN_LEFT, 0 ); ////////////////////////////////////////////////////////////////////////// // Bottom half of the screen ////////////////////////////////////////////////////////////////////////// psizerBottom = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Screen Settings")); psizerWidgetSettings = new wxFlexGridSizer(1, 0, 10); ////////////////////////////////////////////////////////////////////////// // "Type" label ////////////////////////////////////////////////////////////////////////// psizerWidgetSettings->Add( new wxStaticText(this, -1, wxT("Widget Type")), 1, wxALIGN_CENTER, 0 ); ////////////////////////////////////////////////////////////////////////// // "Type" combo box ////////////////////////////////////////////////////////////////////////// m_pctlWidgetType = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY); m_pctlWidgetType->Append(wxT("Text")); m_pctlWidgetType->Append(wxT("Title")); m_pctlWidgetType->Append(wxT("Horizontal Bar")); m_pctlWidgetType->Append(wxT("Vertical Bar")); m_pctlWidgetType->SetValue(wxT("Text")); psizerWidgetSettings->Add( m_pctlWidgetType, 1, wxALIGN_LEFT, 0 ); ////////////////////////////////////////////////////////////////////////// // Row/Column selection ////////////////////////////////////////////////////////////////////////// psizerRowCol = new wxFlexGridSizer(2, 2, 10); ////////////////////////////////////////////////////////////////////////// // "Row" label ////////////////////////////////////////////////////////////////////////// psizerRowCol->Add( new wxStaticText(this, -1, wxT("Row")), 1, wxALIGN_CENTER, 0 ); ////////////////////////////////////////////////////////////////////////// // "Column" label ////////////////////////////////////////////////////////////////////////// psizerRowCol->Add( new wxStaticText(this, -1, wxT("Column")), 1, wxALIGN_CENTER, 0 ); ////////////////////////////////////////////////////////////////////////// // "Row" text control ////////////////////////////////////////////////////////////////////////// m_pctlWidgetRow = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(75, -1)); psizerRowCol->Add( m_pctlWidgetRow, 1, wxALIGN_LEFT | wxGROW, 0 ); ////////////////////////////////////////////////////////////////////////// // "Column" text control ////////////////////////////////////////////////////////////////////////// m_pctlWidgetColumn = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(75, -1)); psizerRowCol->Add( m_pctlWidgetColumn, 1, wxALIGN_LEFT | wxGROW, 0 ); psizerWidgetSettings->Add(psizerRowCol, 1, wxALL | wxGROW, 0); ////////////////////////////////////////////////////////////////////////// // "Contents" label ////////////////////////////////////////////////////////////////////////// psizerWidgetSettings->Add( new wxStaticText(this, -1, wxT("Widget Contents")), 1, wxALIGN_CENTER, 0 ); ////////////////////////////////////////////////////////////////////////// // "Contents" combo box ////////////////////////////////////////////////////////////////////////// m_pctlWidgetContents = new wxComboBox(this, -1, wxT(""), wxDefaultPosition, wxSize(150, -1), 0, NULL, 0); psizerWidgetSettings->Add( m_pctlWidgetContents, 1, wxALIGN_LEFT, 0 ); for (iVariable = 0; iVariable < vVariables.size(); iVariable++) m_pctlWidgetContents->Append(vVariables[iVariable]); psizerWidgetList = new wxFlexGridSizer(2, 2, 10); ////////////////////////////////////////////////////////////////////////// // "Widgets" label //////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -