2014-10-16 01:17:51 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2018-05-14 17:34:18 +00:00
|
|
|
* Copyright (C) 2004-2018 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
|
|
|
|
*/
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
#ifndef PANEL_HOTKEYS_EDITOR_H
|
|
|
|
#define PANEL_HOTKEYS_EDITOR_H
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <hotkeys_basic.h>
|
2018-09-26 14:26:26 +00:00
|
|
|
#include <hotkey_store.h>
|
|
|
|
|
2016-01-16 01:56:57 +00:00
|
|
|
#include <widgets/widget_hotkey_list.h>
|
2014-10-16 01:17:46 +00:00
|
|
|
|
2018-10-01 16:18:29 +00:00
|
|
|
#include "wx/panel.h"
|
2018-05-14 17:34:18 +00:00
|
|
|
|
2018-10-01 16:18:29 +00:00
|
|
|
|
|
|
|
class wxPanel;
|
|
|
|
class wxSizer;
|
2019-06-11 16:38:00 +00:00
|
|
|
class WIDGET_HOTKEY_LIST;
|
2018-10-01 16:18:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class PANEL_HOTKEYS_EDITOR : public wxPanel
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
protected:
|
2018-05-14 17:34:18 +00:00
|
|
|
EDA_BASE_FRAME* m_frame;
|
2018-10-02 21:37:15 +00:00
|
|
|
bool m_readOnly;
|
2011-09-29 16:49:40 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG* m_hotkeys;
|
2018-05-14 17:34:18 +00:00
|
|
|
wxString m_nickname;
|
2014-10-16 01:17:51 +00:00
|
|
|
|
2018-09-26 14:26:26 +00:00
|
|
|
HOTKEY_STORE m_hotkeyStore;
|
2018-05-14 17:34:18 +00:00
|
|
|
WIDGET_HOTKEY_LIST* m_hotkeyListCtrl;
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2019-06-11 16:38:00 +00:00
|
|
|
wxBoxSizer* m_mainSizer;
|
|
|
|
wxBoxSizer* m_errorMessageSizer;
|
|
|
|
wxStaticText* m_errorMessage;
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
public:
|
2018-10-02 21:37:15 +00:00
|
|
|
PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aWindow, bool aReadOnly,
|
2018-05-14 17:34:18 +00:00
|
|
|
EDA_HOTKEY_CONFIG* aHotkeys, EDA_HOTKEY_CONFIG* aShowHotkeys,
|
|
|
|
const wxString& aNickname );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2018-10-02 21:37:15 +00:00
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
|
|
|
|
2019-06-11 16:38:00 +00:00
|
|
|
/**
|
|
|
|
* Update the error message display on the panel with the new messages.
|
|
|
|
*/
|
|
|
|
void UpdateErrorMessage();
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
private:
|
2019-06-11 16:38:00 +00:00
|
|
|
/**
|
|
|
|
* Initialize the elements of the panel.
|
|
|
|
*/
|
|
|
|
void initializeElements();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Import hotkey configuration data from a file and verify the validity of the
|
|
|
|
* imported keys. Then prompt the user with the results.
|
|
|
|
*/
|
|
|
|
void onImportHotkeyConfigFromFile();
|
2014-10-16 01:17:51 +00:00
|
|
|
|
|
|
|
/**
|
2018-10-01 16:18:29 +00:00
|
|
|
* Install the button panel (global reset/default, import/export)
|
|
|
|
* @param aSizer the dialog to install on
|
2016-03-29 16:35:24 +00:00
|
|
|
*/
|
2018-10-01 16:18:29 +00:00
|
|
|
void installButtons( wxSizer* aSizer );
|
2018-08-01 09:15:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnFilterSearch
|
|
|
|
* Handle a change in the hoteky filter text
|
|
|
|
*
|
|
|
|
* @param aEvent: the search event, used to get the search query
|
|
|
|
*/
|
2018-10-01 16:18:29 +00:00
|
|
|
void OnFilterSearch( wxCommandEvent& aEvent );
|
2010-08-28 18:02:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
#endif // PANEL_HOTKEYS_EDITOR_H
|