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
Expand all
Hide 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
...
@@ -4,6 +4,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
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>
2007-Sep-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
...
...
common/common.cpp
View file @
e27d3f8c
...
@@ -265,7 +265,7 @@ void MyFree( void* pt_mem )
...
@@ -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".
/* Return the name of the layer number "layer_number".
...
@@ -305,21 +305,6 @@ wxString ReturnPcbLayerName( int layer_number, bool is_filename, bool is_gui )
...
@@ -305,21 +305,6 @@ wxString ReturnPcbLayerName( int layer_number, bool is_filename, bool is_gui )
else
else
layer_name
=
layer_name_list
[
layer_number
];
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
;
return
layer_name
;
}
}
...
...
common/edaappl.cpp
View file @
e27d3f8c
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "worksheet.h"
#include "worksheet.h"
#include "id.h"
#include "id.h"
#include "build_version.h"
#include "build_version.h"
#include "hotkeys_basic.h"
#include "bitmaps.h"
#include "bitmaps.h"
#include "Language.xpm"
#include "Language.xpm"
...
...
common/hotkeys_basic.cpp
View file @
e27d3f8c
This diff is collapsed.
Click to expand it.
eeschema/eeconfig.cpp
View file @
e27d3f8c
...
@@ -11,12 +11,10 @@
...
@@ -11,12 +11,10 @@
#include "eeconfig.h"
#include "eeconfig.h"
#include "worksheet.h"
#include "worksheet.h"
#include "hotkeys_basic.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "id.h"
#include "id.h"
extern
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[];
extern
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[];
/* Variables locales */
/* Variables locales */
...
@@ -80,11 +78,7 @@ wxString FullFileName;
...
@@ -80,11 +78,7 @@ wxString FullFileName;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_Schematic_Hotkey_List
,
true
);
WriteHotkeyConfigFile
(
FullFileName
,
s_Eeschema_Hokeys_Descr
,
true
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"libedit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_LibEdit_Hotkey_List
,
true
);
break
;
break
;
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
...
@@ -107,11 +101,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
...
@@ -107,11 +101,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
wxT
(
"eeschema"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Schematic_Hotkey_List
,
verbose
);
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Eeschema_Hokeys_Descr
,
verbose
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"libedit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_LibEdit_Hotkey_List
,
verbose
);
return
TRUE
;
return
TRUE
;
}
}
...
...
eeschema/hotkeys.cpp
View file @
e27d3f8c
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
* "Command Label" is the name used in hotkey list display, and the identifier in the hotkey list file
* "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.
* 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
* 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.
* Add the new code in the switch in OnHotKey() function.
* when the variable PopupOn is true, an item is currently edited.
* 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
* This can be usefull if the new function cannot be executed while an item is currently being edited
...
@@ -38,6 +39,15 @@
...
@@ -38,6 +39,15 @@
/* local variables */
/* local variables */
/* Hotkey list: */
/* 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
HkBeginWire
(
wxT
(
"begin Wire"
),
HK_BEGIN_WIRE
,
'W'
);
static
Ki_HotkeyInfo
HkAddComponent
(
wxT
(
"Add Component"
),
HK_ADD_NEW_COMPONENT
,
'A'
);
static
Ki_HotkeyInfo
HkAddComponent
(
wxT
(
"Add Component"
),
HK_ADD_NEW_COMPONENT
,
'A'
);
static
Ki_HotkeyInfo
HkMirrorYComponent
(
wxT
(
static
Ki_HotkeyInfo
HkMirrorYComponent
(
wxT
(
...
@@ -54,19 +64,24 @@ static Ki_HotkeyInfo HkMove2Drag( wxT(
...
@@ -54,19 +64,24 @@ static Ki_HotkeyInfo HkMove2Drag( wxT(
HK_MOVEBLOCK_TO_DRAGBLOCK
,
'\t'
);
HK_MOVEBLOCK_TO_DRAGBLOCK
,
'\t'
);
static
Ki_HotkeyInfo
HkInsert
(
wxT
(
"Repeat Last Item"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
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
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
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
);
// Library editor:
static
Ki_HotkeyInfo
HkZoomOut
(
wxT
(
"Zoom Out"
),
HK_ZOOM_OUT
,
WXK_F2
);
static
Ki_HotkeyInfo
HkInsertPin
(
wxT
(
"Repeat Pin"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
static
Ki_HotkeyInfo
HkZoomIn
(
wxT
(
"Zoom In"
),
HK_ZOOM_IN
,
WXK_F1
);
static
Ki_HotkeyInfo
HkHelp
(
wxT
(
"Help: this message"
),
HK_HELP
,
'?'
);
// List of common hotkey descriptors
Ki_HotkeyInfo
*
s_Common_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkResetLocalCoord
,
NULL
};
// List of hotkey descriptors for schematic
// List of hotkey descriptors for schematic
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[]
=
{
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkNextSearch
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkNextSearch
,
&
HkResetLocalCoord
,
&
HkDelete
,
&
HkInsert
,
&
HkMove2Drag
,
&
HkDelete
,
&
HkInsert
,
&
HkMove2Drag
,
&
HkMoveComponent
,
&
HkAddComponent
,
&
HkMoveComponent
,
&
HkAddComponent
,
&
HkRotateComponent
,
&
HkMirrorXComponent
,
&
HkMirrorYComponent
,
&
HkOrientNormalComponent
,
&
HkRotateComponent
,
&
HkMirrorXComponent
,
&
HkMirrorYComponent
,
&
HkOrientNormalComponent
,
...
@@ -74,25 +89,41 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = {
...
@@ -74,25 +89,41 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = {
NULL
NULL
};
};
// Library editor:
static
Ki_HotkeyInfo
HkInsertPin
(
wxT
(
"Repeat Pin"
),
HK_REPEAT_LAST
,
WXK_INSERT
);
// List of hotkey descriptors for libray editor
// List of hotkey descriptors for libray editor
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[]
=
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[]
=
{
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkResetLocalCoord
,
&
HkInsertPin
,
&
HkInsertPin
,
NULL
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
,
void
WinEDA_SchematicFrame
::
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
)
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
* Commands are case insensitive
*/
*/
{
{
...
@@ -113,7 +144,9 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -113,7 +144,9 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
hotkey
+=
'A'
-
'a'
;
hotkey
+=
'A'
-
'a'
;
// Search command from key :
// 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
)
switch
(
CommandCode
)
{
{
...
@@ -123,7 +156,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -123,7 +156,7 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
break
;
case
HK_HELP
:
// Display Current hotkey list
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_Schematic_Ho
tkey_List
);
DisplayHotkeyList
(
this
,
s_Schematic_Ho
keys_Descr
);
break
;
break
;
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
...
@@ -319,7 +352,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -319,7 +352,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
EDA_BaseStruct
*
DrawStruct
)
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
* Commands are case insensitive
*/
*/
{
{
...
@@ -333,7 +366,9 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -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 */
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
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
)
switch
(
CommandCode
)
{
{
...
@@ -343,7 +378,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -343,7 +378,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
break
;
case
HK_HELP
:
// Display Current hotkey list
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_Lib
Edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_Lib
edit_Hokeys_Descr
);
break
;
break
;
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
case
HK_RESET_LOCAL_COORD
:
/* Reset the relative coord */
...
...
eeschema/hotkeys.h
View file @
e27d3f8c
...
@@ -27,9 +27,11 @@ enum hotkey_id_commnand {
...
@@ -27,9 +27,11 @@ enum hotkey_id_commnand {
HK_BEGIN_WIRE
HK_BEGIN_WIRE
};
};
// List of hotkey descriptors for schematic
// List of hotkey descriptors for eeschema
extern
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[];
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Eeschema_Hokeys_Descr
[];
// List of hotkey descriptors for libray editor
// List of hotkey descriptors for the schematic editor only
extern
Ki_HotkeyInfo
*
s_LibEdit_Hotkey_List
[];
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
#endif // KOTKEYS_H
eeschema/onrightclick.cpp
View file @
e27d3f8c
...
@@ -281,22 +281,22 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
...
@@ -281,22 +281,22 @@ void AddMenusForComponent( wxMenu* PopMenu, EDA_SchComponentStruct* Component )
if
(
!
Component
->
m_Flags
)
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
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_SCH_MOVE_CMP_REQUEST
,
msg
,
move_xpm
);
msg
,
move_xpm
);
}
}
// add menu orient et sous menu:
// add menu orient et sous menu:
wxMenu
*
orientmenu
=
new
wxMenu
;
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
,
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE
,
msg
,
rotate_pos_xpm
);
msg
,
rotate_pos_xpm
);
ADD_MENUITEM
(
orientmenu
,
ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE
,
_
(
"Rotate -"
),
rotate_neg_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
);
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
);
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
(
orientmenu
,
ID_POPUP_SCH_ORIENT_NORMAL_CMP
,
msg
,
normal_xpm
);
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
orientmenu
,
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
orientmenu
,
ID_POPUP_SCH_GENERIC_ORIENT_CMP
,
_
(
ID_POPUP_SCH_GENERIC_ORIENT_CMP
,
_
(
...
...
eeschema/tool_lib.cpp
View file @
e27d3f8c
...
@@ -167,15 +167,15 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
...
@@ -167,15 +167,15 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
_
(
"Test duplicate pins"
)
);
_
(
"Test duplicate pins"
)
);
m_HToolBar
->
AddSeparator
();
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
msg
);
...
...
eeschema/tool_sch.cpp
View file @
e27d3f8c
...
@@ -104,15 +104,15 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
...
@@ -104,15 +104,15 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
_
(
"Run Pcbnew"
)
);
_
(
"Run Pcbnew"
)
);
m_HToolBar
->
AddSeparator
();
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
msg
);
...
...
include/build_version.h
View file @
e27d3f8c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
COMMON_GLOBL
wxString
g_BuildVersion
COMMON_GLOBL
wxString
g_BuildVersion
#ifdef EDA_BASE
#ifdef EDA_BASE
(
wxT
(
"(2007-0
8-30
)"
))
(
wxT
(
"(2007-0
9-06
)"
))
#endif
#endif
;
;
...
...
include/common.h
View file @
e27d3f8c
...
@@ -345,7 +345,7 @@ class WinEDA_DrawPanel;
...
@@ -345,7 +345,7 @@ class WinEDA_DrawPanel;
/* COMMON.CPP */
/* 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".
/* Return the name of the layer number "layer_number".
if "is_filename" == TRUE, the name can be used for a file name
if "is_filename" == TRUE, the name can be used for a file name
(not internatinalized, no space)*/
(not internatinalized, no space)*/
...
...
include/hotkeys_basic.h
View file @
e27d3f8c
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
#ifndef HOTKEYS_BASIC_H
#ifndef HOTKEYS_BASIC_H
#define HOTKEYS_BASIC_H
#define HOTKEYS_BASIC_H
#ifndef COMMON_GLOBL
#define COMMON_GLOBL extern
#endif
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( ".key" )
#define DEFAULT_HOTKEY_FILENAME_EXT wxT( ".key" )
/* define default path for config key file */
/* define default path for config key file */
...
@@ -32,12 +36,60 @@ public:
...
@@ -32,12 +36,60 @@ public:
Ki_HotkeyInfo
(
const
wxChar
*
infomsg
,
int
idcommand
,
int
keycode
);
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:
/* Functions:
*/
*/
wxString
ReturnKeyNameFromKeyCode
(
int
keycode
);
wxString
ReturnKeyNameFromKeyCode
(
int
keycode
);
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
);
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
);
wxString
AddHotkeyName
(
const
wxString
&
text
,
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
);
int
GetCommandCodeFromHotkey
(
int
key
,
Ki_HotkeyInfo
**
List
);
...
...
include/wxstruct.h
View file @
e27d3f8c
...
@@ -177,8 +177,8 @@ public:
...
@@ -177,8 +177,8 @@ public:
void
PrintMsg
(
const
wxString
&
text
);
void
PrintMsg
(
const
wxString
&
text
);
void
GetSettings
();
void
GetSettings
();
void
SaveSettings
();
void
SaveSettings
();
int
WriteHotkeyConfigFile
(
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
,
Ki_HotkeyInfo
**
List
,
bool
verbose
);
int
ReadHotkeyConfigFile
(
const
wxString
&
Filename
,
struct
Ki_HotkeyInfoSectionDescriptor
*
Desc
List
,
bool
verbose
);
void
SetLanguage
(
wxCommandEvent
&
event
);
void
SetLanguage
(
wxCommandEvent
&
event
);
void
ProcessFontPreferences
(
int
id
);
void
ProcessFontPreferences
(
int
id
);
...
...
libs.win
View file @
e27d3f8c
...
@@ -17,7 +17,7 @@ KICAD_BIN = /f/kicad/winexe
...
@@ -17,7 +17,7 @@ KICAD_BIN = /f/kicad/winexe
#Define the wxWidget path (if not found in environment variables):
#Define the wxWidget path (if not found in environment variables):
ifndef WXWIN
ifndef WXWIN
WXWIN=f:/wxMSW-2.8.
4
WXWIN=f:/wxMSW-2.8.
5
endif
endif
LIBVERSION = 2.8
LIBVERSION = 2.8
...
...
pcbnew/hotkeys.cpp
View file @
e27d3f8c
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* This can be usefull if the new function cannot be executed while an item is currently being edited
* 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.)
* ( 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)
* 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 ...)
* and see this list for some ascii keys (space ...)
*/
*/
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
/* Hotkey list: */
/* Hotkey list: */
static
Ki_HotkeyInfo
HkSwitch2CopperLayer
(
wxT
(
static
Ki_HotkeyInfo
HkSwitch2CopperLayer
(
wxT
(
"Switch to Copper layer"
),
"Switch to Copper layer"
),
HK_SWITCH_LAYER_TO_COPPER
,
'-'
);
HK_SWITCH_LAYER_TO_COPPER
,
WXK_PAGEUP
);
static
Ki_HotkeyInfo
HkSwitch2ComponentLayer
(
wxT
(
static
Ki_HotkeyInfo
HkSwitch2ComponentLayer
(
wxT
(
"Switch to Component layer"
),
"Switch to Component layer"
),
HK_SWITCH_LAYER_TO_COMPONENT
,
'+'
);
HK_SWITCH_LAYER_TO_COMPONENT
,
WXK_PAGEDOWN
);
static
Ki_HotkeyInfo
HkSwitch2InnerLayer1
(
wxT
(
static
Ki_HotkeyInfo
HkSwitch2InnerLayer1
(
wxT
(
"Switch to Inner layer 1"
),
"Switch to Inner layer 1"
),
HK_SWITCH_LAYER_TO_INNER1
,
WXK_F5
);
HK_SWITCH_LAYER_TO_INNER1
,
WXK_F5
);
...
@@ -58,6 +58,13 @@ static Ki_HotkeyInfo HkSwitch2InnerLayer6( wxT(
...
@@ -58,6 +58,13 @@ static Ki_HotkeyInfo HkSwitch2InnerLayer6( wxT(
"Switch to Inner layer 6"
),
"Switch to Inner layer 6"
),
HK_SWITCH_LAYER_TO_INNER6
,
WXK_F10
);
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
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
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
);
static
Ki_HotkeyInfo
HkFindItem
(
wxT
(
"Find Item"
),
HK_FIND_ITEM
,
'F'
+
GR_KB_CTRL
);
...
@@ -83,12 +90,17 @@ static Ki_HotkeyInfo HkTrackDisplayMode( wxT(
...
@@ -83,12 +90,17 @@ static Ki_HotkeyInfo HkTrackDisplayMode( wxT(
"Track Display Mode"
),
"Track Display Mode"
),
HK_SWITCH_TRACK_DISPLAY_MODE
,
'F'
);
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
// List of hotkey descriptors for pcbnew
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[]
=
{
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkTrackDisplayMode
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkResetLocalCoord
,
&
HkSwitchUnits
,
&
HkTrackDisplayMode
,
&
HkDelete
,
&
HkBackspace
,
&
HkDelete
,
&
HkBackspace
,
&
HkAddVia
,
&
HkEndTrack
,
&
HkAddVia
,
&
HkEndTrack
,
&
HkMoveFootprint
,
&
HkFlipFootprint
,
&
HkMoveFootprint
,
&
HkFlipFootprint
,
...
@@ -103,19 +115,41 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = {
...
@@ -103,19 +115,41 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] = {
&
HkSwitch2InnerLayer5
,
&
HkSwitch2InnerLayer5
,
&
HkSwitch2InnerLayer6
,
&
HkSwitch2InnerLayer6
,
&
HkSwitch2ComponentLayer
,
&
HkSwitch2ComponentLayer
,
&
HkSwitch2NextCopperLayer
,
&
HkSwitch2PreviousCopperLayer
,
NULL
NULL
};
};
// List of hotkey descriptors for the module editor
// List of hotkey descriptors for the module editor
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[]
=
{
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[]
=
{
&
HkHelp
,
&
HkZoomIn
,
&
HkZoomOut
,
&
HkZoomRedraw
,
&
HkZoomCenter
,
&
HkSwitchUnits
,
&
HkResetLocalCoord
,
&
HkDelete
,
&
HkBackspace
,
NULL
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
,
void
WinEDA_PcbFrame
::
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
)
EDA_BaseStruct
*
DrawStruct
)
...
@@ -123,7 +157,6 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -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
/* Hot keys. Some commands are relatives to the item under the mouse cursor
* Commands are case insensitive
* Commands are case insensitive
* Zoom commands are not managed here
* @param DC = current device context
* @param DC = current device context
* @param hotkey = hothey code (ascii or wxWidget code for special keys)
* @param hotkey = hothey code (ascii or wxWidget code for special keys)
* @param DrawStruct = NULL or pointer on a EDA_BaseStruct under the mouse cursor
* @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,
...
@@ -148,7 +181,9 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
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
;
int
ll
;
switch
(
CommandCode
)
switch
(
CommandCode
)
...
@@ -218,7 +253,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -218,7 +253,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
break
;
case
HK_HELP
:
// Display Current hotkey list
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_
board_edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_
Board_Editor_Hokeys_Descr
);
break
;
break
;
case
HK_ZOOM_IN
:
case
HK_ZOOM_IN
:
...
@@ -434,9 +469,8 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -434,9 +469,8 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
EDA_BaseStruct
*
DrawStruct
)
EDA_BaseStruct
*
DrawStruct
)
/***********************************************************/
/***********************************************************/
/* Gestion des commandes rapides (Raccourcis claviers) concernant l'element
/* Hot keys. Some commands are relative to the item under the mouse cursor
* sous le courseur souris
* Commands are case insensitive
* Les majuscules/minuscules sont indifferenciees
*/
*/
{
{
if
(
hotkey
==
0
)
if
(
hotkey
==
0
)
...
@@ -446,7 +480,9 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -446,7 +480,9 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
if
(
(
hotkey
>=
'a'
)
&&
(
hotkey
<=
'z'
)
)
hotkey
+=
'A'
-
'a'
;
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
)
switch
(
CommandCode
)
{
{
...
@@ -456,7 +492,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -456,7 +492,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
break
;
case
HK_HELP
:
// Display Current hotkey list
case
HK_HELP
:
// Display Current hotkey list
DisplayHotkeyList
(
this
,
s_
module_edit_Hotkey_List
);
DisplayHotkeyList
(
this
,
s_
Module_Editor_Hokeys_Descr
);
break
;
break
;
case
HK_RESET_LOCAL_COORD
:
/*Reset the relative coord */
case
HK_RESET_LOCAL_COORD
:
/*Reset the relative coord */
...
@@ -491,12 +527,13 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
...
@@ -491,12 +527,13 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
bool
WinEDA_PcbFrame
::
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
)
bool
WinEDA_PcbFrame
::
OnHotkeyDeleteItem
(
wxDC
*
DC
,
EDA_BaseStruct
*
DrawStruct
)
/******************************************************************************/
/******************************************************************************/
/* Efface l'item pointe par la souris, en reponse a la touche "Del"
/* Delete the item foun under the mouse cursor
* Effet dependant de l'outil selectionne:
* Depending on the current active tool::
* Outil trace de pistes
* Tool track
* Efface le segment en cours ou la piste si pas d'element
* if a track is in progress: Delete the last segment
* Outil module:
* else delete the entire track
* Efface le module.
* Tool module (footprint):
* Delete the module.
*/
*/
{
{
bool
ItemFree
=
(
GetScreen
()
->
GetCurItem
()
==
NULL
)
bool
ItemFree
=
(
GetScreen
()
->
GetCurItem
()
==
NULL
)
...
...
pcbnew/hotkeys.h
View file @
e27d3f8c
...
@@ -34,12 +34,22 @@ enum hotkey_id_commnand {
...
@@ -34,12 +34,22 @@ enum hotkey_id_commnand {
HK_SWITCH_LAYER_TO_INNER3
,
HK_SWITCH_LAYER_TO_INNER3
,
HK_SWITCH_LAYER_TO_INNER4
,
HK_SWITCH_LAYER_TO_INNER4
,
HK_SWITCH_LAYER_TO_INNER5
,
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
// List of hotkey descriptors for pcbnew
extern
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[];
extern
struct
Ki_HotkeyInfoSectionDescriptor
s_Pcbnew_Editor_Hokeys_Descr
[];
// List of hotkey descriptors for the module editor
// List of hotkey descriptors for the board editor only
extern
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[];
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
#endif // KOTKEYS_H
pcbnew/pcbcfg.cpp
View file @
e27d3f8c
...
@@ -13,12 +13,10 @@
...
@@ -13,12 +13,10 @@
#include "worksheet.h"
#include "worksheet.h"
#include "id.h"
#include "id.h"
#include "hotkeys_basic.h"
#include "hotkeys_basic.h"
#include "hotkeys.h"
#include "protos.h"
#include "protos.h"
extern
Ki_HotkeyInfo
*
s_board_edit_Hotkey_List
[];
extern
Ki_HotkeyInfo
*
s_module_edit_Hotkey_List
[];
/* Routines Locales */
/* Routines Locales */
/* Variables locales */
/* Variables locales */
...
@@ -89,11 +87,7 @@ wxString FullFileName;
...
@@ -89,11 +87,7 @@ wxString FullFileName;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_board_edit_Hotkey_List
,
true
);
WriteHotkeyConfigFile
(
FullFileName
,
s_Pcbnew_Editor_Hokeys_Descr
,
true
);
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"module_edit"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
WriteHotkeyConfigFile
(
FullFileName
,
s_module_edit_Hotkey_List
,
true
);
break
;
break
;
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
case
ID_PREFERENCES_READ_CONFIG_HOTKEYS
:
...
@@ -116,11 +110,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
...
@@ -116,11 +110,7 @@ bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose )
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
wxString
FullFileName
=
DEFAULT_HOTKEY_FILENAME_PATH
;
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
wxT
(
"pcbnew"
);
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
FullFileName
+=
DEFAULT_HOTKEY_FILENAME_EXT
;
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_board_edit_Hotkey_List
,
verbose
);
return
frame
->
ReadHotkeyConfigFile
(
FullFileName
,
s_Pcbnew_Editor_Hokeys_Descr
,
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
);
}
}
...
...
pcbnew/tool_modedit.cpp
View file @
e27d3f8c
...
@@ -112,15 +112,15 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
...
@@ -112,15 +112,15 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
_
(
"Print Module"
)
);
_
(
"Print Module"
)
);
m_HToolBar
->
AddSeparator
();
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
msg
);
...
...
pcbnew/tool_pcb.cpp
View file @
e27d3f8c
...
@@ -267,15 +267,15 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -267,15 +267,15 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_
(
"Plot (HPGL, PostScript, or GERBER format)"
)
);
_
(
"Plot (HPGL, PostScript, or GERBER format)"
)
);
m_HToolBar
->
AddSeparator
();
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_PLUS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_in_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_MOINS_BUTT
,
wxEmptyString
,
BITMAP
(
zoom_out_xpm
),
msg
);
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
),
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW_BUTT
,
wxEmptyString
,
BITMAP
(
repaint_xpm
),
msg
);
msg
);
...
@@ -283,7 +283,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -283,7 +283,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_
(
"auto zoom"
)
);
_
(
"auto zoom"
)
);
m_HToolBar
->
AddSeparator
();
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
),
m_HToolBar
->
AddTool
(
ID_FIND_ITEMS
,
wxEmptyString
,
BITMAP
(
find_xpm
),
msg
);
msg
);
...
@@ -643,9 +643,31 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
...
@@ -643,9 +643,31 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
m_SelLayerBox
->
Clear
();
m_SelLayerBox
->
Clear
();
for
(
ii
=
0
,
jj
=
0
;
ii
<=
EDGE_N
;
ii
++
)
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
)
)
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
);
m_SelLayerBox
->
SetClientData
(
jj
,
(
void
*
)
ii
);
jj
++
;
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