2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-04-16 15:26:51 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, j-p.charras at wanadoo.fr
|
2011-10-18 19:59:19 +00:00
|
|
|
* Copyright (C) 2010-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
2015-04-16 15:26:51 +00:00
|
|
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-18 19:59:19 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
/**
|
|
|
|
* @file hotkeys_basic.cpp
|
2011-09-30 18:15:37 +00:00
|
|
|
* @brief Some functions to handle hotkeys in KiCad
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <kiface_i.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <hotkeys_basic.h>
|
|
|
|
#include <id.h>
|
|
|
|
#include <confirm.h>
|
|
|
|
#include <kicad_string.h>
|
|
|
|
#include <gestfich.h>
|
|
|
|
#include <wxstruct.h>
|
|
|
|
#include <macros.h>
|
|
|
|
#include <dialog_hotkeys_editor.h>
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2007-09-19 15:29:50 +00:00
|
|
|
|
2009-04-06 18:54:57 +00:00
|
|
|
#include <wx/apptrait.h>
|
|
|
|
#include <wx/stdpaths.h>
|
2010-08-28 18:02:24 +00:00
|
|
|
#include <wx/tokenzr.h>
|
2009-04-06 18:54:57 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
#define HOTKEYS_CONFIG_KEY wxT( "Keys" )
|
2007-08-20 11:33:45 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
wxString g_CommonSectionTag( wxT( "[common]" ) );
|
2014-10-16 01:17:46 +00:00
|
|
|
|
2009-11-23 15:16:50 +00:00
|
|
|
|
2007-08-20 11:33:45 +00:00
|
|
|
/* Class to handle hotkey commnands. hotkeys have a default value
|
2009-11-23 15:16:50 +00:00
|
|
|
* This class allows the real key code changed by user from a key code list
|
|
|
|
* file.
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2007-08-20 11:33:45 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY::EDA_HOTKEY( const wxChar* infomsg, int idcommand, int keycode, int idmenuevent )
|
2007-08-20 11:33:45 +00:00
|
|
|
{
|
2010-01-20 18:59:46 +00:00
|
|
|
m_KeyCode = keycode; // Key code (ascii value for ascii keys
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2010-01-20 18:59:46 +00:00
|
|
|
// or wxWidgets code for function key
|
|
|
|
m_InfoMsg = infomsg; // info message.
|
|
|
|
m_Idcommand = idcommand; // internal id for the corresponding
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2010-01-20 18:59:46 +00:00
|
|
|
// command (see hotkey_id_commnand list)
|
2009-11-23 15:16:50 +00:00
|
|
|
m_IdMenuEvent = idmenuevent; // id to call the corresponding event
|
2010-01-20 18:59:46 +00:00
|
|
|
// (if any) (see id.h)
|
2007-08-20 11:33:45 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY::EDA_HOTKEY( const EDA_HOTKEY* base )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
m_KeyCode = base->m_KeyCode;
|
|
|
|
m_InfoMsg = base->m_InfoMsg;
|
|
|
|
m_Idcommand = base->m_Idcommand;
|
|
|
|
m_IdMenuEvent = base->m_IdMenuEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-26 20:46:04 +00:00
|
|
|
EDA_HOTKEY_CLIENT_DATA::~EDA_HOTKEY_CLIENT_DATA()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-21 19:37:31 +00:00
|
|
|
/* class to handle the printable name and the keycode
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
|
|
|
struct hotkey_name_descr
|
|
|
|
{
|
2007-10-31 08:34:05 +00:00
|
|
|
const wxChar* m_Name;
|
2010-01-20 18:59:46 +00:00
|
|
|
int m_KeyCode;
|
2007-08-21 19:37:31 +00:00
|
|
|
};
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
/* table giving the hotkey name from the hotkey code, for special keys
|
|
|
|
* Note : when modifiers (ATL, SHIFT, CTRL) do not modify
|
|
|
|
* the code of the key, do need to enter the modified key code
|
|
|
|
* For instance wxT( "F1" ), WXK_F1 handle F1, AltF1, CtrlF1 ...
|
2010-08-29 16:36:52 +00:00
|
|
|
* Key names are:
|
|
|
|
* "Space","Ctrl+Space","Alt+Space" or
|
|
|
|
* "Alt+A","Ctrl+F1", ...
|
2010-08-28 18:02:24 +00:00
|
|
|
*/
|
2007-09-06 11:52:26 +00:00
|
|
|
static struct hotkey_name_descr s_Hotkey_Name_List[] =
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
{ wxT( "F1" ), WXK_F1 },
|
|
|
|
{ wxT( "F2" ), WXK_F2 },
|
|
|
|
{ wxT( "F3" ), WXK_F3 },
|
|
|
|
{ wxT( "F4" ), WXK_F4 },
|
|
|
|
{ wxT( "F5" ), WXK_F5 },
|
|
|
|
{ wxT( "F6" ), WXK_F6 },
|
|
|
|
{ wxT( "F7" ), WXK_F7 },
|
|
|
|
{ wxT( "F8" ), WXK_F8 },
|
|
|
|
{ wxT( "F9" ), WXK_F9 },
|
|
|
|
{ wxT( "F10" ), WXK_F10 },
|
|
|
|
{ wxT( "F11" ), WXK_F11 },
|
|
|
|
{ wxT( "F12" ), WXK_F12 },
|
|
|
|
|
|
|
|
{ wxT( "Esc" ), WXK_ESCAPE },
|
|
|
|
{ wxT( "Del" ), WXK_DELETE },
|
2010-08-29 16:36:52 +00:00
|
|
|
{ wxT( "Tab" ), WXK_TAB },
|
2010-08-28 18:02:24 +00:00
|
|
|
{ wxT( "BkSp" ), WXK_BACK },
|
|
|
|
{ wxT( "Ins" ), WXK_INSERT },
|
|
|
|
|
|
|
|
{ wxT( "Home" ), WXK_HOME },
|
|
|
|
{ wxT( "End" ), WXK_END },
|
|
|
|
{ wxT( "PgUp" ), WXK_PAGEUP },
|
|
|
|
{ wxT( "PgDn" ), WXK_PAGEDOWN },
|
|
|
|
|
|
|
|
{ wxT( "Up" ), WXK_UP },
|
|
|
|
{ wxT( "Down" ), WXK_DOWN },
|
|
|
|
{ wxT( "Left" ), WXK_LEFT },
|
|
|
|
{ wxT( "Right" ), WXK_RIGHT },
|
2010-01-20 18:59:46 +00:00
|
|
|
|
2014-04-03 07:40:55 +00:00
|
|
|
{ wxT( "Return" ), WXK_RETURN },
|
|
|
|
|
2010-08-29 16:36:52 +00:00
|
|
|
{ wxT( "Space" ), WXK_SPACE },
|
|
|
|
|
2010-01-20 18:59:46 +00:00
|
|
|
// Do not change this line: end of list
|
2010-08-28 18:02:24 +00:00
|
|
|
{ wxT( "" ), 0 }
|
2007-08-21 19:37:31 +00:00
|
|
|
};
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#define MODIFIER_CTRL wxT( "Ctrl+" )
|
|
|
|
#define MODIFIER_ALT wxT( "Alt+" )
|
2010-08-28 19:08:58 +00:00
|
|
|
#define MODIFIER_SHIFT wxT( "Shift+" )
|
|
|
|
|
2007-08-21 19:37:31 +00:00
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function KeyNameFromKeyCode
|
2007-08-30 08:15:05 +00:00
|
|
|
* return the key name from the key code
|
2009-11-23 15:16:50 +00:00
|
|
|
* Only some wxWidgets key values are handled for function key ( see
|
|
|
|
* s_Hotkey_Name_List[] )
|
2010-02-16 10:42:57 +00:00
|
|
|
* @param aKeycode = key code (ascii value, or wxWidgets value for function keys)
|
2010-08-28 18:02:24 +00:00
|
|
|
* @param aIsFound = a pointer to a bool to return true if found, or false. an be NULL default)
|
2007-08-30 08:15:05 +00:00
|
|
|
* @return the key name in a wxString
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
|
2007-08-20 11:33:45 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString keyname, modifier, fullkeyname;
|
|
|
|
int ii;
|
2010-08-28 18:02:24 +00:00
|
|
|
bool found = false;
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2014-10-16 01:17:51 +00:00
|
|
|
// Assume keycode of 0 is "unassigned"
|
|
|
|
if( aKeycode == 0 )
|
|
|
|
return wxT( "<unassigned>");
|
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
if( (aKeycode & GR_KB_CTRL) != 0 )
|
2010-08-28 19:08:58 +00:00
|
|
|
modifier << MODIFIER_CTRL;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
if( (aKeycode & GR_KB_ALT) != 0 )
|
2010-08-28 19:08:58 +00:00
|
|
|
modifier << MODIFIER_ALT;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
if( (aKeycode & GR_KB_SHIFT) != 0 )
|
2010-08-28 19:08:58 +00:00
|
|
|
modifier << MODIFIER_SHIFT;
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
aKeycode &= ~( GR_KB_CTRL | GR_KB_ALT | GR_KB_SHIFT );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2010-08-29 16:36:52 +00:00
|
|
|
if( (aKeycode > ' ') && (aKeycode < 0x7F ) )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
found = true;
|
2011-09-01 12:54:34 +00:00
|
|
|
keyname.Append( (wxChar)aKeycode );
|
2010-08-28 18:02:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for( ii = 0; ; ii++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
if( s_Hotkey_Name_List[ii].m_KeyCode == 0 ) // End of list
|
|
|
|
{
|
|
|
|
keyname = wxT( "<unknown>" );
|
|
|
|
break;
|
|
|
|
}
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( s_Hotkey_Name_List[ii].m_KeyCode == aKeycode )
|
|
|
|
{
|
|
|
|
keyname = s_Hotkey_Name_List[ii].m_Name;
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
2007-08-30 08:15:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( aIsFound )
|
|
|
|
*aIsFound = found;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
fullkeyname = modifier + keyname;
|
|
|
|
return fullkeyname;
|
2007-08-21 19:37:31 +00:00
|
|
|
}
|
2007-08-20 11:33:45 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-09-23 20:00:30 +00:00
|
|
|
/*
|
|
|
|
* helper function use in AddHotkeyName to calculate an accelerator string
|
2011-09-29 16:49:40 +00:00
|
|
|
* In some menus, accelerators do not perform exactly the same action as
|
|
|
|
* the hotkey that perform a similar action.
|
2011-09-23 20:00:30 +00:00
|
|
|
* this is usually the case when this action uses the current mouse position
|
|
|
|
* for instance zoom action is ran from the F1 key or the Zoom menu.
|
|
|
|
* a zoom uses the mouse position from a hot key and not from the menu
|
|
|
|
* In this case, the accelerator if Shift+<hotkey>
|
2011-09-24 17:15:29 +00:00
|
|
|
* But for many keys, the Shift modifier is not usable, and the accelerator is Alt+<hotkey>
|
2011-09-23 20:00:30 +00:00
|
|
|
*/
|
|
|
|
static void AddModifierToKey( wxString& aFullKey, const wxString & aKey )
|
|
|
|
{
|
2011-09-24 17:15:29 +00:00
|
|
|
if( (aKey.Length() == 1) && (aKey[0] >= 'A') && (aKey[0] <= 'Z'))
|
2013-09-21 17:09:08 +00:00
|
|
|
// We can use Shift+<key> as accelerator and <key> for hot key
|
2011-09-23 20:00:30 +00:00
|
|
|
aFullKey << wxT( "\t" ) << MODIFIER_SHIFT << aKey;
|
2011-09-24 17:15:29 +00:00
|
|
|
else
|
2013-11-04 17:18:19 +00:00
|
|
|
// We must use Alt+<key> as accelerator and <key> for hot key
|
2011-09-24 17:15:29 +00:00
|
|
|
aFullKey << wxT( "\t" ) << MODIFIER_ALT << aKey;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* AddHotkeyName
|
2007-08-30 08:15:05 +00:00
|
|
|
* Add the key name from the Command id value ( m_Idcommand member value)
|
2010-12-20 17:44:25 +00:00
|
|
|
* aText = a wxString. returns aText + key name
|
2011-09-29 16:49:40 +00:00
|
|
|
* aList = pointer to a EDA_HOTKEY list of commands
|
2010-12-20 17:44:25 +00:00
|
|
|
* aCommandId = Command Id value
|
2011-09-23 20:00:30 +00:00
|
|
|
* aShortCutType = IS_HOTKEY to add <tab><keyname> (shortcuts in menus, same as hotkeys)
|
|
|
|
* IS_ACCELERATOR to add <tab><Shift+keyname> (accelerators in menus, not hotkeys)
|
2011-09-29 16:49:40 +00:00
|
|
|
* IS_COMMENT to add <spaces><(keyname)> mainly in tool tips
|
2010-12-20 17:44:25 +00:00
|
|
|
* Return a wxString (aTest + key name) if key found or aText without modification
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2011-09-29 16:49:40 +00:00
|
|
|
wxString AddHotkeyName( const wxString& aText, EDA_HOTKEY** aList,
|
2011-09-23 20:00:30 +00:00
|
|
|
int aCommandId, HOTKEY_ACTION_TYPE aShortCutType )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString msg = aText;
|
2010-02-14 18:14:33 +00:00
|
|
|
wxString keyname;
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2010-02-14 18:14:33 +00:00
|
|
|
if( aList )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
keyname = KeyNameFromCommandId( aList, aCommandId );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
|
|
|
if( !keyname.IsEmpty() )
|
2011-04-05 14:46:51 +00:00
|
|
|
{
|
2011-09-23 20:00:30 +00:00
|
|
|
switch( aShortCutType )
|
|
|
|
{
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_HOTKEY:
|
|
|
|
msg << wxT( "\t" ) << keyname;
|
|
|
|
break;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_ACCELERATOR:
|
|
|
|
AddModifierToKey( msg, keyname );
|
|
|
|
break;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_COMMENT:
|
|
|
|
msg << wxT( " (" ) << keyname << wxT( ")" );
|
|
|
|
break;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
2011-04-05 14:46:51 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* AddHotkeyName
|
2007-09-06 11:52:26 +00:00
|
|
|
* Add the key name from the Command id value ( m_Idcommand member value)
|
2010-12-20 17:44:25 +00:00
|
|
|
* aText = a wxString. returns aText + key name
|
2011-09-29 16:49:40 +00:00
|
|
|
* aList = pointer to a EDA_HOTKEY_CONFIG DescrList of commands
|
2010-12-20 17:44:25 +00:00
|
|
|
* aCommandId = Command Id value
|
2011-09-23 20:00:30 +00:00
|
|
|
* aShortCutType = IS_HOTKEY to add <tab><keyname> (active shortcuts in menus)
|
|
|
|
* IS_ACCELERATOR to add <tab><Shift+keyname> (active accelerators in menus)
|
|
|
|
* IS_COMMENT to add <spaces><(keyname)>
|
2010-12-20 17:44:25 +00:00
|
|
|
* Return a wxString (aText + key name) if key found or aText without modification
|
2007-09-06 11:52:26 +00:00
|
|
|
*/
|
2011-09-29 16:49:40 +00:00
|
|
|
wxString AddHotkeyName( const wxString& aText,
|
|
|
|
struct EDA_HOTKEY_CONFIG* aDescList,
|
|
|
|
int aCommandId,
|
|
|
|
HOTKEY_ACTION_TYPE aShortCutType )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2011-09-29 16:49:40 +00:00
|
|
|
wxString msg = aText;
|
|
|
|
wxString keyname;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_HOTKEY** list;
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2010-02-14 18:14:33 +00:00
|
|
|
if( aDescList )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2010-02-14 18:14:33 +00:00
|
|
|
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
list = aDescList->m_HK_InfoList;
|
|
|
|
keyname = KeyNameFromCommandId( list, aCommandId );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-02-14 18:14:33 +00:00
|
|
|
if( !keyname.IsEmpty() )
|
|
|
|
{
|
2011-09-23 20:00:30 +00:00
|
|
|
switch( aShortCutType )
|
|
|
|
{
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_HOTKEY:
|
|
|
|
msg << wxT( "\t" ) << keyname;
|
|
|
|
break;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_ACCELERATOR:
|
|
|
|
AddModifierToKey( msg, keyname );
|
|
|
|
break;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
case IS_COMMENT:
|
|
|
|
msg << wxT( " (" ) << keyname << wxT( ")" );
|
|
|
|
break;
|
2011-09-23 20:00:30 +00:00
|
|
|
}
|
2014-10-17 14:36:47 +00:00
|
|
|
|
2010-02-14 18:14:33 +00:00
|
|
|
break;
|
|
|
|
}
|
2007-09-06 11:52:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function KeyNameFromCommandId
|
2007-08-30 08:15:05 +00:00
|
|
|
* return the key name from the Command id value ( m_Idcommand member value)
|
2011-09-29 16:49:40 +00:00
|
|
|
* @param aList = pointer to a EDA_HOTKEY list of commands
|
2010-02-16 10:42:57 +00:00
|
|
|
* @param aCommandId = Command Id value
|
2007-08-30 08:15:05 +00:00
|
|
|
* @return the key name in a wxString
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString KeyNameFromCommandId( EDA_HOTKEY** aList, int aCommandId )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
|
|
|
wxString keyname;
|
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
for( ; *aList != NULL; aList++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* hk_decr = *aList;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-02-16 10:42:57 +00:00
|
|
|
if( hk_decr->m_Idcommand == aCommandId )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return keyname;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function KeyCodeFromKeyName
|
2007-08-30 08:15:05 +00:00
|
|
|
* return the key code from its key name
|
|
|
|
* Only some wxWidgets key values are handled for function key
|
2009-11-23 15:16:50 +00:00
|
|
|
* @param keyname = wxString key name to find in s_Hotkey_Name_List[],
|
2010-01-20 18:59:46 +00:00
|
|
|
* like F2 or space or an usual (ascii) char.
|
2007-08-30 08:15:05 +00:00
|
|
|
* @return the key code
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
int KeyCodeFromKeyName( const wxString& keyname )
|
2007-08-21 19:37:31 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
int ii, keycode = 0;
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
// Search for modifiers: Ctrl+ Alt+ and Shift+
|
|
|
|
wxString key = keyname;
|
|
|
|
int modifier = 0;
|
|
|
|
while( 1 )
|
|
|
|
{
|
2010-08-28 19:08:58 +00:00
|
|
|
if( key.StartsWith( MODIFIER_CTRL ) )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
modifier |= GR_KB_CTRL;
|
|
|
|
key.Remove( 0, 5 );
|
|
|
|
}
|
2010-08-28 19:08:58 +00:00
|
|
|
else if( key.StartsWith( MODIFIER_ALT ) )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
modifier |= GR_KB_ALT;
|
|
|
|
key.Remove( 0, 4 );
|
|
|
|
}
|
2010-08-28 19:08:58 +00:00
|
|
|
else if( key.StartsWith( MODIFIER_SHIFT ) )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
modifier |= GR_KB_SHIFT;
|
|
|
|
key.Remove( 0, 6 );
|
|
|
|
}
|
|
|
|
else
|
2011-09-01 12:54:34 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
break;
|
2011-09-01 12:54:34 +00:00
|
|
|
}
|
2010-08-28 18:02:24 +00:00
|
|
|
}
|
|
|
|
|
2010-08-29 16:36:52 +00:00
|
|
|
if( (key.length() == 1) && (key[0] > ' ') && (key[0] < 0x7F) )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
keycode = key[0];
|
|
|
|
keycode += modifier;
|
2010-08-29 16:36:52 +00:00
|
|
|
return keycode;
|
2010-08-28 18:02:24 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
for( ii = 0; ; ii++ )
|
|
|
|
{
|
|
|
|
if( s_Hotkey_Name_List[ii].m_KeyCode == 0 ) // End of list reached
|
|
|
|
break;
|
2008-09-03 16:19:06 +00:00
|
|
|
|
2010-08-29 16:36:52 +00:00
|
|
|
if( key.CmpNoCase( s_Hotkey_Name_List[ii].m_Name ) == 0 )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
keycode = s_Hotkey_Name_List[ii].m_KeyCode + modifier;
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return keycode;
|
2007-08-20 11:33:45 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* DisplayHotkeyList
|
2007-08-30 08:15:05 +00:00
|
|
|
* Displays the current hotkey list
|
2011-09-29 16:49:40 +00:00
|
|
|
* aList = a EDA_HOTKEY_CONFIG list(Null terminated)
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2015-03-15 11:41:06 +00:00
|
|
|
#include <html_messagebox.h>
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
void DisplayHotkeyList( EDA_BASE_FRAME* aFrame, struct EDA_HOTKEY_CONFIG* aDescList )
|
2007-08-20 11:33:45 +00:00
|
|
|
{
|
2011-09-29 16:49:40 +00:00
|
|
|
wxString keyname;
|
2015-03-22 14:04:09 +00:00
|
|
|
wxString keymessage;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_HOTKEY** list;
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
wxString msg = wxT( "<html><body bgcolor=\"#E2E2E2\">" );
|
2011-09-09 19:30:59 +00:00
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
msg += wxT( "<H3>" );
|
|
|
|
msg += _( "Hotkeys List" );
|
|
|
|
msg += wxT( "</H3> <table cellpadding=\"0\">" );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2010-02-16 11:02:20 +00:00
|
|
|
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
list = aDescList->m_HK_InfoList;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
for( ; *list != NULL; list++ )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_HOTKEY* hk_decr = *list;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2011-09-07 09:27:02 +00:00
|
|
|
if( !hk_decr->m_InfoMsg.Contains( wxT( "Macros" ) ) )
|
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
|
2015-03-22 14:04:09 +00:00
|
|
|
keymessage = wxGetTranslation( hk_decr->m_InfoMsg );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2015-03-22 14:04:09 +00:00
|
|
|
// Some chars are modified, using html encoding, to be
|
2013-09-21 17:09:08 +00:00
|
|
|
// displayed by DisplayHtmlInfoMessage()
|
2014-10-17 14:36:47 +00:00
|
|
|
keyname.Replace( wxT( "<" ), wxT( "<" ) );
|
|
|
|
keyname.Replace( wxT( ">" ), wxT( ">" ) );
|
2015-03-22 14:04:09 +00:00
|
|
|
msg += wxT( "<tr><td>" ) + keymessage + wxT( "</td>" );
|
2014-10-17 14:36:47 +00:00
|
|
|
msg += wxT( "<td><b> " ) + keyname + wxT( "</b></td></tr>" );
|
2011-09-07 09:27:02 +00:00
|
|
|
}
|
2007-09-06 11:52:26 +00:00
|
|
|
}
|
2007-08-30 08:15:05 +00:00
|
|
|
}
|
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
msg += wxT( "</table></html></body>" );
|
2015-03-15 11:41:06 +00:00
|
|
|
|
|
|
|
#if 0 // Set to 1 to create a modal dialog (blocking)
|
2014-10-17 14:36:47 +00:00
|
|
|
DisplayHtmlInfoMessage( aFrame, _( "Hotkeys List" ), msg, wxSize( 340, 750 ) );
|
2015-03-15 11:41:06 +00:00
|
|
|
#else
|
|
|
|
// Create a non modal dialog, which shows the list of hotkeys until dismissed
|
|
|
|
// but does not block the parent window
|
|
|
|
HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX( aFrame, _( "Hotkeys List" ),
|
|
|
|
wxDefaultPosition, wxSize( 340, 750 ) );
|
|
|
|
dlg->AddHTML_Text( msg );
|
|
|
|
dlg->Show( true );
|
|
|
|
#endif
|
2007-08-20 11:33:45 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function GetDescriptorFromHotkey
|
2011-09-29 16:49:40 +00:00
|
|
|
* Return a EDA_HOTKEY * pointer from a key code for OnHotKey() function
|
2010-02-16 11:02:20 +00:00
|
|
|
* @param aKey = key code (ascii value, or wxWidgets value for function keys
|
2011-09-29 16:49:40 +00:00
|
|
|
* @param aList = pointer to a EDA_HOTKEY list of commands
|
|
|
|
* @return the corresponding EDA_HOTKEY pointer from the EDA_HOTKEY List
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* GetDescriptorFromHotkey( int aKey, EDA_HOTKEY** aList )
|
2007-08-20 11:33:45 +00:00
|
|
|
{
|
2010-02-16 11:02:20 +00:00
|
|
|
for( ; *aList != NULL; aList++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY* hk_decr = *aList;
|
|
|
|
|
2010-02-16 11:02:20 +00:00
|
|
|
if( hk_decr->m_KeyCode == aKey )
|
2007-09-22 14:31:20 +00:00
|
|
|
return hk_decr;
|
2007-08-30 08:15:05 +00:00
|
|
|
}
|
|
|
|
|
2007-09-22 14:31:20 +00:00
|
|
|
return NULL;
|
2007-08-20 11:33:45 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
int EDA_BASE_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList,
|
|
|
|
wxString* aFullFileName )
|
2007-08-21 19:37:31 +00:00
|
|
|
{
|
2007-08-30 08:15:05 +00:00
|
|
|
wxString msg;
|
|
|
|
wxString keyname, infokey;
|
|
|
|
|
|
|
|
msg = wxT( "$hotkey list\n" );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Print the current hotkey list
|
|
|
|
EDA_HOTKEY** list;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
for( ; aDescList->m_HK_InfoList != NULL; aDescList++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2014-10-16 01:17:46 +00:00
|
|
|
if( aDescList->m_Title )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
msg += wxT( "# " );
|
2014-10-16 01:17:46 +00:00
|
|
|
msg += *aDescList->m_Title;
|
2010-08-28 18:02:24 +00:00
|
|
|
msg += wxT( "\n" );
|
2007-09-06 11:52:26 +00:00
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
msg += *aDescList->m_SectionTag;
|
|
|
|
msg += wxT( "\n" );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
list = aDescList->m_HK_InfoList;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
for( ; *list != NULL; list++ )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_HOTKEY* hk_decr = *list;
|
2010-08-28 18:02:24 +00:00
|
|
|
msg += wxT( "shortcut " );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
keyname = KeyNameFromKeyCode( hk_decr->m_KeyCode );
|
2007-09-06 11:52:26 +00:00
|
|
|
AddDelimiterString( keyname );
|
|
|
|
infokey = hk_decr->m_InfoMsg;
|
|
|
|
AddDelimiterString( infokey );
|
|
|
|
msg += keyname + wxT( ": " ) + infokey + wxT( "\n" );
|
|
|
|
}
|
2007-08-30 08:15:05 +00:00
|
|
|
}
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
msg += wxT( "$Endlist\n" );
|
|
|
|
|
|
|
|
if( aFullFileName )
|
|
|
|
{
|
|
|
|
FILE* file = wxFopen( *aFullFileName, wxT( "wt" ) );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( file )
|
2011-09-01 12:54:34 +00:00
|
|
|
{
|
2011-02-28 18:36:19 +00:00
|
|
|
fputs( TO_UTF8( msg ), file );
|
2013-06-05 12:03:16 +00:00
|
|
|
fclose( file );
|
2011-09-01 12:54:34 +00:00
|
|
|
}
|
2010-08-28 18:02:24 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
msg.Printf( wxT( "Unable to write file %s" ), GetChars( *aFullFileName ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-03 14:53:47 +00:00
|
|
|
wxFileName fn( GetName() );
|
2015-03-02 17:29:18 +00:00
|
|
|
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
|
|
|
|
wxConfigBase* config = GetNewConfig( fn.GetFullPath() );
|
2014-09-05 21:12:38 +00:00
|
|
|
config->Write( HOTKEYS_CONFIG_KEY, msg );
|
|
|
|
delete config;
|
2010-08-28 18:02:24 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
return 1;
|
2007-08-21 19:37:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
int EDA_BASE_FRAME::ReadHotkeyConfigFile( const wxString& aFilename,
|
|
|
|
struct EDA_HOTKEY_CONFIG* aDescList )
|
2007-08-21 19:37:31 +00:00
|
|
|
{
|
2015-03-02 17:29:18 +00:00
|
|
|
wxFileName fn( aFilename );
|
|
|
|
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
|
|
|
|
|
|
|
|
wxFile cfgfile( fn.GetFullPath() );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
2014-11-23 11:41:57 +00:00
|
|
|
if( !cfgfile.IsOpened() ) // There is a problem to open file
|
|
|
|
return 0;
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// get length
|
2010-08-28 18:02:24 +00:00
|
|
|
cfgfile.SeekEnd();
|
|
|
|
wxFileOffset size = cfgfile.Tell();
|
|
|
|
cfgfile.Seek( 0 );
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// read data
|
2010-08-28 18:02:24 +00:00
|
|
|
char* buffer = new char[size];
|
|
|
|
cfgfile.Read( buffer, size );
|
|
|
|
|
|
|
|
wxString data( buffer, wxConvUTF8 );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// parse
|
2010-08-28 18:02:24 +00:00
|
|
|
ParseHotkeyConfig( data, aDescList );
|
2007-08-30 08:15:05 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// cleanup
|
2013-04-14 04:07:04 +00:00
|
|
|
delete[] buffer;
|
2010-08-28 18:02:24 +00:00
|
|
|
cfgfile.Close();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
|
2011-09-29 16:49:40 +00:00
|
|
|
void ReadHotkeyConfig( const wxString& Appname, struct EDA_HOTKEY_CONFIG* aDescList )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
2015-03-02 17:29:18 +00:00
|
|
|
wxFileName fn( Appname );
|
|
|
|
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
|
|
|
|
|
|
|
|
wxConfigBase* config = GetNewConfig( fn.GetFullPath() );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2014-09-05 21:12:38 +00:00
|
|
|
if( !config->HasEntry( HOTKEYS_CONFIG_KEY ) )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
// assume defaults are ok
|
|
|
|
return;
|
2007-08-30 08:15:05 +00:00
|
|
|
}
|
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString data;
|
2014-09-05 21:12:38 +00:00
|
|
|
config->Read( HOTKEYS_CONFIG_KEY, &data );
|
|
|
|
delete config;
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
ParseHotkeyConfig( data, aDescList );
|
|
|
|
}
|
|
|
|
|
2014-10-17 14:36:47 +00:00
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* Function ReadHotkeyConfig
|
2010-08-28 18:02:24 +00:00
|
|
|
* Read configuration data and fill the current hotkey list with hotkeys
|
2011-09-29 16:49:40 +00:00
|
|
|
* aDescList is the current hotkey list descr. to initialize.
|
2010-08-28 18:02:24 +00:00
|
|
|
*/
|
2011-09-29 16:49:40 +00:00
|
|
|
int EDA_BASE_FRAME::ReadHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
2015-03-03 14:53:47 +00:00
|
|
|
::ReadHotkeyConfig( GetName(), aDescList );
|
2010-08-28 18:02:24 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* Function ParseHotkeyConfig
|
2010-08-28 18:02:24 +00:00
|
|
|
* the input format is: shortcut "key" "function"
|
|
|
|
* lines starting by # are ignored (comments)
|
2010-12-20 17:44:25 +00:00
|
|
|
* lines like [xxx] are tags (example: [common] or [libedit] which identify sections
|
2010-08-28 18:02:24 +00:00
|
|
|
*/
|
2011-09-29 16:49:40 +00:00
|
|
|
void ParseHotkeyConfig( const wxString& data,
|
|
|
|
struct EDA_HOTKEY_CONFIG* aDescList )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Read the config
|
2010-08-28 18:02:24 +00:00
|
|
|
wxStringTokenizer tokenizer( data, L"\r\n", wxTOKEN_STRTOK );
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY** CurrentHotkeyList = 0;
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
while( tokenizer.HasMoreTokens() )
|
2007-08-21 19:37:31 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString line = tokenizer.GetNextToken();
|
|
|
|
wxStringTokenizer lineTokenizer( line );
|
|
|
|
|
|
|
|
wxString line_type = lineTokenizer.GetNextToken();
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( line_type[0] == '#' ) //comment
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if( line_type[0] == '[' ) // A tag is found. search infos in list
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
CurrentHotkeyList = 0;
|
2011-09-29 16:49:40 +00:00
|
|
|
EDA_HOTKEY_CONFIG* DList = aDescList;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
for( ; DList->m_HK_InfoList; DList++ )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
if( *DList->m_SectionTag == line_type )
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
|
|
|
CurrentHotkeyList = DList->m_HK_InfoList;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( line_type == wxT( "$Endlist" ) )
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( line_type != wxT( "shortcut" ) )
|
|
|
|
continue;
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-09-06 11:52:26 +00:00
|
|
|
if( CurrentHotkeyList == NULL )
|
|
|
|
continue;
|
2007-08-30 08:15:05 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Get the key name
|
2010-08-28 18:02:24 +00:00
|
|
|
lineTokenizer.SetString( lineTokenizer.GetString(), L"\"\r\n\t ", wxTOKEN_STRTOK );
|
|
|
|
wxString keyname = lineTokenizer.GetNextToken();
|
2008-09-03 16:19:06 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString remainder = lineTokenizer.GetString();
|
2008-09-03 16:19:06 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Get the command name
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString fctname = remainder.AfterFirst( '\"' ).BeforeFirst( '\"' );
|
2008-09-03 16:19:06 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// search the hotkey in current hotkey list
|
|
|
|
for( EDA_HOTKEY** list = CurrentHotkeyList; *list != NULL; list++ )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
EDA_HOTKEY* hk_decr = *list;
|
2011-09-29 16:49:40 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
if( hk_decr->m_InfoMsg == fctname )
|
2007-08-30 08:15:05 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
int code = KeyCodeFromKeyName( keyname );
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
if( code )
|
|
|
|
hk_decr->m_KeyCode = code;
|
2008-09-03 16:19:06 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-08-21 19:37:31 +00:00
|
|
|
}
|
2007-09-19 15:29:50 +00:00
|
|
|
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
void EDA_BASE_FRAME::ImportHotkeyConfigFromFile( EDA_HOTKEY_CONFIG* aDescList,
|
|
|
|
const wxString& aDefaultShortname )
|
2007-09-19 15:29:50 +00:00
|
|
|
{
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
|
|
|
|
wxString mask = wxT( "*." ) + ext;
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
|
|
|
#if 0 // pass in the project dir as an argument
|
|
|
|
wxString path = wxPathOnly( Prj().GetProjectFullName() );
|
|
|
|
#else
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString path = wxGetCwd();
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
#endif
|
2015-03-02 17:29:18 +00:00
|
|
|
wxFileName fn( aDefaultShortname );
|
|
|
|
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
wxString filename = EDA_FileSelector( _( "Read Hotkey Configuration File:" ),
|
2010-08-28 18:02:24 +00:00
|
|
|
path,
|
2015-03-02 17:29:18 +00:00
|
|
|
fn.GetFullPath(),
|
2010-08-28 18:02:24 +00:00
|
|
|
ext,
|
|
|
|
mask,
|
|
|
|
this,
|
|
|
|
wxFD_OPEN,
|
2011-11-07 18:04:19 +00:00
|
|
|
true );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
if( filename.IsEmpty() )
|
|
|
|
return;
|
2007-09-19 15:29:50 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
ReadHotkeyConfigFile( filename, aDescList );
|
|
|
|
}
|
2007-09-19 15:29:50 +00:00
|
|
|
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
void EDA_BASE_FRAME::ExportHotkeyConfigToFile( EDA_HOTKEY_CONFIG* aDescList,
|
|
|
|
const wxString& aDefaultShortname )
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
wxString ext = DEFAULT_HOTKEY_FILENAME_EXT;
|
|
|
|
wxString mask = wxT( "*." ) + ext;
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
wxString path = wxPathOnly( Prj().GetProjectFullName() );
|
|
|
|
#else
|
2010-08-28 18:02:24 +00:00
|
|
|
wxString path = wxGetCwd();
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
#endif
|
2015-03-02 17:29:18 +00:00
|
|
|
wxFileName fn( aDefaultShortname );
|
|
|
|
fn.SetExt( DEFAULT_HOTKEY_FILENAME_EXT );
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
wxString filename = EDA_FileSelector( _( "Write Hotkey Configuration File:" ),
|
2010-08-28 18:02:24 +00:00
|
|
|
path,
|
2015-03-02 17:29:18 +00:00
|
|
|
fn.GetFullPath(),
|
2010-08-28 18:02:24 +00:00
|
|
|
ext,
|
|
|
|
mask,
|
|
|
|
this,
|
2011-11-07 18:04:19 +00:00
|
|
|
wxFD_OPEN | wxFD_SAVE,
|
|
|
|
true );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
if( filename.IsEmpty() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
WriteHotkeyConfig( aDescList, &filename );
|
2007-09-19 15:29:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-20 17:44:25 +00:00
|
|
|
/* add hotkey config options submenu to aMenu
|
2007-09-19 15:29:50 +00:00
|
|
|
*/
|
2010-01-18 12:37:53 +00:00
|
|
|
void AddHotkeyConfigMenu( wxMenu* aMenu )
|
2007-09-19 15:29:50 +00:00
|
|
|
{
|
2010-01-18 12:37:53 +00:00
|
|
|
if( aMenu == NULL )
|
|
|
|
return;
|
|
|
|
|
2010-01-20 18:59:46 +00:00
|
|
|
wxMenu* HotkeySubmenu = new wxMenu();
|
2007-09-19 15:29:50 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// List existing hotkey menu
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( HotkeySubmenu,
|
|
|
|
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&List Current Keys" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Displays the current hotkeys list and corresponding commands" ),
|
|
|
|
KiBitmap( info_xpm ) );
|
2007-11-14 16:02:19 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Call hotkeys editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Edit Hotkeys" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Call the hotkeys editor" ),
|
|
|
|
KiBitmap( editor_xpm ) );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
HotkeySubmenu->AppendSeparator();
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// create hotkey file to export current hotkeys config
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "E&xport Hotkeys" ),
|
|
|
|
_( "Create a hotkey configuration file to export the current hotkeys" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
KiBitmap( save_setup_xpm ) );
|
2007-11-14 16:02:19 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Reload hotkey file
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&Import Hotkeys" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Load an existing hotkey configuration file" ),
|
|
|
|
KiBitmap( reload_xpm ) );
|
2009-10-27 13:48:24 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// Append HotkeySubmenu to menu
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( aMenu, HotkeySubmenu,
|
2014-11-06 20:56:34 +00:00
|
|
|
wxID_ANY, _( "&Hotkeys" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Hotkeys configuration and preferences" ),
|
|
|
|
KiBitmap( hotkeys_xpm ) );
|
2007-09-22 14:31:20 +00:00
|
|
|
}
|