2014-10-16 01:17:51 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-01-05 00:31:35 +00:00
|
|
|
* Copyright (C) 2004-2016 KiCad Developers, see CHANGELOG.TXT for contributors.
|
2014-10-16 01:17:51 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2016-01-16 01:56:57 +00:00
|
|
|
* as published by the Free Software Foundation; either version 3
|
2014-10-16 01:17:51 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file dialog_hotkeys_editor.h
|
|
|
|
*/
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
#ifndef __dialog_hotkeys_editor__
|
|
|
|
#define __dialog_hotkeys_editor__
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <hotkeys_basic.h>
|
|
|
|
#include <../common/dialogs/dialog_hotkeys_editor_base.h>
|
2016-01-16 01:56:57 +00:00
|
|
|
#include <widgets/widget_hotkey_list.h>
|
2014-10-16 01:17:46 +00:00
|
|
|
|
2014-10-16 01:17:51 +00:00
|
|
|
/**
|
|
|
|
* Class HOTKEYS_EDITOR_DIALOG
|
|
|
|
* is the child class of HOTKEYS_EDITOR_DIALOG_BASE. This is the class
|
|
|
|
* used to create a hotkey editor.
|
|
|
|
*/
|
2010-08-28 18:02:24 +00:00
|
|
|
class HOTKEYS_EDITOR_DIALOG : public HOTKEYS_EDITOR_DIALOG_BASE
|
|
|
|
{
|
|
|
|
protected:
|
2011-09-29 16:49:40 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG* m_hotkeys;
|
2018-02-23 17:22:56 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG* m_showhotkeys;
|
2014-10-16 01:17:51 +00:00
|
|
|
|
2016-01-16 01:56:57 +00:00
|
|
|
WIDGET_HOTKEY_LIST* m_hotkeyListCtrl;
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
2016-01-05 00:31:35 +00:00
|
|
|
|
2016-01-16 01:56:00 +00:00
|
|
|
virtual EDA_BASE_FRAME* GetParent()
|
|
|
|
{
|
|
|
|
return static_cast<EDA_BASE_FRAME*>( HOTKEYS_EDITOR_DIALOG_BASE::GetParent() );
|
|
|
|
}
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
public:
|
2018-02-23 17:22:56 +00:00
|
|
|
HOTKEYS_EDITOR_DIALOG( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys,
|
|
|
|
EDA_HOTKEY_CONFIG* aShowHotkeys );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
~HOTKEYS_EDITOR_DIALOG() {};
|
|
|
|
|
|
|
|
private:
|
2014-10-16 01:17:51 +00:00
|
|
|
|
|
|
|
/**
|
2016-01-05 00:31:35 +00:00
|
|
|
* Function ResetClicked
|
2014-10-16 01:17:51 +00:00
|
|
|
* Reinit the hotkeys to the initial state (removes all pending changes)
|
|
|
|
*
|
|
|
|
* @param aEvent is the button press event, unused
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void ResetClicked( wxCommandEvent& aEvent ) override;
|
2016-03-29 16:35:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DefaultsClicked
|
|
|
|
* Set the hotkeys to the default values (values after installation)
|
|
|
|
*
|
|
|
|
* @param aEvent is the button press event, unused
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void DefaultsClicked( wxCommandEvent& aEvent ) override;
|
2010-08-28 18:02:24 +00:00
|
|
|
};
|
|
|
|
|
2014-10-16 01:17:51 +00:00
|
|
|
/**
|
|
|
|
* Function InstallHotkeyFrame
|
|
|
|
* Create a hotkey editor dialog window with the provided hotkey configuration array
|
|
|
|
*
|
|
|
|
* @param aParent is the parent window
|
2018-02-23 17:22:56 +00:00
|
|
|
* @param aHotkeys is the hotkey configuration array for read/writing
|
|
|
|
* @param aShowHotkeys is the hotkey configuration array that is displayed (subset)
|
2014-10-16 01:17:51 +00:00
|
|
|
*/
|
2018-02-23 17:22:56 +00:00
|
|
|
void InstallHotkeyFrame( EDA_BASE_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys,
|
|
|
|
EDA_HOTKEY_CONFIG* aShowHotkeys = NULL );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
#endif
|