From 412cfc0ff7dcc985cfeec9f4808a9567f31d1b0f Mon Sep 17 00:00:00 2001 From: Jan Dolezal Date: Sat, 26 Mar 2016 21:08:30 +0100 Subject: [PATCH] Add button "Defaults" to the "Hotkeys Editor" dialog. The dialog is available from "Preferences->Hotkeys->Edit Hotkeys" in Part Library Editor, Pcbnew, Footprint Editor, GerbView and Pl_Editor --- common/dialogs/dialog_hotkeys_editor.cpp | 4 + common/dialogs/dialog_hotkeys_editor_base.cpp | 7 +- common/dialogs/dialog_hotkeys_editor_base.fbp | 88 +++++++++++++++++++ common/dialogs/dialog_hotkeys_editor_base.h | 4 +- include/dialog_hotkeys_editor.h | 8 ++ 5 files changed, 109 insertions(+), 2 deletions(-) diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp index 96a8d3b5d15..2df64966151 100644 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ b/common/dialogs/dialog_hotkeys_editor.cpp @@ -84,3 +84,7 @@ void HOTKEYS_EDITOR_DIALOG::ResetClicked( wxCommandEvent& aEvent ) { m_hotkeyListCtrl->TransferDataToControl(); } + +void HOTKEYS_EDITOR_DIALOG::DefaultsClicked( wxCommandEvent& aEvent ) +{ +} diff --git a/common/dialogs/dialog_hotkeys_editor_base.cpp b/common/dialogs/dialog_hotkeys_editor_base.cpp index 5373ac504aa..4fc60f4b95d 100644 --- a/common/dialogs/dialog_hotkeys_editor_base.cpp +++ b/common/dialogs/dialog_hotkeys_editor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 28 2015) +// C++ code generated with wxFormBuilder (version Jun 17 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -28,6 +28,9 @@ HOTKEYS_EDITOR_DIALOG_BASE::HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWind m_resetButton = new wxButton( this, wxID_RESET, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 ); b_buttonsSizer->Add( m_resetButton, 0, wxALL|wxEXPAND, 5 ); + m_defaultButton = new wxButton( this, wxID_ANY, _("Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); + b_buttonsSizer->Add( m_defaultButton, 0, wxALL|wxEXPAND, 5 ); + b_buttonsSizer->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -49,11 +52,13 @@ HOTKEYS_EDITOR_DIALOG_BASE::HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWind // Connect Events m_resetButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this ); + m_defaultButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::DefaultsClicked ), NULL, this ); } HOTKEYS_EDITOR_DIALOG_BASE::~HOTKEYS_EDITOR_DIALOG_BASE() { // Disconnect Events m_resetButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this ); + m_defaultButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::DefaultsClicked ), NULL, this ); } diff --git a/common/dialogs/dialog_hotkeys_editor_base.fbp b/common/dialogs/dialog_hotkeys_editor_base.fbp index 6a096faede4..3c66e1bc4a8 100644 --- a/common/dialogs/dialog_hotkeys_editor_base.fbp +++ b/common/dialogs/dialog_hotkeys_editor_base.fbp @@ -353,6 +353,94 @@ + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Defaults + + 0 + + + 0 + + 1 + m_defaultButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + DefaultsClicked + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND diff --git a/common/dialogs/dialog_hotkeys_editor_base.h b/common/dialogs/dialog_hotkeys_editor_base.h index a59f560d4fd..3d4a8808bb2 100644 --- a/common/dialogs/dialog_hotkeys_editor_base.h +++ b/common/dialogs/dialog_hotkeys_editor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 28 2015) +// C++ code generated with wxFormBuilder (version Jun 17 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -40,12 +40,14 @@ class HOTKEYS_EDITOR_DIALOG_BASE : public DIALOG_SHIM wxStaticText* m_staticText1; wxPanel* m_panelHotkeys; wxButton* m_resetButton; + wxButton* m_defaultButton; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class virtual void ResetClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void DefaultsClicked( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/include/dialog_hotkeys_editor.h b/include/dialog_hotkeys_editor.h index 801bea9aead..3107b6113f9 100644 --- a/include/dialog_hotkeys_editor.h +++ b/include/dialog_hotkeys_editor.h @@ -66,6 +66,14 @@ class HOTKEYS_EDITOR_DIALOG : public HOTKEYS_EDITOR_DIALOG_BASE * @param aEvent is the button press event, unused */ void ResetClicked( wxCommandEvent& aEvent ); + + /** + * Function DefaultsClicked + * Set the hotkeys to the default values (values after installation) + * + * @param aEvent is the button press event, unused + */ + void DefaultsClicked( wxCommandEvent& aEvent ); }; /**