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
e27d3f8c
Commit
e27d3f8c
authored
Sep 06, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more work on programmable hotkeys. Most of features are ok.
parent
4a8bf70d
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
365 additions
and
159 deletions
+365
-159
change_log.txt
change_log.txt
+8
-0
common.cpp
common/common.cpp
+1
-16
edaappl.cpp
common/edaappl.cpp
+1
-0
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+112
-38
eeconfig.cpp
eeschema/eeconfig.cpp
+3
-13
hotkeys.cpp
eeschema/hotkeys.cpp
+57
-22
hotkeys.h
eeschema/hotkeys.h
+6
-4
onrightclick.cpp
eeschema/onrightclick.cpp
+5
-5
tool_lib.cpp
eeschema/tool_lib.cpp
+3
-3
tool_sch.cpp
eeschema/tool_sch.cpp
+3
-3
build_version.h
include/build_version.h
+1
-1
common.h
include/common.h
+1
-1
hotkeys_basic.h
include/hotkeys_basic.h
+53
-1
wxstruct.h
include/wxstruct.h
+2
-2
libs.win
libs.win
+1
-1
hotkeys.cpp
pcbnew/hotkeys.cpp
+61
-24
hotkeys.h
pcbnew/hotkeys.h
+14
-4
pcbcfg.cpp
pcbnew/pcbcfg.cpp
+3
-13
tool_modedit.cpp
pcbnew/tool_modedit.cpp
+3
-3
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+27
-5
No files found.
change_log.txt
View file @
e27d3f8c
...
...
@@ -4,6 +4,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-sept-6 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema & pcbnew
Programmable hotkeys update.
some features are still subject to change (mainly path for config files: see 2007-aug-30 UPDATE))
The preference menu has a command to create and reread config hotkey files.
the hotkey ? lists the current hotkeys.
2007-Sep-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
...
...
common/common.cpp
View file @
e27d3f8c
...
...
@@ -265,7 +265,7 @@ void MyFree( void* pt_mem )
/**************************************************************/
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
,
bool
is_gui
)
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
)
/**************************************************************/
/* Return the name of the layer number "layer_number".
...
...
@@ -305,21 +305,6 @@ wxString ReturnPcbLayerName( int layer_number, bool is_filename, bool is_gui )
else
layer_name
=
layer_name_list
[
layer_number
];
if
(
is_gui
)
{
static
const
wxString
hotkey_list
[]
=
{
wxT
(
"(PgDn)"
),
wxT
(
"(F5)"
),
wxT
(
"(F6)"
),
wxT
(
"(F7)"
),
wxT
(
"(F8)"
),
wxT
(
"(F9)"
),
wxT
(
"(F10)"
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" (PgUp)"
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
),
wxT
(
" "
)
};
layer_name
+=
wxT
(
" "
)
+
hotkey_list
[
layer_number
];
}
return
layer_name
;
}
...
...
common/edaappl.cpp
View file @
e27d3f8c
...
...
@@ -26,6 +26,7 @@
#include "worksheet.h"
#include "id.h"
#include "build_version.h"
#include "hotkeys_basic.h"
#include "bitmaps.h"
#include "Language.xpm"
...
...
common/hotkeys_basic.cpp
View file @
e27d3f8c
...
...
@@ -4,6 +4,7 @@
/* Some functions to handle hotkeys in kicad
*/
#include "fctsys.h"
#include "common.h"
#include "wxstruct.h"
...
...
@@ -11,7 +12,7 @@
#include "macros.h"
/* Class to handle hotkey commnands. hotkeys have a default value
* This class allows
(for the future..) the real key code changed by user(from a key code list file, TODO)
* This class allows
the real key code changed by user from a key code list file
*/
Ki_HotkeyInfo
::
Ki_HotkeyInfo
(
const
wxChar
*
infomsg
,
int
idcommand
,
int
keycode
)
...
...
@@ -30,7 +31,8 @@ struct hotkey_name_descr
int
m_KeyCode
;
};
struct
hotkey_name_descr
s_Hotkey_Name_List
[]
=
static
struct
hotkey_name_descr
s_Hotkey_Name_List
[]
=
{
{
wxT
(
"F1"
),
WXK_F1
},
{
wxT
(
"F2"
),
WXK_F2
},
...
...
@@ -136,7 +138,7 @@ wxString ReturnKeyNameFromKeyCode( int keycode )
/*
* return the key name from the key code
* Only some wxWidgets key values are handled for function key
* Only some wxWidgets key values are handled for function key
( see s_Hotkey_Name_List[] )
* @param key = key code (ascii value, or wxWidgets value for function keys)
* @return the key name in a wxString
*/
...
...
@@ -191,9 +193,41 @@ wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List, int CommandI
}
/***********************************************************************/
/***********************************************************/
wxString
AddHotkeyName
(
const
wxString
&
text
,
struct
Ki_HotkeyInfoSectionDescriptor
*
DescList
,
int
CommandId
)
/***********************************************************/
/*
* Add the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfoSectionDescriptor* DescrList of commands
* @param CommandId = Command Id value
* @return text (key name) in a wxString if found or text without modification
*/
{
wxString
msg
=
text
;
wxString
keyname
;
Ki_HotkeyInfo
**
List
;
for
(
;
DescList
->
m_HK_InfoList
!=
NULL
;
DescList
++
)
{
List
=
DescList
->
m_HK_InfoList
;
keyname
=
ReturnKeyNameFromCommandId
(
List
,
CommandId
);
if
(
!
keyname
.
IsEmpty
()
)
{
msg
<<
wxT
(
" ("
)
<<
keyname
<<
wxT
(
")"
);
break
;
}
}
return
msg
;
}
/*************************************************************************/
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
)
/***********************************************************************/
/***********************************************************************
**
/
/*
* return the key name from the Command id value ( m_Idcommand member value)
...
...
@@ -225,7 +259,7 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname )
/*
* return the key code from its key name
* Only some wxWidgets key values are handled for function key
* @param keyname = wxString key name to find in s_Hotkey_Name_List[]
* @param keyname = wxString key name to find in s_Hotkey_Name_List[]
, like F2 or space or an usual (ascii) char
* @return the key code
*/
{
...
...
@@ -246,21 +280,25 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname )
}
/****************************************************************************/
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
Ki_HotkeyInfo
**
List
)
/*****************************************************************************/
/****************************************************************************
****************
/
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
struct
Ki_HotkeyInfoSectionDescriptor
*
Desc
List
)
/*****************************************************************************
**********
/
/*
* Displays the current hotkey list
* @param frame = current
open
frame
* @param List = pointer to a Ki_HotkeyInfo
list of commands
* @param frame = current
active
frame
* @param List = pointer to a Ki_HotkeyInfo
SectionDescriptor list (Null terminated)
* @return none
*/
{
wxString
keyname
;
Ki_HotkeyInfo
**
List
;
wxString
msg
=
_
(
"Current hotkey list:
\n\n
"
);
for
(
;
DescList
->
m_HK_InfoList
!=
NULL
;
DescList
++
)
{
List
=
DescList
->
m_HK_InfoList
;
for
(
;
*
List
!=
NULL
;
List
++
)
{
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
...
...
@@ -268,6 +306,7 @@ void DisplayHotkeyList( WinEDA_DrawFrame* frame, Ki_HotkeyInfo** List )
keyname
=
ReturnKeyNameFromKeyCode
(
hk_decr
->
m_KeyCode
);
msg
+=
keyname
+
wxT
(
": "
)
+
hk_decr
->
m_InfoMsg
+
wxT
(
"
\n
"
);
}
}
DisplayInfo
(
frame
,
msg
);
}
...
...
@@ -297,7 +336,8 @@ int GetCommandCodeFromHotkey( int key, Ki_HotkeyInfo** List )
/*************************************************************************/
int
WinEDA_BasicFrame
::
WriteHotkeyConfigFile
(
const
wxString
&
Filename
,
Ki_HotkeyInfo
**
List
,
bool
verbose
)
struct
Ki_HotkeyInfoSectionDescriptor
*
DescList
,
bool
verbose
)
/*************************************************************************/
/*
...
...
@@ -371,13 +411,25 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString& Filename,
}
}
/* print the last line */
/* print the last line
of the info section
*/
if
(
!
msg
.
IsEmpty
()
)
msg
+=
wxT
(
"
\n
"
);
msg
+=
wxT
(
"#
\n
#
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
/* Print the current list */
/* Print the current hotkey list */
Ki_HotkeyInfo
**
List
;
for
(
;
DescList
->
m_HK_InfoList
!=
NULL
;
DescList
++
)
{
if
(
DescList
->
m_Comment
)
{
fprintf
(
cfgfile
,
"# "
);
fprintf
(
cfgfile
,
DescList
->
m_Comment
);
fprintf
(
cfgfile
,
"
\n
"
);
}
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
*
DescList
->
m_SectionTag
)
);
fprintf
(
cfgfile
,
"
\n
"
);
List
=
DescList
->
m_HK_InfoList
;
for
(
;
*
List
!=
NULL
;
List
++
)
{
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
...
...
@@ -389,6 +441,7 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString& Filename,
msg
+=
keyname
+
wxT
(
": "
)
+
infokey
+
wxT
(
"
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
}
}
msg
=
wxT
(
"$Endlist
\n
"
);
fprintf
(
cfgfile
,
CONV_TO_UTF8
(
msg
)
);
...
...
@@ -399,15 +452,17 @@ int WinEDA_BasicFrame::WriteHotkeyConfigFile( const wxString& Filename,
/********************************************************************************************/
int
WinEDA_BasicFrame
::
ReadHotkeyConfigFile
(
const
wxString
&
Filename
,
Ki_HotkeyInfo
**
CurrentHotkeyList
,
bool
verbose
)
struct
Ki_HotkeyInfoSectionDescriptor
*
DescList
,
bool
verbose
)
/********************************************************************************************/
/*
* Read a configuration file (<file>.key) and fill the current hotkey list with hotkeys
* @param Filename = default full file name to create. If void, A filename will be asked
* @param
CurrentHotkeyList = current hotkey list
to initialise.
* @param
DescList = current hotkey list descr.
to initialise.
* the input format is: shortcut "key" "function"
* lines starting by # are ignored (comments)
* lines like [xxx] are tags (example: [common] or [libedit] which identify sections
*
*/
{
...
...
@@ -449,16 +504,35 @@ int WinEDA_BasicFrame::ReadHotkeyConfigFile( const wxString& Filename,
wxString
keyname
;
char
Line
[
1024
];
int
LineNum
=
0
;
Ki_HotkeyInfo
**
CurrentHotkeyList
=
NULL
;
/* Read the file */
while
(
GetLine
(
cfgfile
,
Line
,
&
LineNum
)
!=
NULL
)
{
char
*
line_type
,
*
keyname
,
*
fctname
;
line_type
=
strtok
(
Line
,
"
\t\n\r
"
);
msg
=
CONV_FROM_UTF8
(
line_type
);
if
(
msg
[
0
]
==
'['
)
// A tag is found. search infos in list
{
CurrentHotkeyList
=
NULL
;
Ki_HotkeyInfoSectionDescriptor
*
DList
=
DescList
;
for
(
;
DList
->
m_HK_InfoList
!=
NULL
;
DList
++
)
{
if
(
*
DList
->
m_SectionTag
==
msg
)
{
CurrentHotkeyList
=
DList
->
m_HK_InfoList
;
break
;
}
}
continue
;
}
if
(
msg
!=
wxT
(
"shortcut"
)
)
continue
;
if
(
msg
==
wxT
(
"$Endlist"
)
)
break
;
if
(
CurrentHotkeyList
==
NULL
)
continue
;
/* Get the key name */
strtok
(
NULL
,
"
\"\n\r
"
);
...
...
eeschema/eeconfig.cpp
View file @
e27d3f8c
...
...
@@ -11,12 +11,10 @@
#include "eeconfig.h"
#include "worksheet.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "id.h"
extern
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[];
extern
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[];
/* Variables locales */
...
...
@@ -80,11 +78,7 @@ wxString FullFileName;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_Schematic_Hotkey_List
,
true
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"libedit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_LibEdit_Hotkey_List
,
true
);
WriteHotkeyConfigFile
(
FullFileName
,
s_Eeschema_Hokeys_Descr
,
true
);
break
;
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
...
...
@@ -107,11 +101,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Schematic_Hotkey_List
,
verbose
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"libedit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_LibEdit_Hotkey_List
,
verbose
);
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Eeschema_Hokeys_Descr
,
verbose
);
return
TRUE
;
}
...
...
eeschema/hotkeys.cpp
View file @
e27d3f8c
...
...
@@ -24,7 +24,8 @@
* "Command Label" is the name used in hotkey list display, and the identifier in the hotkey list file
* MY_NEW_ID_FUNCTION is an equivalent id function used in the switch in OnHotKey() function.
* default key value is the default hotkey for this command. Can be overrided by the user hotkey list file
* add the HkMyNewEntry pointer in the s_Schematic_Hotkey_List list ( or/and the s_LibEdit_Hotkey_List list)
* add the HkMyNewEntry pointer in the s_Schematic_Hotkey_List list or the s_LibEdit_Hotkey_List list
* ( or s_Common_Hotkey_List if the same command is added both in eeschema and libedit)
* Add the new code in the switch in OnHotKey() function.
* when the variable PopupOn is true, an item is currently edited.
* This can be usefull if the new function cannot be executed while an item is currently being edited
...
...
@@ -38,6 +39,15 @@
/* local variables */
/* Hotkey list: */
// Common commands
static
Ki_HotkeyInfo
HkZoomCenter
(
wxT
(
"Zoom Center"
),
HK_ZOOM_CENTER
,
WXK_F4
);
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
WXK_F3
);
static
Ki_HotkeyInfo
HkZoomOut
(
wxT
(
"Zoom Out"
),
HK_ZOOM_OUT
,
WXK_F2
);
static
Ki_HotkeyInfo
HkZoomIn
(
wxT
(
"Zoom In"
),
HK_ZOOM_IN
,
WXK_F1
);
static
Ki_HotkeyInfo
HkHelp
(
wxT
(
"Help: this message"
),
HK_HELP
,
'?'
);
static
Ki_HotkeyInfo
HkResetLocalCoord
(
wxT
(
"Reset local coord."
),
HK_RESET_LOCAL_COORD
,
' '
);
// Schematic editor
static
Ki_HotkeyInfo
HkBeginWire
(
wxT
(
"begin Wire"
),
HK_BEGIN_WIRE
,
'W'
);
static
Ki_HotkeyInfo
HkAddComponent
(
wxT
(
"Add Component"
),
HK_ADD_NEW_COMPONENT
,
'A'
);
static
Ki_HotkeyInfo
HkMirrorYComponent
(
wxT
(
...
...
@@ -54,19 +64,24 @@ static Ki_HotkeyInfo HkMove2Drag( wxT(
HK_MOVEBLOCK_TO_DRAGBLOCK
,
'\t'
);
static
Ki_HotkeyInfo
HkInsert
(
wxT
(
"Repeat Last Item"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
static
Ki_HotkeyInfo
HkDelete
(
wxT
(
"Delete Item"
),
HK_DELETE
,
WXK_DELETE
);
static
Ki_HotkeyInfo
HkResetLocalCoord
(
wxT
(
"Reset local coord."
),
HK_RESET_LOCAL_COORD
,
' '
);
static
Ki_HotkeyInfo
HkNextSearch
(
wxT
(
"Next Search"
),
HK_NEXT_SEARCH
,
WXK_F5
);
static
Ki_HotkeyInfo
HkZoomCenter
(
wxT
(
"Zoom Center"
),
HK_ZOOM_CENTER
,
WXK_F4
);
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
WXK_F3
);
static
Ki_HotkeyInfo
HkZoomOut
(
wxT
(
"Zoom Out"
),
HK_ZOOM_OUT
,
WXK_F2
);
static
Ki_HotkeyInfo
HkZoomIn
(
wxT
(
"Zoom In"
),
HK_ZOOM_IN
,
WXK_F1
);
static
Ki_HotkeyInfo
HkHelp
(
wxT
(
"Help: this message"
),
HK_HELP
,
'?'
);
// List of hotkey descriptors for schematic
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[]
=
{
// Library editor:
static
Ki_HotkeyInfo
HkInsertPin
(
wxT
(
"Repeat Pin"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
// List of common hotkey descriptors
Ki_HotkeyInfo
*
s_Common_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkNextSearch
,
&
HkResetLocalCoord
,
&
HkResetLocalCoord
,
NULL
};
// List of hotkey descriptors for schematic
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[]
=
{
&
HkNextSearch
,
&
HkDelete
,
&
HkInsert
,
&
HkMove2Drag
,
&
HkMoveComponent
,
&
HkAddComponent
,
&
HkRotateComponent
,
&
HkMirrorXComponent
,
&
HkMirrorYComponent
,
&
HkOrientNormalComponent
,
...
...
@@ -74,25 +89,41 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = {
NULL
};
// Library editor:
static
Ki_HotkeyInfo
HkInsertPin
(
wxT
(
"Repeat Pin"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
// List of hotkey descriptors for libray editor
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkResetLocalCoord
,
&
HkInsertPin
,
NULL
};
// list of sections and corresponding hotkey list for eeschema (used to create an hotkey config file)
struct
Ki_HotkeyInfoSectionDescriptor
s_Eeschema_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
"Common keys"
},
{
&
g_SchematicSectionTag
,
s_Schematic_Hotkey_List
,
"Schematic editor keys"
},
{
&
g_LibEditSectionTag
,
s_LibEdit_Hotkey_List
,
"library editor keys"
},
NULL
,
NULL
};
// list of sections and corresponding hotkey list for the schematic editor (used to list current hotkeys)
struct
Ki_HotkeyInfoSectionDescriptor
s_Schematic_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
NULL
},
{
&
g_SchematicSectionTag
,
s_Schematic_Hotkey_List
,
NULL
},
NULL
,
NULL
};
// list of sections and corresponding hotkey list for the component editor (used to list current hotkeys)
struct
Ki_HotkeyInfoSectionDescriptor
s_Libedit_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
NULL
},
{
&
g_LibEditSectionTag
,
s_LibEdit_Hotkey_List
,
NULL
},
NULL
,
NULL
};
/***********************************************************/
void
WinEDA_SchematicFrame
::
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
)
/***********************************************************/
/* Hot keys. Some commands are relative
s
to the item under the mouse cursor
/* Hot keys. Some commands are relative to the item under the mouse cursor
* Commands are case insensitive
*/
{
...
...
@@ -113,7 +144,9 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
hotkey
+=
'A'
-
'a'
;
// Search command from key :
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Schematic_Hotkey_List
);
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Common_Hotkey_List
);
if
(
CommandCode
==
HK_NOT_FOUND
)
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Schematic_Hotkey_List
);
switch
(
CommandCode
)
{
...
...
@@ -123,7 +156,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_Schematic_Ho
tkey_List
);
DisplayHotkeyList
(
this
,
s_Schematic_Ho
keys_Descr
);
break
;
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
...
...
@@ -319,7 +352,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
EDA_BaseStruct
*
DrawStruct
)
/***********************************************************/
/* Hot keys for the component edito
t
. Some commands are relatives to the item under the mouse cursor
/* Hot keys for the component edito
r
. Some commands are relatives to the item under the mouse cursor
* Commands are case insensitive
*/
{
...
...
@@ -333,7 +366,9 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_LibEdit_Hotkey_List
);
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Common_Hotkey_List
);
if
(
CommandCode
==
HK_NOT_FOUND
)
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_LibEdit_Hotkey_List
);
switch
(
CommandCode
)
{
...
...
@@ -343,7 +378,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_Lib
Edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_Lib
edit_Hokeys_Descr
);
break
;
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
...
...
eeschema/hotkeys.h
View file @
e27d3f8c
...
...
@@ -27,9 +27,11 @@ enum hotkey_id_commnand {
HK_BEGIN_WIRE
};
// List of hotkey descriptors for schematic
extern
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[];
// List of hotkey descriptors for libray editor
extern
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[];
// List of hotkey descriptors for eeschema
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Eeschema_Hokeys_Descr
[];
// List of hotkey descriptors for the schematic editor only
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Schematic_Hokeys_Descr
[];
// List of hotkey descriptors for the lib editor only
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Libedit_Hokeys_Descr
[];
#endif // KOTKEYS_H
eeschema/onrightclick.cpp
View file @
e27d3f8c
...
...
@@ -281,22 +281,22 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
if
(
!
Component
->
m_Flags
)
{
msg
=
AddHotkeyName
(
_
(
"Move Component"
),
s_Schematic_Ho
tkey_List
,
HK_MOVE_COMPONENT
);
msg
=
AddHotkeyName
(
_
(
"Move Component"
),
s_Schematic_Ho
keys_Descr
,
HK_MOVE_COMPONENT
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_SCH_MOVE_CMP_REQUEST
,
msg
,
move_xpm
);
}
// add menu orient et sous menu:
wxMenu
*
orientmenu
=
new
wxMenu
;
msg
=
AddHotkeyName
(
_
(
"Rotate +"
),
s_Schematic_Ho
tkey_List
,
HK_ROTATE_COMPONENT
);
msg
=
AddHotkeyName
(
_
(
"Rotate +"
),
s_Schematic_Ho
keys_Descr
,
HK_ROTATE_COMPONENT
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE
,
msg
,
rotate_pos_xpm
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE
,
_
(
"Rotate -"
),
rotate_neg_xpm
);
msg
=
AddHotkeyName
(
_
(
"Mirror --"
),
s_Schematic_Ho
tkey_List
,
HK_MIRROR_X_COMPONENT
);
msg
=
AddHotkeyName
(
_
(
"Mirror --"
),
s_Schematic_Ho
keys_Descr
,
HK_MIRROR_X_COMPONENT
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_MIROR_X_CMP
,
msg
,
mirror_V_xpm
);
msg
=
AddHotkeyName
(
_
(
"Mirror ||"
),
s_Schematic_Ho
tkey_List
,
HK_MIRROR_Y_COMPONENT
);
msg
=
AddHotkeyName
(
_
(
"Mirror ||"
),
s_Schematic_Ho
keys_Descr
,
HK_MIRROR_Y_COMPONENT
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_MIROR_Y_CMP
,
msg
,
mirror_H_xpm
);
msg
=
AddHotkeyName
(
_
(
"Normal"
),
s_Schematic_Ho
tkey_List
,
HK_ORIENT_NORMAL_COMPONENT
);
msg
=
AddHotkeyName
(
_
(
"Normal"
),
s_Schematic_Ho
keys_Descr
,
HK_ORIENT_NORMAL_COMPONENT
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_ORIENT_NORMAL_CMP
,
msg
,
normal_xpm
);
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
orientmenu
,
ID_POPUP_SCH_GENERIC_ORIENT_CMP
,
_
(
...
...
eeschema/tool_lib.cpp
View file @
e27d3f8c
...
...
@@ -167,15 +167,15 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
_
(
"Test duplicate pins"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_Lib
Edit_Hotkey_List
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_Lib
edit_Hokeys_Descr
,
HK_ZOOM_IN
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_Lib
Edit_Hotkey_List
,
HK_ZOOM_OUT
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_Lib
edit_Hokeys_Descr
,
HK_ZOOM_OUT
);
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_Lib
Edit_Hotkey_List
,
HK_ZOOM_REDRAW
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_Lib
edit_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
...
...
eeschema/tool_sch.cpp
View file @
e27d3f8c
...
...
@@ -104,15 +104,15 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
_
(
"Run Pcbnew"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_Schematic_Ho
tkey_List
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_Schematic_Ho
keys_Descr
,
HK_ZOOM_IN
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_Schematic_Ho
tkey_List
,
HK_ZOOM_OUT
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_Schematic_Ho
keys_Descr
,
HK_ZOOM_OUT
);
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_Schematic_Ho
tkey_List
,
HK_ZOOM_REDRAW
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_Schematic_Ho
keys_Descr
,
HK_ZOOM_REDRAW
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
...
...
include/build_version.h
View file @
e27d3f8c
...
...
@@ -5,7 +5,7 @@
COMMON_GLOBL
wxString
g_BuildVersion
#ifdef EDA_BASE
(
wxT
(
"(2007-0
8-30
)"
))
(
wxT
(
"(2007-0
9-06
)"
))
#endif
;
...
...
include/common.h
View file @
e27d3f8c
...
...
@@ -345,7 +345,7 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
=
FALSE
,
bool
is_gui
=
FALSE
);
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
is_filename
=
FALSE
);
/* Return the name of the layer number "layer_number".
if "is_filename" == TRUE, the name can be used for a file name
(not internatinalized, no space)*/
...
...
include/hotkeys_basic.h
View file @
e27d3f8c
...
...
@@ -8,6 +8,10 @@
#ifndef HOTKEYS_BASIC_H
#define HOTKEYS_BASIC_H
#ifndef COMMON_GLOBL
#define COMMON_GLOBL extern
#endif
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( ".key" )
/* define default path for config key file */
...
...
@@ -32,12 +36,60 @@ public:
Ki_HotkeyInfo
(
const
wxChar
*
infomsg
,
int
idcommand
,
int
keycode
);
};
/* handle a Section name and the corresponding list of hotkeys (Ki_HotkeyInfo list) */
struct
Ki_HotkeyInfoSectionDescriptor
{
public
:
wxString
*
m_SectionTag
;
// The section name
Ki_HotkeyInfo
**
m_HK_InfoList
;
// pointer on List of Ki_HotkeyInfo
char
*
m_Comment
;
// comment: will be printed in the config file
/*
* public:
* Ki_HotkeyInfoSectionDescriptor( wxString * SectionTag, Ki_HotkeyInfo ** HK_InfoList )
* { m_SectionTag = SectionTag; m_HK_InfoList = HK_InfoList; }
*/
};
/* Identifiers (tags) in key code configuration file file
* .m_SectionTag member of a Ki_HotkeyInfoSectionDescriptor
*/
COMMON_GLOBL
wxString
g_CommonSectionTag
#ifdef EDA_BASE
(
wxT
(
"[common]"
)
)
#endif
;
COMMON_GLOBL
wxString
g_SchematicSectionTag
#ifdef EDA_BASE
(
wxT
(
"[eeschema]"
)
)
#endif
;
COMMON_GLOBL
wxString
g_LibEditSectionTag
#ifdef EDA_BASE
(
wxT
(
"[libedit]"
)
)
#endif
;
COMMON_GLOBL
wxString
g_BoardEditorSectionTag
#ifdef EDA_BASE
(
wxT
(
"[pcbnew]"
)
)
#endif
;
COMMON_GLOBL
wxString
g_ModuleEditSectionTag
#ifdef EDA_BASE
(
wxT
(
"[footprinteditor]"
)
)
#endif
;
/* Functions:
*/
wxString
ReturnKeyNameFromKeyCode
(
int
keycode
);
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
);
wxString
AddHotkeyName
(
const
wxString
&
text
,
Ki_HotkeyInfo
**
List
,
int
CommandId
);
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
Ki_HotkeyInfo
**
List
);
wxString
AddHotkeyName
(
const
wxString
&
text
,
struct
Ki_HotkeyInfoSectionDescriptor
*
DescrList
,
int
CommandId
);
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
struct
Ki_HotkeyInfoSectionDescriptor
*
List
);
int
GetCommandCodeFromHotkey
(
int
key
,
Ki_HotkeyInfo
**
List
);
...
...
include/wxstruct.h
View file @
e27d3f8c
...
...
@@ -177,8 +177,8 @@ public:
void
PrintMsg
(
const
wxString
&
text
);
void
GetSettings
();
void
SaveSettings
();
int
WriteHotkeyConfigFile
(
const
wxString
&
Filename
,
Ki_HotkeyInfo
**
List
,
bool
verbose
);
int
ReadHotkeyConfigFile
(
const
wxString
&
Filename
,
Ki_HotkeyInfo
**
List
,
bool
verbose
);
int
WriteHotkeyConfigFile
(
const
wxString
&
Filename
,
struct
Ki_HotkeyInfoSectionDescriptor
*
Desc
List
,
bool
verbose
);
int
ReadHotkeyConfigFile
(
const
wxString
&
Filename
,
struct
Ki_HotkeyInfoSectionDescriptor
*
Desc
List
,
bool
verbose
);
void
SetLanguage
(
wxCommandEvent
&
event
);
void
ProcessFontPreferences
(
int
id
);
...
...
libs.win
View file @
e27d3f8c
...
...
@@ -17,7 +17,7 @@ KICAD_BIN = /f/kicad/winexe
#Define the wxWidget path (if not found in environment variables):
ifndef WXWIN
WXWIN=f:/wxMSW-2.8.
4
WXWIN=f:/wxMSW-2.8.
5
endif
LIBVERSION = 2.8
...
...
pcbnew/hotkeys.cpp
View file @
e27d3f8c
...
...
@@ -26,7 +26,7 @@
* This can be usefull if the new function cannot be executed while an item is currently being edited
* ( For example, one cannot start a new wire when a component is moving.)
*
* Note: If an hotkey is a special key be sure the corresponding wxWidget keycode (WXK_XXXX)
* Note: If an hotkey is a special key
,
be sure the corresponding wxWidget keycode (WXK_XXXX)
* is handled in the hotkey_name_descr s_Hotkey_Name_List list (see hotkeys_basic.cpp)
* and see this list for some ascii keys (space ...)
*/
...
...
@@ -35,10 +35,10 @@
/* Hotkey list: */
static
Ki_HotkeyInfo
HkSwitch2CopperLayer
(
wxT
(
"Switch to Copper layer"
),
HK_SWITCH_LAYER_TO_COPPER
,
'-'
);
HK_SWITCH_LAYER_TO_COPPER
,
WXK_PAGEUP
);
static
Ki_HotkeyInfo
HkSwitch2ComponentLayer
(
wxT
(
"Switch to Component layer"
),
HK_SWITCH_LAYER_TO_COMPONENT
,
'+'
);
HK_SWITCH_LAYER_TO_COMPONENT
,
WXK_PAGEDOWN
);
static
Ki_HotkeyInfo
HkSwitch2InnerLayer1
(
wxT
(
"Switch to Inner layer 1"
),
HK_SWITCH_LAYER_TO_INNER1
,
WXK_F5
);
...
...
@@ -58,6 +58,13 @@ static Ki_HotkeyInfo HkSwitch2InnerLayer6( wxT(
"Switch to Inner layer 6"
),
HK_SWITCH_LAYER_TO_INNER6
,
WXK_F10
);
static
Ki_HotkeyInfo
HkSwitch2NextCopperLayer
(
wxT
(
"Switch to Next Layer"
),
HK_SWITCH_LAYER_TO_NEXT
,
'+'
);
static
Ki_HotkeyInfo
HkSwitch2PreviousCopperLayer
(
wxT
(
"Switch to Previous Layer"
),
HK_SWITCH_LAYER_TO_PREVIOUS
,
'-'
);
static
Ki_HotkeyInfo
HkSavefile
(
wxT
(
"Save board"
),
HK_SAVE_BOARD
,
'S'
+
GR_KB_CTRL
);
static
Ki_HotkeyInfo
HkLoadfile
(
wxT
(
"Load board"
),
HK_LOAD_BOARD
,
'L'
+
GR_KB_CTRL
);
static
Ki_HotkeyInfo
HkFindItem
(
wxT
(
"Find Item"
),
HK_FIND_ITEM
,
'F'
+
GR_KB_CTRL
);
...
...
@@ -83,12 +90,17 @@ static Ki_HotkeyInfo HkTrackDisplayMode( wxT(
"Track Display Mode"
),
HK_SWITCH_TRACK_DISPLAY_MODE
,
'F'
);
// List of common hotkey descriptors
Ki_HotkeyInfo
*
s_Common_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkSwitchUnits
,
&
HkResetLocalCoord
,
NULL
};
// List of hotkey descriptors for pcbnew
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkResetLocalCoord
,
&
HkSwitchUnits
,
&
HkTrackDisplayMode
,
&
HkTrackDisplayMode
,
&
HkDelete
,
&
HkBackspace
,
&
HkAddVia
,
&
HkEndTrack
,
&
HkMoveFootprint
,
&
HkFlipFootprint
,
...
...
@@ -103,19 +115,41 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = {
&
HkSwitch2InnerLayer5
,
&
HkSwitch2InnerLayer6
,
&
HkSwitch2ComponentLayer
,
&
HkSwitch2NextCopperLayer
,
&
HkSwitch2PreviousCopperLayer
,
NULL
};
// List of hotkey descriptors for the module editor
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkSwitchUnits
,
&
HkResetLocalCoord
,
&
HkDelete
,
&
HkBackspace
,
NULL
};
// list of sections and corresponding hotkey list for pcbnew (used to create an hotkey config file)
struct
Ki_HotkeyInfoSectionDescriptor
s_Pcbnew_Editor_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
"Common keys"
},
{
&
g_BoardEditorSectionTag
,
s_board_edit_Hotkey_List
,
"Board editor keys"
},
{
&
g_ModuleEditSectionTag
,
s_module_edit_Hotkey_List
,
"Footprint editor keys"
},
NULL
,
NULL
};
// list of sections and corresponding hotkey list for the board editor (used to list current hotkeys)
struct
Ki_HotkeyInfoSectionDescriptor
s_Board_Editor_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
NULL
},
{
&
g_BoardEditorSectionTag
,
s_board_edit_Hotkey_List
,
NULL
},
NULL
,
NULL
};
// list of sections and corresponding hotkey list for the footprint editor (used to list current hotkeys)
struct
Ki_HotkeyInfoSectionDescriptor
s_Module_Editor_Hokeys_Descr
[]
=
{
{
&
g_CommonSectionTag
,
s_Common_Hotkey_List
,
NULL
},
{
&
g_ModuleEditSectionTag
,
s_module_edit_Hotkey_List
,
NULL
},
NULL
,
NULL
};
/***********************************************************/
void
WinEDA_PcbFrame
::
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
)
...
...
@@ -123,7 +157,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
/* Hot keys. Some commands are relatives to the item under the mouse cursor
* Commands are case insensitive
* Zoom commands are not managed here
* @param DC = current device context
* @param hotkey = hothey code (ascii or wxWidget code for special keys)
* @param DrawStruct = NULL or pointer on a EDA_BaseStruct under the mouse cursor
...
...
@@ -148,7 +181,9 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_board_edit_Hotkey_List
);
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Common_Hotkey_List
);
if
(
CommandCode
==
HK_NOT_FOUND
)
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_board_edit_Hotkey_List
);
int
ll
;
switch
(
CommandCode
)
...
...
@@ -218,7 +253,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_
board_edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_
Board_Editor_Hokeys_Descr
);
break
;
case
HK_ZOOM_IN
:
...
...
@@ -434,9 +469,8 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
EDA_BaseStruct
*
DrawStruct
)
/***********************************************************/
/* Gestion des commandes rapides (Raccourcis claviers) concernant l'element
* sous le courseur souris
* Les majuscules/minuscules sont indifferenciees
/* Hot keys. Some commands are relative to the item under the mouse cursor
* Commands are case insensitive
*/
{
if
(
hotkey
==
0
)
...
...
@@ -446,7 +480,9 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_module_edit_Hotkey_List
);
int
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_Common_Hotkey_List
);
if
(
CommandCode
==
HK_NOT_FOUND
)
CommandCode
=
GetCommandCodeFromHotkey
(
hotkey
,
s_module_edit_Hotkey_List
);
switch
(
CommandCode
)
{
...
...
@@ -456,7 +492,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_
module_edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_
Module_Editor_Hokeys_Descr
);
break
;
case
HK_RESET_LOCAL_COORD
:
/*Reset the relative coord */
...
...
@@ -491,12 +527,13 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
bool
WinEDA_PcbFrame
::
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
)
/******************************************************************************/
/* Efface l'item pointe par la souris, en reponse a la touche "Del"
* Effet dependant de l'outil selectionne:
* Outil trace de pistes
* Efface le segment en cours ou la piste si pas d'element
* Outil module:
* Efface le module.
/* Delete the item foun under the mouse cursor
* Depending on the current active tool::
* Tool track
* if a track is in progress: Delete the last segment
* else delete the entire track
* Tool module (footprint):
* Delete the module.
*/
{
bool
ItemFree
=
(
GetScreen
()
->
GetCurItem
()
==
NULL
)
...
...
pcbnew/hotkeys.h
View file @
e27d3f8c
...
...
@@ -34,12 +34,22 @@ enum hotkey_id_commnand {
HK_SWITCH_LAYER_TO_INNER3
,
HK_SWITCH_LAYER_TO_INNER4
,
HK_SWITCH_LAYER_TO_INNER5
,
HK_SWITCH_LAYER_TO_INNER6
HK_SWITCH_LAYER_TO_INNER6
,
HK_SWITCH_LAYER_TO_INNER7
,
HK_SWITCH_LAYER_TO_INNER8
,
HK_SWITCH_LAYER_TO_INNER9
,
HK_SWITCH_LAYER_TO_INNER10
,
HK_SWITCH_LAYER_TO_INNER11
,
HK_SWITCH_LAYER_TO_INNER12
,
HK_SWITCH_LAYER_TO_INNER13
,
HK_SWITCH_LAYER_TO_INNER14
};
// List of hotkey descriptors for pcbnew
extern
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[];
// List of hotkey descriptors for the module editor
extern
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[];
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Pcbnew_Editor_Hokeys_Descr
[];
// List of hotkey descriptors for the board editor only
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Board_Editor_Hokeys_Descr
[];
// List of hotkey descriptors for the footprint editor only
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Module_Editor_Hokeys_Descr
[];
#endif // KOTKEYS_H
pcbnew/pcbcfg.cpp
View file @
e27d3f8c
...
...
@@ -13,12 +13,10 @@
#include "worksheet.h"
#include "id.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "protos.h"
extern
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[];
extern
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[];
/* Routines Locales */
/* Variables locales */
...
...
@@ -89,11 +87,7 @@ wxString FullFileName;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_board_edit_Hotkey_List
,
true
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"module_edit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_module_edit_Hotkey_List
,
true
);
WriteHotkeyConfigFile
(
FullFileName
,
s_Pcbnew_Editor_Hokeys_Descr
,
true
);
break
;
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
...
...
@@ -116,11 +110,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_board_edit_Hotkey_List
,
verbose
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"module_edit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
return
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_module_edit_Hotkey_List
,
verbose
);
return
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Pcbnew_Editor_Hokeys_Descr
,
verbose
);
}
...
...
pcbnew/tool_modedit.cpp
View file @
e27d3f8c
...
...
@@ -112,15 +112,15 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
_
(
"Print Module"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_
module_edit_Hotkey_List
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_
Module_Editor_Hokeys_Descr
,
HK_ZOOM_IN
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_
module_edit_Hotkey_List
,
HK_ZOOM_OUT
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_
Module_Editor_Hokeys_Descr
,
HK_ZOOM_OUT
);
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_
module_edit_Hotkey_List
,
HK_ZOOM_REDRAW
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_
Module_Editor_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
...
...
pcbnew/tool_pcb.cpp
View file @
e27d3f8c
...
...
@@ -267,15 +267,15 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_
(
"Plot (HPGL, PostScript, or GERBER format)"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_
board_edit_Hotkey_List
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"zoom +"
),
s_
Board_Editor_Hokeys_Descr
,
HK_ZOOM_IN
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_
board_edit_Hotkey_List
,
HK_ZOOM_OUT
);
msg
=
AddHotkeyName
(
_
(
"zoom -"
),
s_
Board_Editor_Hokeys_Descr
,
HK_ZOOM_OUT
);
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_
board_edit_Hotkey_List
,
HK_ZOOM_REDRAW
);
msg
=
AddHotkeyName
(
_
(
"redraw"
),
s_
Board_Editor_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
...
...
@@ -283,7 +283,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_
(
"auto zoom"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Find components and texts"
),
s_
board_edit_Hotkey_List
,
HK_FIND_ITEM
);
msg
=
AddHotkeyName
(
_
(
"Find components and texts"
),
s_
Board_Editor_Hokeys_Descr
,
HK_FIND_ITEM
);
m_HToolBar
->
AddTool
(
ID_FIND_ITEMS
,
wxEmptyString
,
BITMAP
(
find_xpm
),
msg
);
...
...
@@ -643,9 +643,31 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
m_SelLayerBox
->
Clear
();
for
(
ii
=
0
,
jj
=
0
;
ii
<=
EDGE_N
;
ii
++
)
{
// List to append hotkeys in layer box selection
static
int
HK_SwitchLayer
[
EDGE_N
+
1
]
=
{
HK_SWITCH_LAYER_TO_COPPER
,
HK_SWITCH_LAYER_TO_INNER1
,
HK_SWITCH_LAYER_TO_INNER2
,
HK_SWITCH_LAYER_TO_INNER3
,
HK_SWITCH_LAYER_TO_INNER4
,
HK_SWITCH_LAYER_TO_INNER5
,
HK_SWITCH_LAYER_TO_INNER6
,
HK_SWITCH_LAYER_TO_INNER7
,
HK_SWITCH_LAYER_TO_INNER8
,
HK_SWITCH_LAYER_TO_INNER9
,
HK_SWITCH_LAYER_TO_INNER10
,
HK_SWITCH_LAYER_TO_INNER11
,
HK_SWITCH_LAYER_TO_INNER12
,
HK_SWITCH_LAYER_TO_INNER13
,
HK_SWITCH_LAYER_TO_INNER14
,
HK_SWITCH_LAYER_TO_COMPONENT
};
if
(
(
g_TabOneLayerMask
[
ii
]
&
Masque_Layer
)
)
{
m_SelLayerBox
->
Append
(
ReturnPcbLayerName
(
ii
,
false
,
true
)
);
wxString
msg
=
ReturnPcbLayerName
(
ii
,
false
);
msg
=
AddHotkeyName
(
msg
,
s_Board_Editor_Hokeys_Descr
,
HK_SwitchLayer
[
ii
]
);
m_SelLayerBox
->
Append
(
msg
);
m_SelLayerBox
->
SetClientData
(
jj
,
(
void
*
)
ii
);
jj
++
;
}
...
...
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