KiCad PCB EDA Suite
dialog_hotkeys_editor.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 1992-2018 Kicad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <dialog_hotkeys_editor.h>
25 
27 {
28  HOTKEYS_EDITOR_DIALOG dialog( aParent, aHotkeys );
29 
30  int diag = dialog.ShowModal();
31 
32  if( diag == wxID_OK )
33  {
34  aParent->ReCreateMenuBar();
35  aParent->Refresh();
36  }
37 }
38 
39 
41  EDA_HOTKEY_CONFIG* aHotkeys ) :
42  HOTKEYS_EDITOR_DIALOG_BASE( aParent ),
43  m_hotkeys( aHotkeys )
44 {
46  WIDGET_HOTKEY_LIST::GenSections( aHotkeys ) );
48 
49  m_sdbSizerOK->SetDefault();
50 
51  Layout();
52  SetSizeInDU( 350, 300 );
53  Center();
54 }
55 
56 
58 {
59  if( !wxDialog::TransferDataToWindow() )
60  return false;
61 
63  return false;
64 
65  return true;
66 }
67 
68 
70 {
71  if( !wxDialog::TransferDataToWindow() )
72  return false;
73 
75  return false;
76 
77  // save the hotkeys
79 
80  return true;
81 }
82 
83 
84 void HOTKEYS_EDITOR_DIALOG::ResetClicked( wxCommandEvent& aEvent )
85 {
87 }
88 
89 void HOTKEYS_EDITOR_DIALOG::DefaultsClicked( wxCommandEvent& aEvent )
90 {
92 }
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:87
bool TransferDataToControl()
Method TransferDataToControl Load the hotkey data into the control.
void DefaultsClicked(wxCommandEvent &aEvent) override
Function DefaultsClicked Set the hotkeys to the default values (values after installation) ...
WIDGET_HOTKEY_LIST * m_hotkeyListCtrl
static HOTKEY_SECTIONS GenSections(EDA_HOTKEY_CONFIG *aHotkeys)
Static method GenSections Generate a list of sections and names from an EDA_HOTKEY_CONFIG*.
void InstallOnPanel(wxPanel *aPanel)
Method InstallOnPanel Install this WIDGET_HOTKEY_LIST onto an empty panel.
Class HOTKEYS_EDITOR_DIALOG_BASE.
Class HOTKEYS_EDITOR_DIALOG is the child class of HOTKEYS_EDITOR_DIALOG_BASE.
void SetSizeInDU(int x, int y)
Set the dialog to the given dimensions in "dialog units".
void InstallHotkeyFrame(EDA_BASE_FRAME *aParent, EDA_HOTKEY_CONFIG *aHotkeys)
Function InstallHotkeyFrame Create a hotkey editor dialog window with the provided hotkey configurati...
void ResetClicked(wxCommandEvent &aEvent) override
Function ResetClicked Reinit the hotkeys to the initial state (removes all pending changes) ...
struct EDA_HOTKEY_CONFIG * m_hotkeys
virtual int WriteHotkeyConfig(struct EDA_HOTKEY_CONFIG *aDescList, wxString *aFullFileName=NULL)
Function WriteHotkeyConfig Store the current hotkey list It is stored using the standard wxConfig mec...
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
virtual EDA_BASE_FRAME * GetParent()
bool TransferDataFromWindow() override
bool TransferDataToWindow() override
bool TransferDefaultsToControl()
Method TransferDefaultsToControl Set hotkeys in the control to default values.
HOTKEYS_EDITOR_DIALOG(EDA_BASE_FRAME *aParent, EDA_HOTKEY_CONFIG *aHotkeys)
virtual void ReCreateMenuBar()
Function ReCreateMenuBar Creates recreates the menu bar.
bool TransferDataFromControl()
Method TransferDataFromControl Save the hotkey data from the control.