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
1ee86d4a
Commit
1ee86d4a
authored
Feb 16, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup and enhancements about hotkeys
parent
e1412214
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
320 additions
and
274 deletions
+320
-274
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+38
-25
hotkeys.cpp
eeschema/hotkeys.cpp
+26
-6
hotkeys.h
eeschema/hotkeys.h
+1
-0
menubar.cpp
eeschema/menubar.cpp
+4
-11
tool_lib.cpp
eeschema/tool_lib.cpp
+6
-6
tool_sch.cpp
eeschema/tool_sch.cpp
+9
-7
tool_viewlib.cpp
eeschema/tool_viewlib.cpp
+4
-4
hotkeys_basic.h
include/hotkeys_basic.h
+45
-6
kicad.mo
internat/fr/kicad.mo
+0
-0
kicad.po
internat/fr/kicad.po
+161
-170
hotkeys.cpp
pcbnew/hotkeys.cpp
+12
-0
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+3
-24
tool_modedit.cpp
pcbnew/tool_modedit.cpp
+4
-4
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+7
-11
No files found.
common/hotkeys_basic.cpp
View file @
1ee86d4a
...
...
@@ -199,22 +199,22 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
* return the key name from the key code
* 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)
* @param
aKeycode
= key code (ascii value, or wxWidgets value for function keys)
* @return the key name in a wxString
*/
wxString
ReturnKeyNameFromKeyCode
(
int
k
eycode
)
wxString
ReturnKeyNameFromKeyCode
(
int
aK
eycode
)
{
wxString
keyname
,
modifier
,
fullkeyname
;
int
ii
;
if
(
(
k
eycode
&
GR_KB_CTRL
)
!=
0
)
if
(
(
aK
eycode
&
GR_KB_CTRL
)
!=
0
)
modifier
<<
wxT
(
"Ctrl+"
);
if
(
(
k
eycode
&
GR_KB_ALT
)
!=
0
)
if
(
(
aK
eycode
&
GR_KB_ALT
)
!=
0
)
modifier
<<
wxT
(
"Alt+"
);
if
(
(
k
eycode
&
GR_KB_SHIFT
)
!=
0
)
if
(
(
aK
eycode
&
GR_KB_SHIFT
)
!=
0
)
modifier
<<
wxT
(
"Shift+"
);
k
eycode
&=
~
(
GR_KB_CTRL
|
GR_KB_ALT
|
GR_KB_SHIFT
);
aK
eycode
&=
~
(
GR_KB_CTRL
|
GR_KB_ALT
|
GR_KB_SHIFT
);
for
(
ii
=
0
;
;
ii
++
)
{
if
(
s_Hotkey_Name_List
[
ii
].
m_KeyCode
==
0
)
...
...
@@ -222,7 +222,7 @@ wxString ReturnKeyNameFromKeyCode( int keycode )
keyname
=
wxT
(
"<unknown>"
);
break
;
}
if
(
s_Hotkey_Name_List
[
ii
].
m_KeyCode
==
k
eycode
)
if
(
s_Hotkey_Name_List
[
ii
].
m_KeyCode
==
aK
eycode
)
{
keyname
=
s_Hotkey_Name_List
[
ii
].
m_Name
;
break
;
...
...
@@ -236,12 +236,15 @@ wxString ReturnKeyNameFromKeyCode( int keycode )
/** function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfo list of commands
* @param CommandId = Command Id value
* @return text (key name) in a wxString if found or text without modification
* @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfo list of commands
* @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
* = false to add <spaces><(keyname)>
* @return a wxString (aTest + key name) if key found or aText without modification
*/
wxString
AddHotkeyName
(
const
wxString
&
aText
,
Ki_HotkeyInfo
**
aList
,
int
aCommandId
)
int
aCommandId
,
bool
aIsShortCut
)
{
wxString
msg
=
aText
;
wxString
keyname
;
...
...
@@ -249,21 +252,28 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
keyname
=
ReturnKeyNameFromCommandId
(
aList
,
aCommandId
);
if
(
!
keyname
.
IsEmpty
()
)
msg
<<
wxT
(
"
\t
"
)
<<
keyname
;
{
if
(
aIsShortCut
)
msg
<<
wxT
(
"
\t
"
)
<<
keyname
;
else
msg
<<
wxT
(
" <"
)
<<
keyname
<<
wxT
(
">"
);
}
return
msg
;
}
/** function AddHotkeyName
* 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
* @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands
* @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
* = false to add <spaces><(keyname)>
* @return a wxString (aTest + key name) if key found or aText without modification
*/
wxString
AddHotkeyName
(
const
wxString
&
aText
,
struct
Ki_HotkeyInfoSectionDescriptor
*
aDescList
,
int
aCommandId
)
int
aCommandId
,
bool
aIsShortCut
)
{
wxString
msg
=
aText
;
wxString
keyname
;
...
...
@@ -277,7 +287,10 @@ wxString AddHotkeyName( const wxString& aText,
keyname
=
ReturnKeyNameFromCommandId
(
List
,
aCommandId
);
if
(
!
keyname
.
IsEmpty
()
)
{
msg
<<
wxT
(
"
\t
"
)
<<
keyname
;
if
(
aIsShortCut
)
msg
<<
wxT
(
"
\t
"
)
<<
keyname
;
else
msg
<<
wxT
(
" <"
)
<<
keyname
<<
wxT
(
">"
);
break
;
}
}
...
...
@@ -289,18 +302,18 @@ wxString AddHotkeyName( const wxString& aText,
/** function ReturnKeyNameFromCommandId
* return the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfo list of commands
* @param CommandId = Command Id value
* @param
a
List = pointer to a Ki_HotkeyInfo list of commands
* @param
a
CommandId = Command Id value
* @return the key name in a wxString
*/
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
)
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
aList
,
int
a
CommandId
)
{
wxString
keyname
;
for
(
;
*
List
!=
NULL
;
List
++
)
for
(
;
*
aList
!=
NULL
;
a
List
++
)
{
Ki_HotkeyInfo
*
hk_decr
=
*
List
;
if
(
hk_decr
->
m_Idcommand
==
CommandId
)
Ki_HotkeyInfo
*
hk_decr
=
*
a
List
;
if
(
hk_decr
->
m_Idcommand
==
a
CommandId
)
{
keyname
=
ReturnKeyNameFromKeyCode
(
hk_decr
->
m_KeyCode
);
break
;
...
...
eeschema/hotkeys.cpp
View file @
1ee86d4a
...
...
@@ -52,13 +52,20 @@
*/
/* Fit on Screen */
static
Ki_HotkeyInfo
HkZoomAuto
(
wxT
(
"Fit on Screen"
),
HK_ZOOM_AUTO
,
WXK_HOME
);
#if !defined( __WXMAC__ )
static
Ki_HotkeyInfo
HkZoomAuto
(
wxT
(
"Fit on Screen"
),
HK_ZOOM_AUTO
,
WXK_HOME
);
#else
static
Ki_HotkeyInfo
HkZoomAuto
(
wxT
(
"Zoom Auto"
),
HK_ZOOM_AUTO
,
GR_KB_CTRL
+
'0'
);
#endif
static
Ki_HotkeyInfo
HkZoomCenter
(
wxT
(
"Zoom Center"
),
HK_ZOOM_CENTER
,
WXK_F4
);
static
Ki_HotkeyInfo
HkZoomCenter
(
wxT
(
"Zoom Center"
),
HK_ZOOM_CENTER
,
WXK_F4
);
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
WXK_F3
);
/* Refresh Screen */
#if !defined( __WXMAC__ )
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
WXK_F3
);
#else
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
GR_KB_CTRL
+
'R'
);
#endif
/* Zoom In */
#if !defined( __WXMAC__ )
...
...
@@ -127,6 +134,9 @@ static Ki_HotkeyInfo HkMove2Drag( wxT( "Switch move block to drag block" ),
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
HkFindItem
(
wxT
(
"Find Item"
),
HK_FIND_ITEM
,
'F'
+
GR_KB_CTRL
);
static
Ki_HotkeyInfo
HkNextSearch
(
wxT
(
"Next Search"
),
HK_NEXT_SEARCH
,
WXK_F5
);
...
...
@@ -156,6 +166,7 @@ Ki_HotkeyInfo* s_Common_Hotkey_List[] =
// List of hotkey descriptors for schematic
Ki_HotkeyInfo
*
s_Schematic_Hotkey_List
[]
=
{
&
HkFindItem
,
&
HkNextSearch
,
&
HkDelete
,
&
HkInsert
,
...
...
@@ -325,6 +336,15 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey,
RepeatDrawItem
(
DC
);
break
;
case
HK_FIND_ITEM
:
if
(
!
ItemInEdit
)
{
wxCommandEvent
evt
;
evt
.
SetId
(
ID_FIND_ITEMS
);
Process_Special_Functions
(
evt
);
}
break
;
case
HK_NEXT_SEARCH
:
if
(
!
ItemInEdit
)
{
...
...
eeschema/hotkeys.h
View file @
1ee86d4a
...
...
@@ -11,6 +11,7 @@
// for shared hotkeys id
enum
hotkey_id_commnand
{
HK_NEXT_SEARCH
=
HK_COMMON_END
,
HK_FIND_ITEM
,
HK_DELETE
,
HK_REPEAT_LAST
,
HK_EDIT_PIN
,
...
...
eeschema/menubar.cpp
View file @
1ee86d4a
...
...
@@ -79,7 +79,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
/* Save as... */
item
=
new
wxMenuItem
(
filesMenu
,
ID_SAVE_ONE_SHEET_AS
,
_
(
"Save Current Sheet &as
\t
Shift+Ctrl+S
"
),
_
(
"Save Current Sheet &as"
),
_
(
"Save current schematic sheet as..."
)
);
item
->
SetBitmap
(
save_as_xpm
);
filesMenu
->
Append
(
item
);
...
...
@@ -88,7 +88,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
filesMenu
->
AppendSeparator
();
/* Print */
item
=
new
wxMenuItem
(
filesMenu
,
wxID_PRINT
,
_
(
"P&rint
\t
Ctrl+P
"
),
item
=
new
wxMenuItem
(
filesMenu
,
wxID_PRINT
,
_
(
"P&rint"
),
_
(
"Print schematic"
)
);
item
->
SetBitmap
(
print_button
);
filesMenu
->
Append
(
item
);
...
...
@@ -181,7 +181,8 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
editMenu
->
AppendSeparator
();
/* Find */
item
=
new
wxMenuItem
(
editMenu
,
ID_FIND_ITEMS
,
_
(
"&Find
\t
Ctrl+F"
),
text
=
AddHotkeyName
(
_
(
"&Find"
),
s_Schematic_Hokeys_Descr
,
HK_FIND_ITEM
);
item
=
new
wxMenuItem
(
editMenu
,
ID_FIND_ITEMS
,
text
,
_
(
"Find components and texts"
),
wxITEM_NORMAL
);
item
->
SetBitmap
(
find_xpm
);
editMenu
->
Append
(
item
);
...
...
@@ -229,12 +230,8 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
viewMenu
->
Append
(
item
);
/* Fit on screen */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Fit on Screen"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_AUTO
);
#else
text
=
_
(
"Fit on Screen
\t
Ctrl+0"
);
#endif
item
=
new
wxMenuItem
(
viewMenu
,
ID_ZOOM_PAGE
,
text
,
_
(
"Fit the schematic sheet on the screen"
),
...
...
@@ -245,12 +242,8 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
viewMenu
->
AppendSeparator
();
/* Redraw view */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Redraw"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
#else
text
=
_
(
"Redraw
\t
Ctrl+R"
);
#endif
item
=
new
wxMenuItem
(
viewMenu
,
ID_ZOOM_REDRAW
,
text
,
_
(
"Redraw the schematic view"
),
...
...
eeschema/tool_lib.cpp
View file @
1ee86d4a
...
...
@@ -133,11 +133,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Undo last command"
),
s_Schematic_Hokeys_Descr
,
HK_UNDO
);
HK_UNDO
,
false
);
m_HToolBar
->
AddTool
(
wxID_UNDO
,
wxEmptyString
,
wxBitmap
(
undo_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redo the last command"
),
s_Schematic_Hokeys_Descr
,
HK_REDO
);
HK_REDO
,
false
);
m_HToolBar
->
AddTool
(
wxID_REDO
,
wxEmptyString
,
wxBitmap
(
redo_xpm
),
msg
);
...
...
@@ -156,20 +156,20 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
_
(
"Test for duplicate pins and off grid pins"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_IN
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_IN
,
wxEmptyString
,
wxBitmap
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_OUT
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_OUT
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_OUT
,
wxEmptyString
,
wxBitmap
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redraw view"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
HK_ZOOM_REDRAW
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW
,
wxEmptyString
,
wxBitmap
(
zoom_redraw_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_AUTO
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Libedit_Hokeys_Descr
,
HK_ZOOM_AUTO
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
wxBitmap
(
zoom_auto_xpm
),
msg
);
...
...
eeschema/tool_sch.cpp
View file @
1ee86d4a
...
...
@@ -66,12 +66,12 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Undo last edition"
),
s_Schematic_Hokeys_Descr
,
HK_UNDO
);
HK_UNDO
,
false
);
m_HToolBar
->
AddTool
(
wxID_UNDO
,
wxEmptyString
,
wxBitmap
(
undo_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redo the last undo command"
),
s_Schematic_Hokeys_Descr
,
HK_REDO
);
s_Schematic_Hokeys_Descr
,
HK_REDO
,
false
);
m_HToolBar
->
AddTool
(
wxID_REDO
,
wxEmptyString
,
wxBitmap
(
redo_xpm
),
msg
);
...
...
@@ -87,28 +87,30 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
_
(
"Run pcbnew"
)
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_IN
);
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_IN
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_IN
,
wxEmptyString
,
wxBitmap
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_OUT
);
HK_ZOOM_OUT
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_OUT
,
wxEmptyString
,
wxBitmap
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redraw view"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
HK_ZOOM_REDRAW
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW
,
wxEmptyString
,
wxBitmap
(
zoom_redraw_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Schematic_Hokeys_Descr
,
HK_ZOOM_AUTO
);
HK_ZOOM_AUTO
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
wxBitmap
(
zoom_auto_xpm
),
msg
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Find components and texts"
),
s_Schematic_Hokeys_Descr
,
HK_FIND_ITEM
,
false
);
m_HToolBar
->
AddTool
(
ID_FIND_ITEMS
,
wxEmptyString
,
wxBitmap
(
find_xpm
),
_
(
"Find components and texts"
)
);
msg
);
m_HToolBar
->
AddSeparator
();
m_HToolBar
->
AddTool
(
ID_GET_NETLIST
,
wxEmptyString
,
wxBitmap
(
netlist_xpm
),
...
...
eeschema/tool_viewlib.cpp
View file @
1ee86d4a
...
...
@@ -48,22 +48,22 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Viewlib_Hokeys_Descr
,
HK_ZOOM_IN
);
HK_ZOOM_IN
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_IN
,
wxEmptyString
,
wxBitmap
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Viewlib_Hokeys_Descr
,
HK_ZOOM_OUT
);
HK_ZOOM_OUT
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_OUT
,
wxEmptyString
,
wxBitmap
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redraw view"
),
s_Viewlib_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
HK_ZOOM_REDRAW
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW
,
wxEmptyString
,
wxBitmap
(
zoom_redraw_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Viewlib_Hokeys_Descr
,
HK_ZOOM_AUTO
);
HK_ZOOM_AUTO
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
wxBitmap
(
zoom_auto_xpm
),
msg
);
...
...
include/hotkeys_basic.h
View file @
1ee86d4a
...
...
@@ -64,12 +64,51 @@ extern int g_ConfigFileLocationChoice;
wxString
ReturnHotkeyConfigFilePath
(
int
choice
);
void
AddHotkeyConfigMenu
(
wxMenu
*
menu
);
void
HandleHotkeyConfigMenuSelection
(
WinEDA_DrawFrame
*
frame
,
int
id
);
wxString
ReturnKeyNameFromKeyCode
(
int
keycode
);
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
List
,
int
CommandId
);
wxString
AddHotkeyName
(
const
wxString
&
text
,
Ki_HotkeyInfo
**
List
,
int
CommandId
);
wxString
AddHotkeyName
(
const
wxString
&
text
,
struct
Ki_HotkeyInfoSectionDescriptor
*
DescrList
,
int
CommandId
);
/** function ReturnKeyNameFromKeyCode
* return the key name from the key code
* Only some wxWidgets key values are handled for function key ( see
* s_Hotkey_Name_List[] )
* @param aKeycode = key code (ascii value, or wxWidgets value for function keys)
* @return the key name in a wxString
*/
wxString
ReturnKeyNameFromKeyCode
(
int
aKeycode
);
/** function ReturnKeyNameFromCommandId
* return the key name from the Command id value ( m_Idcommand member value)
* @param aList = pointer to a Ki_HotkeyInfo list of commands
* @param aCommandId = Command Id value
* @return the key name in a wxString
*/
wxString
ReturnKeyNameFromCommandId
(
Ki_HotkeyInfo
**
aList
,
int
aCommandId
);
/** function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value)
* @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfo list of commands
* @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
* = false to add <spaces><(keyname)>
* @return a wxString (aTest + key name) if key found or aText without modification
*/
wxString
AddHotkeyName
(
const
wxString
&
aText
,
Ki_HotkeyInfo
**
aList
,
int
aCommandId
,
bool
aIsShortCut
=
true
);
/** function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value)
* @param aText = a wxString. returns aText + key name
* @param aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands
* @param aCommandId = Command Id value
* @param aIsShortCut = true to add <tab><keyname> (active shortcuts in menus)
* = false to add <spaces><(keyname)>
* @return a wxString (aTest + key name) if key found or aText without modification
*/
wxString
AddHotkeyName
(
const
wxString
&
aText
,
struct
Ki_HotkeyInfoSectionDescriptor
*
aDescrList
,
int
aCommandId
,
bool
aIsShortCut
=
true
);
void
DisplayHotkeyList
(
WinEDA_DrawFrame
*
frame
,
struct
Ki_HotkeyInfoSectionDescriptor
*
List
);
Ki_HotkeyInfo
*
GetDescriptorFromHotkey
(
int
key
,
Ki_HotkeyInfo
**
List
);
...
...
internat/fr/kicad.mo
View file @
1ee86d4a
No preview for this file type
internat/fr/kicad.po
View file @
1ee86d4a
This diff is collapsed.
Click to expand it.
pcbnew/hotkeys.cpp
View file @
1ee86d4a
...
...
@@ -87,9 +87,21 @@ static Ki_HotkeyInfo HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE,
static
Ki_HotkeyInfo
HkResetLocalCoord
(
wxT
(
"Reset local coord."
),
HK_RESET_LOCAL_COORD
,
' '
);
/* Fit on Screen */
#if !defined( __WXMAC__ )
static
Ki_HotkeyInfo
HkZoomAuto
(
wxT
(
"Zoom Auto"
),
HK_ZOOM_AUTO
,
WXK_HOME
);
#else
static
Ki_HotkeyInfo
HkZoomAuto
(
wxT
(
"Zoom Auto"
),
HK_ZOOM_AUTO
,
GR_KB_CTRL
+
'0'
);
#endif
static
Ki_HotkeyInfo
HkZoomCenter
(
wxT
(
"Zoom Center"
),
HK_ZOOM_CENTER
,
WXK_F4
);
/* Refresh Screen */
#if !defined( __WXMAC__ )
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
WXK_F3
);
#else
static
Ki_HotkeyInfo
HkZoomRedraw
(
wxT
(
"Zoom Redraw"
),
HK_ZOOM_REDRAW
,
GR_KB_CTRL
+
'R'
);
#endif
/* Zoom In */
#if !defined( __WXMAC__ )
...
...
pcbnew/menubar_pcbframe.cpp
View file @
1ee86d4a
...
...
@@ -36,7 +36,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu
*
filesMenu
=
new
wxMenu
;
/* New Board */
item
=
new
wxMenuItem
(
filesMenu
,
ID_NEW_BOARD
,
_
(
"&New
\t
Ctrl+N
"
),
item
=
new
wxMenuItem
(
filesMenu
,
ID_NEW_BOARD
,
_
(
"&New"
),
_
(
"Clear current board and initialize a new one"
)
);
item
->
SetBitmap
(
new_xpm
);
filesMenu
->
Append
(
item
);
...
...
@@ -73,7 +73,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Save As */
item
=
new
wxMenuItem
(
filesMenu
,
ID_SAVE_BOARD_AS
,
_
(
"Save as...
\t
Shift+Ctrl+S
"
),
_
(
"Save as..."
),
_
(
"Save the current board as.."
)
);
item
->
SetBitmap
(
save_as_xpm
);
filesMenu
->
Append
(
item
);
...
...
@@ -186,7 +186,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu
->
AppendSeparator
();
/* Print */
item
=
new
wxMenuItem
(
filesMenu
,
ID_GEN_PRINT
,
_
(
"&Print
\t
Ctrl+P
"
),
item
=
new
wxMenuItem
(
filesMenu
,
ID_GEN_PRINT
,
_
(
"&Print"
),
_
(
"Print pcb board"
)
);
item
->
SetBitmap
(
print_button
);
filesMenu
->
Append
(
item
);
...
...
@@ -240,22 +240,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu
*
editMenu
=
new
wxMenu
;
/* Undo */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Undo"
),
s_Pcbnew_Editor_Hokeys_Descr
,
HK_UNDO
);
#else
text
=
_
(
"Undo
\t
Ctrl+Z"
);
#endif
item
=
new
wxMenuItem
(
editMenu
,
wxID_UNDO
,
text
,
_
(
"Undo last edition"
),
wxITEM_NORMAL
);
item
->
SetBitmap
(
undo_xpm
);
editMenu
->
Append
(
item
);
/* Redo */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Redo"
),
s_Pcbnew_Editor_Hokeys_Descr
,
HK_REDO
);
#else
text
=
_
(
"Redo
\t
Shift+Ctrl+Z"
);
#endif
item
=
new
wxMenuItem
(
editMenu
,
wxID_REDO
,
text
,
_
(
"Redo the last undo command"
),
wxITEM_NORMAL
);
item
->
SetBitmap
(
redo_xpm
);
...
...
@@ -265,12 +257,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
editMenu
->
AppendSeparator
();
/* Find */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"&Find"
),
s_Pcbnew_Editor_Hokeys_Descr
,
HK_FIND_ITEM
);
#else
text
=
_
(
"Find
\t
Ctrl+F"
);
#endif
item
=
new
wxMenuItem
(
editMenu
,
ID_FIND_ITEMS
,
text
,
_
(
"Find components and text in current loaded board"
)
);
item
->
SetBitmap
(
find_xpm
);
...
...
@@ -332,12 +319,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu
->
Append
(
item
);
/* Fit on Screen */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Fit on Screen"
),
s_Pcbnew_Editor_Hokeys_Descr
,
HK_ZOOM_AUTO
);
#else
text
=
_
(
"Fit on Screen
\t
Ctrl+0"
);
#endif
item
=
new
wxMenuItem
(
viewMenu
,
ID_ZOOM_PAGE
,
text
,
_
(
"Zoom to fit the board on the screen"
),
...
...
@@ -348,12 +331,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu
->
AppendSeparator
();
/* Redraw view */
#if !defined( __WXMAC__)
text
=
AddHotkeyName
(
_
(
"Redraw"
),
s_Pcbnew_Editor_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
#else
text
=
_
(
"Redraw
\t
Ctrl+R"
);
#endif
item
=
new
wxMenuItem
(
viewMenu
,
ID_ZOOM_REDRAW
,
text
,
_
(
"Redraw the screen of the board"
),
...
...
pcbnew/tool_modedit.cpp
View file @
1ee86d4a
...
...
@@ -101,22 +101,22 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Module_Editor_Hokeys_Descr
,
HK_ZOOM_IN
);
HK_ZOOM_IN
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_IN
,
wxEmptyString
,
wxBitmap
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Module_Editor_Hokeys_Descr
,
HK_ZOOM_OUT
);
HK_ZOOM_OUT
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_OUT
,
wxEmptyString
,
wxBitmap
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redraw view"
),
s_Module_Editor_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
HK_ZOOM_REDRAW
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW
,
wxEmptyString
,
wxBitmap
(
zoom_redraw_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Module_Editor_Hokeys_Descr
,
HK_ZOOM_AUTO
);
HK_ZOOM_AUTO
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
wxBitmap
(
zoom_auto_xpm
),
msg
);
...
...
pcbnew/tool_pcb.cpp
View file @
1ee86d4a
...
...
@@ -236,29 +236,29 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Zoom in"
),
s_Board_Editor_Hokeys_Descr
,
HK_ZOOM_IN
);
HK_ZOOM_IN
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_IN
,
wxEmptyString
,
wxBitmap
(
zoom_in_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom out"
),
s_Board_Editor_Hokeys_Descr
,
HK_ZOOM_OUT
);
HK_ZOOM_OUT
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_OUT
,
wxEmptyString
,
wxBitmap
(
zoom_out_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Redraw view"
),
s_Board_Editor_Hokeys_Descr
,
HK_ZOOM_REDRAW
);
HK_ZOOM_REDRAW
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_REDRAW
,
wxEmptyString
,
wxBitmap
(
zoom_redraw_xpm
),
msg
);
msg
=
AddHotkeyName
(
_
(
"Zoom auto"
),
s_Board_Editor_Hokeys_Descr
,
HK_ZOOM_AUTO
);
HK_ZOOM_AUTO
,
false
);
m_HToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
wxBitmap
(
zoom_auto_xpm
),
msg
);
m_HToolBar
->
AddSeparator
();
msg
=
AddHotkeyName
(
_
(
"Find components and texts"
),
s_Board_Editor_Hokeys_Descr
,
HK_FIND_ITEM
);
HK_FIND_ITEM
,
false
);
m_HToolBar
->
AddTool
(
ID_FIND_ITEMS
,
wxEmptyString
,
wxBitmap
(
find_xpm
),
msg
);
...
...
@@ -740,14 +740,10 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
if
(
g_TabOneLayerMask
[
layer
]
&
layer_mask
)
{
wxString
msg
=
GetBoard
()
->
GetLayerName
(
layer
);
msg
<<
wxT
(
" "
);
msg
=
AddHotkeyName
(
msg
,
s_Board_Editor_Hokeys_Descr
,
HK_SwitchLayer
[
layer
]
);
HK_SwitchLayer
[
layer
]
,
false
);
/* we are using tabs in AddHotkeyName message.
* this is not handled by m_SelLayerBox.
* so we replace them by 3 spaces
*/
msg
.
Replace
(
wxT
(
"
\t
"
),
wxT
(
" "
)
);
m_SelLayerBox
->
Append
(
msg
);
//D(printf("appending layername=%s, ndx=%d, layer=%d\n", CONV_TO_UTF8(msg), listNdx, layer );)
...
...
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