Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
2804d2e5
Commit
2804d2e5
authored
Mar 02, 2015
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hotkeys to Kicad manager, and some rework on hotkeys management.
parent
399ab4ba
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
282 additions
and
76 deletions
+282
-76
base_struct.cpp
common/base_struct.cpp
+4
-4
dialog_hotkeys_editor.cpp
common/dialogs/dialog_hotkeys_editor.cpp
+2
-2
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+24
-14
eeschema.cpp
eeschema/eeschema.cpp
+1
-1
eeschema_config.cpp
eeschema/eeschema_config.cpp
+4
-4
schframe.cpp
eeschema/schframe.cpp
+0
-1
schframe.h
eeschema/schframe.h
+3
-0
gerbview.cpp
gerbview/gerbview.cpp
+1
-1
gerbview_config.cpp
gerbview/gerbview_config.cpp
+2
-2
gerbview_frame.cpp
gerbview/gerbview_frame.cpp
+0
-2
gerbview_frame.h
gerbview/gerbview_frame.h
+2
-0
base_struct.h
include/base_struct.h
+3
-0
dialog_hotkeys_editor.h
include/dialog_hotkeys_editor.h
+3
-3
hotkeys_basic.h
include/hotkeys_basic.h
+4
-4
wxPcbStruct.h
include/wxPcbStruct.h
+2
-0
wxstruct.h
include/wxstruct.h
+8
-2
kicad.cpp
kicad/kicad.cpp
+6
-0
kicad.h
kicad/kicad.h
+6
-0
mainframe.cpp
kicad/mainframe.cpp
+34
-2
menubar.cpp
kicad/menubar.cpp
+161
-20
pl_editor.cpp
pagelayout_editor/pl_editor.cpp
+2
-2
pl_editor_config.cpp
pagelayout_editor/pl_editor_config.cpp
+2
-2
pl_editor_frame.cpp
pagelayout_editor/pl_editor_frame.cpp
+0
-2
pl_editor_frame.h
pagelayout_editor/pl_editor_frame.h
+2
-0
moduleframe.cpp
pcbnew/moduleframe.cpp
+2
-2
pcbframe.cpp
pcbnew/pcbframe.cpp
+0
-2
pcbnew.cpp
pcbnew/pcbnew.cpp
+2
-2
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+2
-2
No files found.
common/base_struct.cpp
View file @
2804d2e5
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 20
04
Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-201
1
KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 20
15
Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-201
5
KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -225,7 +225,7 @@ bool EDA_ITEM::operator<( const EDA_ITEM& aItem ) const
return
false
;
}
#ifdef USE_EDA_ITEM_OP_EQ // see base_struct.h for explanations
EDA_ITEM
&
EDA_ITEM
::
operator
=
(
const
EDA_ITEM
&
aItem
)
{
if
(
&
aItem
!=
this
)
...
...
@@ -241,7 +241,7 @@ EDA_ITEM& EDA_ITEM::operator=( const EDA_ITEM& aItem )
return
*
this
;
}
#endif
const
BOX2I
EDA_ITEM
::
ViewBBox
()
const
{
...
...
common/dialogs/dialog_hotkeys_editor.cpp
View file @
2804d2e5
...
...
@@ -251,7 +251,7 @@ void HOTKEY_SECTION_PAGE::Restore()
}
void
InstallHotkeyFrame
(
EDA_
DRAW
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
)
void
InstallHotkeyFrame
(
EDA_
BASE
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
)
{
HOTKEYS_EDITOR_DIALOG
dialog
(
aParent
,
aHotkeys
);
...
...
@@ -264,7 +264,7 @@ void InstallHotkeyFrame( EDA_DRAW_FRAME* aParent, EDA_HOTKEY_CONFIG* aHotkeys )
}
HOTKEYS_EDITOR_DIALOG
::
HOTKEYS_EDITOR_DIALOG
(
EDA_
DRAW
_FRAME
*
aParent
,
HOTKEYS_EDITOR_DIALOG
::
HOTKEYS_EDITOR_DIALOG
(
EDA_
BASE
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
)
:
HOTKEYS_EDITOR_DIALOG_BASE
(
aParent
),
m_parent
(
aParent
),
...
...
common/hotkeys_basic.cpp
View file @
2804d2e5
...
...
@@ -419,7 +419,7 @@ int KeyCodeFromKeyName( const wxString& keyname )
* Displays the current hotkey list
* aList = a EDA_HOTKEY_CONFIG list(Null terminated)
*/
void
DisplayHotkeyList
(
EDA_
DRAW
_FRAME
*
aFrame
,
struct
EDA_HOTKEY_CONFIG
*
aDescList
)
void
DisplayHotkeyList
(
EDA_
BASE
_FRAME
*
aFrame
,
struct
EDA_HOTKEY_CONFIG
*
aDescList
)
{
wxString
keyname
;
EDA_HOTKEY
**
list
;
...
...
@@ -534,7 +534,9 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList,
}
else
{
wxConfigBase
*
config
=
GetNewConfig
(
m_FrameName
);
wxFileName
fn
(
m_FrameName
);
fn
.
SetExt
(
DEFAULT_HOTKEY_FILENAME_EXT
);
wxConfigBase
*
config
=
GetNewConfig
(
fn
.
GetFullPath
()
);
config
->
Write
(
HOTKEYS_CONFIG_KEY
,
msg
);
delete
config
;
}
...
...
@@ -546,7 +548,10 @@ int EDA_BASE_FRAME::WriteHotkeyConfig( struct EDA_HOTKEY_CONFIG* aDescList,
int
EDA_BASE_FRAME
::
ReadHotkeyConfigFile
(
const
wxString
&
aFilename
,
struct
EDA_HOTKEY_CONFIG
*
aDescList
)
{
wxFile
cfgfile
(
aFilename
);
wxFileName
fn
(
aFilename
);
fn
.
SetExt
(
DEFAULT_HOTKEY_FILENAME_EXT
);
wxFile
cfgfile
(
fn
.
GetFullPath
()
);
if
(
!
cfgfile
.
IsOpened
()
)
// There is a problem to open file
return
0
;
...
...
@@ -574,7 +579,10 @@ int EDA_BASE_FRAME::ReadHotkeyConfigFile( const wxString& aFilename,
void
ReadHotkeyConfig
(
const
wxString
&
Appname
,
struct
EDA_HOTKEY_CONFIG
*
aDescList
)
{
wxConfigBase
*
config
=
GetNewConfig
(
Appname
);
wxFileName
fn
(
Appname
);
fn
.
SetExt
(
DEFAULT_HOTKEY_FILENAME_EXT
);
wxConfigBase
*
config
=
GetNewConfig
(
fn
.
GetFullPath
()
);
if
(
!
config
->
HasEntry
(
HOTKEYS_CONFIG_KEY
)
)
{
...
...
@@ -677,7 +685,8 @@ void ParseHotkeyConfig( const wxString& data,
}
void
EDA_BASE_FRAME
::
ImportHotkeyConfigFromFile
(
EDA_HOTKEY_CONFIG
*
aDescList
)
void
EDA_BASE_FRAME
::
ImportHotkeyConfigFromFile
(
EDA_HOTKEY_CONFIG
*
aDescList
,
const
wxString
&
aDefaultShortname
)
{
wxString
ext
=
DEFAULT_HOTKEY_FILENAME_EXT
;
wxString
mask
=
wxT
(
"*."
)
+
ext
;
...
...
@@ -687,12 +696,12 @@ void EDA_BASE_FRAME::ImportHotkeyConfigFromFile( EDA_HOTKEY_CONFIG* aDescList )
#else
wxString
path
=
wxGetCwd
();
#endif
wxFileName
fn
(
aDefaultShortname
);
fn
.
SetExt
(
DEFAULT_HOTKEY_FILENAME_EXT
);
wxString
filename
=
Kiface
().
Name
()
+
wxT
(
'.'
)
+
ext
;
filename
=
EDA_FileSelector
(
_
(
"Read Hotkey Configuration File:"
),
wxString
filename
=
EDA_FileSelector
(
_
(
"Read Hotkey Configuration File:"
),
path
,
f
ilename
,
f
n
.
GetFullPath
()
,
ext
,
mask
,
this
,
...
...
@@ -706,7 +715,8 @@ void EDA_BASE_FRAME::ImportHotkeyConfigFromFile( EDA_HOTKEY_CONFIG* aDescList )
}
void
EDA_BASE_FRAME
::
ExportHotkeyConfigToFile
(
EDA_HOTKEY_CONFIG
*
aDescList
)
void
EDA_BASE_FRAME
::
ExportHotkeyConfigToFile
(
EDA_HOTKEY_CONFIG
*
aDescList
,
const
wxString
&
aDefaultShortname
)
{
wxString
ext
=
DEFAULT_HOTKEY_FILENAME_EXT
;
wxString
mask
=
wxT
(
"*."
)
+
ext
;
...
...
@@ -716,12 +726,12 @@ void EDA_BASE_FRAME::ExportHotkeyConfigToFile( EDA_HOTKEY_CONFIG* aDescList )
#else
wxString
path
=
wxGetCwd
();
#endif
wxFileName
fn
(
aDefaultShortname
);
fn
.
SetExt
(
DEFAULT_HOTKEY_FILENAME_EXT
);
wxString
filename
=
Kiface
().
Name
()
+
wxT
(
"."
)
+
ext
;
filename
=
EDA_FileSelector
(
_
(
"Write Hotkey Configuration File:"
),
wxString
filename
=
EDA_FileSelector
(
_
(
"Write Hotkey Configuration File:"
),
path
,
f
ilename
,
f
n
.
GetFullPath
()
,
ext
,
mask
,
this
,
...
...
eeschema/eeschema.cpp
View file @
2804d2e5
...
...
@@ -229,7 +229,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig
(
wxT
(
"SchematicFrame"
)
,
g_Eeschema_Hokeys_Descr
);
ReadHotkeyConfig
(
SCH_EDIT_FRAME_NAME
,
g_Eeschema_Hokeys_Descr
);
wxConfigLoadSetups
(
KifaceSettings
(),
cfg_params
()
);
...
...
eeschema/eeschema_config.cpp
View file @
2804d2e5
...
...
@@ -177,11 +177,11 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
break
;
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
g_Eeschema_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
g_Eeschema_Hokeys_Descr
,
wxT
(
"eeschema"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
g_Eeschema_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
g_Eeschema_Hokeys_Descr
,
wxT
(
"eeschema"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST
:
...
...
@@ -282,11 +282,11 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
// Hotkey IDs
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
g_Eeschema_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
g_Eeschema_Hokeys_Descr
,
wxT
(
"eeschema"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
g_Eeschema_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
g_Eeschema_Hokeys_Descr
,
wxT
(
"eeschema"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
...
...
eeschema/schframe.cpp
View file @
2804d2e5
...
...
@@ -301,7 +301,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
END_EVENT_TABLE
()
#define SCH_EDIT_FRAME_NAME wxT( "SchematicFrame" )
SCH_EDIT_FRAME
::
SCH_EDIT_FRAME
(
KIWAY
*
aKiway
,
wxWindow
*
aParent
)
:
SCH_BASE_FRAME
(
aKiway
,
aParent
,
FRAME_SCH
,
wxT
(
"Eeschema"
),
...
...
eeschema/schframe.h
View file @
2804d2e5
...
...
@@ -30,6 +30,7 @@
#ifndef WX_EESCHEMA_STRUCT_H
#define WX_EESCHEMA_STRUCT_H
#include <sch_base_frame.h>
#include <config_params.h>
#include <class_undoredo_container.h>
...
...
@@ -106,6 +107,8 @@ enum SCH_SEARCH_T {
};
#define SCH_EDIT_FRAME_NAME wxT( "SchematicFrame" )
/**
* Schematic editor (Eeschema) main window.
*/
...
...
gerbview/gerbview.cpp
View file @
2804d2e5
...
...
@@ -140,7 +140,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig
(
wxT
(
"GerberFrame"
)
,
s_Gerbview_Hokeys_Descr
);
ReadHotkeyConfig
(
GERBVIEW_FRAME_NAME
,
s_Gerbview_Hokeys_Descr
);
return
true
;
}
...
...
gerbview/gerbview_config.cpp
View file @
2804d2e5
...
...
@@ -55,11 +55,11 @@ void GERBVIEW_FRAME::Process_Config( wxCommandEvent& event )
{
// Hotkey IDs
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
s_Gerbview_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
s_Gerbview_Hokeys_Descr
,
wxT
(
"gerbview"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
s_Gerbview_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
s_Gerbview_Hokeys_Descr
,
wxT
(
"gerbview"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
...
...
gerbview/gerbview_frame.cpp
View file @
2804d2e5
...
...
@@ -62,8 +62,6 @@ static const wxString cfgShowBorderAndTitleBlock( wxT( "ShowBorderAndTitleBloc
/* class GERBVIEW_FRAME for GerbView */
/*************************************/
#define GERBVIEW_FRAME_NAME wxT( "GerberFrame" )
GERBVIEW_FRAME
::
GERBVIEW_FRAME
(
KIWAY
*
aKiway
,
wxWindow
*
aParent
)
:
EDA_DRAW_FRAME
(
aKiway
,
aParent
,
FRAME_GERBER
,
wxT
(
"GerbView"
),
wxDefaultPosition
,
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
GERBVIEW_FRAME_NAME
)
...
...
gerbview/gerbview_frame.h
View file @
2804d2e5
...
...
@@ -81,6 +81,8 @@ public:
* is the main window used in GerbView.
*/
#define GERBVIEW_FRAME_NAME wxT( "GerberFrame" )
class
GERBVIEW_FRAME
:
public
EDA_DRAW_FRAME
// PCB_BASE_FRAME
{
GBR_LAYOUT
*
m_gerberLayout
;
...
...
include/base_struct.h
View file @
2804d2e5
...
...
@@ -488,6 +488,7 @@ public:
*/
static
bool
Sort
(
const
EDA_ITEM
*
aLeft
,
const
EDA_ITEM
*
aRight
)
{
return
*
aLeft
<
*
aRight
;
}
#if 0
/**
* Operator assignment
* is used to assign the members of \a aItem to another object.
...
...
@@ -496,6 +497,8 @@ public:
* as there is a known issue with wxString buffers.
*/
virtual EDA_ITEM& operator=( const EDA_ITEM& aItem );
#define USE_EDA_ITEM_OP_EQ
#endif
/// @copydoc VIEW_ITEM::ViewBBox()
virtual
const
BOX2I
ViewBBox
()
const
;
...
...
include/dialog_hotkeys_editor.h
View file @
2804d2e5
...
...
@@ -198,13 +198,13 @@ public:
class
HOTKEYS_EDITOR_DIALOG
:
public
HOTKEYS_EDITOR_DIALOG_BASE
{
protected
:
EDA_
DRAW
_FRAME
*
m_parent
;
EDA_
BASE
_FRAME
*
m_parent
;
struct
EDA_HOTKEY_CONFIG
*
m_hotkeys
;
std
::
vector
<
HOTKEY_SECTION_PAGE
*>
m_hotkeySectionPages
;
public
:
HOTKEYS_EDITOR_DIALOG
(
EDA_
DRAW
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
);
HOTKEYS_EDITOR_DIALOG
(
EDA_
BASE
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
);
~
HOTKEYS_EDITOR_DIALOG
()
{};
...
...
@@ -259,6 +259,6 @@ private:
* @param aParent is the parent window
* @param aHotkeys is the hotkey configuration array
*/
void
InstallHotkeyFrame
(
EDA_
DRAW
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
);
void
InstallHotkeyFrame
(
EDA_
BASE
_FRAME
*
aParent
,
EDA_HOTKEY_CONFIG
*
aHotkeys
);
#endif
include/hotkeys_basic.h
View file @
2804d2e5
...
...
@@ -29,10 +29,10 @@
#ifndef HOTKEYS_BASIC_H
#define HOTKEYS_BASIC_H
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( "
key
" )
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( "
hotkeys
" )
class
EDA_
DRAW
_FRAME
;
class
EDA_
BASE
_FRAME
;
/* Identifiers (tags) in key code configuration file (or section names)
...
...
@@ -116,7 +116,7 @@ public:
/* Functions:
*/
void
AddHotkeyConfigMenu
(
wxMenu
*
menu
);
void
HandleHotkeyConfigMenuSelection
(
EDA_
DRAW
_FRAME
*
frame
,
int
id
);
void
HandleHotkeyConfigMenuSelection
(
EDA_
BASE
_FRAME
*
frame
,
int
id
);
/**
* Function KeyNameFromKeyCode
...
...
@@ -196,7 +196,7 @@ wxString AddHotkeyName( const wxString& aText,
* @param aFrame = current active frame
* @param aList = pointer to a EDA_HOTKEY_CONFIG list (Null terminated)
*/
void
DisplayHotkeyList
(
EDA_
DRAW
_FRAME
*
aFrame
,
struct
EDA_HOTKEY_CONFIG
*
aList
);
void
DisplayHotkeyList
(
EDA_
BASE
_FRAME
*
aFrame
,
struct
EDA_HOTKEY_CONFIG
*
aList
);
/**
* Function GetDescriptorFromHotkey
...
...
include/wxPcbStruct.h
View file @
2804d2e5
...
...
@@ -73,6 +73,8 @@ namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
*
* See also class PCB_BASE_FRAME(): Basic class for Pcbnew and GerbView.
*/
#define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
class
PCB_EDIT_FRAME
:
public
PCB_BASE_EDIT_FRAME
{
friend
struct
PCB
::
IFACE
;
...
...
include/wxstruct.h
View file @
2804d2e5
...
...
@@ -291,15 +291,21 @@ public:
* Function ImportHotkeyConfigFromFile
* Prompt the user for an old hotkey file to read, and read it.
* @param aDescList = current hotkey list descr. to initialize.
* @param aDefaultShortname = a default short name (extention not needed)
* like eechema, kicad...
*/
void
ImportHotkeyConfigFromFile
(
EDA_HOTKEY_CONFIG
*
aDescList
);
void
ImportHotkeyConfigFromFile
(
EDA_HOTKEY_CONFIG
*
aDescList
,
const
wxString
&
aDefaultShortname
);
/**
* Function ExportHotkeyConfigToFile
* Prompt the user for an old hotkey file to read, and read it.
* @param aDescList = current hotkey list descr. to initialize.
* @param aDefaultShortname = a default short name (extention not needed)
* like eechema, kicad...
*/
void
ExportHotkeyConfigToFile
(
EDA_HOTKEY_CONFIG
*
aDescList
);
void
ExportHotkeyConfigToFile
(
EDA_HOTKEY_CONFIG
*
aDescList
,
const
wxString
&
aDefaultShortname
);
/**
* Function GetFileFromHistory
...
...
kicad/kicad.cpp
View file @
2804d2e5
...
...
@@ -38,6 +38,7 @@
#include <online_help.h>
#include <wildcards_and_files_ext.h>
#include <boost/ptr_container/ptr_vector.hpp>
#include <hotkeys_basic.h>
#include <build_version.h>
...
...
@@ -137,6 +138,11 @@ bool PGM_KICAD::OnPgmInit( wxApp* aWxApp )
//DBG( m_bm.m_search.Show( (std::string( __func__ ) + " SysSearch()").c_str() );)
}
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
extern
struct
EDA_HOTKEY_CONFIG
kicad_Manager_Hokeys_Descr
[];
ReadHotkeyConfig
(
KICAD_MANAGER_FRAME_NAME
,
kicad_Manager_Hokeys_Descr
);
KICAD_MANAGER_FRAME
*
frame
=
new
KICAD_MANAGER_FRAME
(
NULL
,
wxT
(
"KiCad"
),
wxDefaultPosition
,
wxDefaultSize
);
App
().
SetTopWindow
(
frame
);
...
...
kicad/kicad.h
View file @
2804d2e5
...
...
@@ -46,6 +46,8 @@
#define KICAD_USE_FILES_WATCHER
#endif
#define KICAD_MANAGER_FRAME_NAME wxT( "KicadFrame" )
class
LAUNCHER_PANEL
;
class
TREEPROJECTFILES
;
class
TREE_PROJECT_FRAME
;
...
...
@@ -190,6 +192,9 @@ public:
void
OnFileHistory
(
wxCommandEvent
&
event
);
void
OnExit
(
wxCommandEvent
&
event
);
void
Process_Preferences
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
ReCreateMenuBar
();
void
RecreateBaseHToolbar
();
...
...
@@ -292,6 +297,7 @@ private:
wxAuiToolBar
*
m_VToolBar
;
// Vertical toolbar (not used)
int
m_leftWinWidth
;
EDA_HOTKEY_CONFIG
*
m_manager_Hokeys_Descr
;
void
language_change
(
wxCommandEvent
&
event
);
};
...
...
kicad/mainframe.cpp
View file @
2804d2e5
...
...
@@ -40,17 +40,19 @@
#include <tree_project_frame.h>
#include <wildcards_and_files_ext.h>
#include <menus_helpers.h>
#include <dialog_hotkeys_editor.h>
#define TREE_FRAME_WIDTH_ENTRY wxT( "LeftWinWidth" )
KICAD_MANAGER_FRAME
::
KICAD_MANAGER_FRAME
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
)
:
EDA_BASE_FRAME
(
parent
,
KICAD_MAIN_FRAME_T
,
title
,
pos
,
size
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
wxT
(
"KicadFrame"
)
)
KICAD_DEFAULT_DRAWFRAME_STYLE
,
KICAD_MANAGER_FRAME_NAME
)
{
m_leftWinWidth
=
60
;
m_manager_Hokeys_Descr
=
NULL
;
m_FrameName
=
KICAD_MANAGER_FRAME_NAME
;
// Create the status line (bottom of the frame
static
const
int
dims
[
3
]
=
{
-
1
,
-
1
,
100
};
...
...
@@ -529,3 +531,33 @@ void KICAD_MANAGER_FRAME::PrintPrjInfo()
PrintMsg
(
msg
);
}
void
KICAD_MANAGER_FRAME
::
Process_Config
(
wxCommandEvent
&
event
)
{
int
id
=
event
.
GetId
();
wxFileName
fn
;
switch
(
id
)
{
// Hotkey IDs
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
InstallHotkeyFrame
(
this
,
m_manager_Hokeys_Descr
);
break
;
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
m_manager_Hokeys_Descr
,
wxT
(
"kicad"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
m_manager_Hokeys_Descr
,
wxT
(
"kicad"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST
:
// Display current hotkey list for LibEdit.
DisplayHotkeyList
(
this
,
m_manager_Hokeys_Descr
);
break
;
default
:
wxFAIL_MSG
(
wxT
(
"KICAD_MANAGER_FRAME::Process_Config error"
)
);
break
;
}
}
kicad/menubar.cpp
View file @
2804d2e5
This diff is collapsed.
Click to expand it.
pagelayout_editor/pl_editor.cpp
View file @
2804d2e5
...
...
@@ -122,7 +122,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig
(
wxT
(
"PlEditorFrame"
)
,
s_PlEditor_Hokeys_Descr
);
ReadHotkeyConfig
(
PL_EDITOR_FRAME_NAME
,
s_PlEditor_Hokeys_Descr
);
g_UserUnit
=
MILLIMETRES
;
...
...
@@ -159,7 +159,7 @@ bool MYFACE::OnKifaceStart( PGM_BASE* aProgram )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig(
wxT("PlEditorFrame")
, s_PlEditor_Hokeys_Descr );
ReadHotkeyConfig(
PL_EDITOR_FRAME_NAME
, s_PlEditor_Hokeys_Descr );
PL_EDITOR_FRAME * frame = new PL_EDITOR_FRAME( NULL, wxT( "PlEditorFrame" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
...
...
pagelayout_editor/pl_editor_config.cpp
View file @
2804d2e5
...
...
@@ -74,11 +74,11 @@ void PL_EDITOR_FRAME::Process_Config( wxCommandEvent& event )
break
;
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
s_PlEditor_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
s_PlEditor_Hokeys_Descr
,
wxT
(
"pl_editor"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
s_PlEditor_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
s_PlEditor_Hokeys_Descr
,
wxT
(
"pl_editor"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST
:
...
...
pagelayout_editor/pl_editor_frame.cpp
View file @
2804d2e5
...
...
@@ -50,8 +50,6 @@
/* class PL_EDITOR_FRAME */
/*************************/
#define PL_EDITOR_FRAME_NAME wxT( "PlEditorFrame" )
PL_EDITOR_FRAME
::
PL_EDITOR_FRAME
(
KIWAY
*
aKiway
,
wxWindow
*
aParent
)
:
EDA_DRAW_FRAME
(
aKiway
,
aParent
,
FRAME_PL_EDITOR
,
wxT
(
"PlEditorFrame"
),
wxDefaultPosition
,
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
PL_EDITOR_FRAME_NAME
)
...
...
pagelayout_editor/pl_editor_frame.h
View file @
2804d2e5
...
...
@@ -45,6 +45,8 @@ class WORKSHEET_DATAITEM;
* Class PL_EDITOR_FRAME
* is the main window used in the page layout editor.
*/
#define PL_EDITOR_FRAME_NAME wxT( "PlEditorFrame" )
class
PL_EDITOR_FRAME
:
public
EDA_DRAW_FRAME
{
PL_EDITOR_LAYOUT
m_pageLayout
;
...
...
pcbnew/moduleframe.cpp
View file @
2804d2e5
...
...
@@ -835,11 +835,11 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event )
{
// Hotkey IDs
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
g_Module_Editor_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
g_Module_Editor_Hokeys_Descr
,
wxT
(
"pcbnew"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
g_Module_Editor_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
g_Module_Editor_Hokeys_Descr
,
wxT
(
"pcbnew"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
...
...
pcbnew/pcbframe.cpp
View file @
2804d2e5
...
...
@@ -310,8 +310,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
END_EVENT_TABLE
()
#define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
PCB_EDIT_FRAME
::
PCB_EDIT_FRAME
(
KIWAY
*
aKiway
,
wxWindow
*
aParent
)
:
PCB_BASE_EDIT_FRAME
(
aKiway
,
aParent
,
FRAME_PCB
,
wxT
(
"Pcbnew"
),
wxDefaultPosition
,
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
PCB_EDIT_FRAME_NAME
)
...
...
pcbnew/pcbnew.cpp
View file @
2804d2e5
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 201
2 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble
.fr
* Copyright (C) 201
5 Jean-Pierre Charras, jp.charras at wanadoo
.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
*
...
...
@@ -307,7 +307,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig
(
wxT
(
"PcbFrame"
)
,
g_Board_Editor_Hokeys_Descr
);
ReadHotkeyConfig
(
PCB_EDIT_FRAME_NAME
,
g_Board_Editor_Hokeys_Descr
);
try
{
...
...
pcbnew/pcbnew_config.cpp
View file @
2804d2e5
...
...
@@ -227,11 +227,11 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
// Hotkey IDs
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
g_Board_Editor_Hokeys_Descr
);
ExportHotkeyConfigToFile
(
g_Board_Editor_Hokeys_Descr
,
wxT
(
"pcbnew"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_IMPORT_CONFIG
:
ImportHotkeyConfigFromFile
(
g_Board_Editor_Hokeys_Descr
);
ImportHotkeyConfigFromFile
(
g_Board_Editor_Hokeys_Descr
,
wxT
(
"pcbnew"
)
);
break
;
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment