Commit 1ee86d4a authored by charras's avatar charras

code cleanup and enhancements about hotkeys

parent e1412214
......@@ -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 keycode )
wxString ReturnKeyNameFromKeyCode( int aKeycode )
{
wxString keyname, modifier, fullkeyname;
int ii;
if( (keycode & GR_KB_CTRL) != 0 )
if( (aKeycode & GR_KB_CTRL) != 0 )
modifier << wxT( "Ctrl+" );
if( (keycode & GR_KB_ALT) != 0 )
if( (aKeycode & GR_KB_ALT) != 0 )
modifier << wxT( "Alt+" );
if( (keycode & GR_KB_SHIFT) != 0 )
if( (aKeycode & GR_KB_SHIFT) != 0 )
modifier << wxT( "Shift+" );
keycode &= ~( GR_KB_CTRL | GR_KB_ALT | GR_KB_SHIFT );
aKeycode &= ~( 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 == keycode )
if( s_Hotkey_Name_List[ii].m_KeyCode == aKeycode )
{
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 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** List, int CommandId )
wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandId )
{
wxString keyname;
for( ; *List != NULL; List++ )
for( ; *aList != NULL; aList++ )
{
Ki_HotkeyInfo* hk_decr = *List;
if( hk_decr->m_Idcommand == CommandId )
Ki_HotkeyInfo* hk_decr = *aList;
if( hk_decr->m_Idcommand == aCommandId )
{
keyname = ReturnKeyNameFromKeyCode( hk_decr->m_KeyCode );
break;
......
......@@ -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 )
{
......
......@@ -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,
......
......@@ -79,7 +79,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
/* Save as... */
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
_( "Save Current Sheet &as\tShift+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\tCtrl+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\tCtrl+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\tCtrl+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\tCtrl+R" );
#endif
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
_( "Redraw the schematic view" ),
......
......@@ -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 );
......
......@@ -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 ),
......
......@@ -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 );
......
......@@ -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 );
......
No preview for this file type
This diff is collapsed.
......@@ -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__ )
......
......@@ -36,7 +36,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* filesMenu = new wxMenu;
/* New Board */
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New\tCtrl+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...\tShift+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\tCtrl+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\tCtrl+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\tShift+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\tCtrl+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\tCtrl+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\tCtrl+R" );
#endif
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
_( "Redraw the screen of the board" ),
......
......@@ -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 );
......
......@@ -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 );)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment