KiCad PCB EDA Suite
pl_editor_config.cpp
Go to the documentation of this file.
1 
6 /*
7  * This program source code file is part of KiCad, a free EDA CAD application.
8  *
9  * Copyright (C) 2013 CERN
10  * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <fctsys.h>
31 #include <common.h>
32 #include <class_drawpanel.h>
33 #include <gestfich.h>
34 #include <config_params.h>
35 
36 #include <pl_editor_frame.h>
37 #include <hotkeys.h>
38 #include <panel_hotkeys_editor.h>
39 #include <pl_editor_id.h>
40 
41 #define GROUP wxT("/pl_editor")
42 
43 
44 void PL_EDITOR_FRAME::Process_Config( wxCommandEvent& event )
45 {
46  int id = event.GetId();
47 
48  switch( id )
49  {
51  if( GetDrawBgColor() == WHITE )
53  else
55 
56  GetMenuBar()->SetLabel( ID_MENU_SWITCH_BGCOLOR,
57  GetDrawBgColor() == WHITE ? _( "&Background Black" ) : _( "&Background White" ) );
58  m_canvas->Refresh();
59  break;
60 
61  case ID_MENU_GRID_ONOFF:
63  GetMenuBar()->SetLabel( ID_MENU_GRID_ONOFF,
64  IsGridVisible() ? _( "Hide &Grid" ) : _( "Show &Grid" ) );
65  m_canvas->Refresh();
66  break;
67 
68  case wxID_PREFERENCES:
70  break;
71 
74  break;
75 
76  default:
77  wxMessageBox( wxT( "PL_EDITOR_FRAME::Process_Config error" ) );
78  break;
79  }
80 }
81 
82 
84 {
85  if( !m_configSettings.empty() )
86  return m_configSettings;
87 
88  // Add settings here....
89 
90  return m_configSettings;
91 }
A list of parameters type.
PARAM_CFG_ARRAY m_configSettings
This file is part of the common library TODO brief description.
virtual void SetDrawBgColor(COLOR4D aColor)
Definition: draw_frame.h:380
The common library.
virtual bool IsGridVisible() const
Definition: draw_frame.h:528
PARAM_CFG_ARRAY & GetConfigurationSettings(void)
Populates the applicatios settings list.
void Process_Config(wxCommandEvent &event)
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
virtual COLOR4D GetDrawBgColor() const
Definition: draw_frame.h:375
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:123
struct EDA_HOTKEY_CONFIG PlEditorHokeysDescr[]
The common library.
Definition: colors.h:49
virtual void SetGridVisibility(bool aVisible)
It may be overloaded by derived classes.
Definition: draw_frame.h:537
bool ShowPreferences(EDA_HOTKEY_CONFIG *aHotkeys, EDA_HOTKEY_CONFIG *aShowHotkeys, const wxString &aHotkeysNickname)
Definition: colors.h:45
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)