Commit 8db19bbd authored by jean-pierre charras's avatar jean-pierre charras

Preparing hotkeys/shortcuts changes in place menu.

parent edd35b4e
...@@ -143,7 +143,7 @@ void LAYER_BOX_SELECTOR::Resync() ...@@ -143,7 +143,7 @@ void LAYER_BOX_SELECTOR::Resync()
layername = board->GetLayerName( layerid ); layername = board->GetLayerName( layerid );
if( m_layerhotkeys && m_hotkeys != NULL ) if( m_layerhotkeys && m_hotkeys != NULL )
layername = AddHotkeyName( layername, m_hotkeys, layerhk[layerid], false ); layername = AddHotkeyName( layername, m_hotkeys, layerhk[layerid], IS_COMMENT );
Append( layername, layerbmp, (void*) layerid ); Append( layername, layerbmp, (void*) layerid );
} }
......
...@@ -171,17 +171,40 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound ) ...@@ -171,17 +171,40 @@ wxString ReturnKeyNameFromKeyCode( int aKeycode, bool* aIsFound )
} }
/*
* helper function use in AddHotkeyName to calculate an accelerator string
* In some menus, accelerators do not perform exactely the same action as
* the hotkey that perfoms a similar action.
* this is usually the case when this action uses the current mouse position
* for instance zoom action is ran from the F1 key or the Zoom menu.
* a zoom uses the mouse position from a hot key and not from the menu
* In this case, the accelerator if Shift+<hotkey>
* But for some keys, the Shift modifier is not usable, and the accelerator is Alt+<hotkey>
*/
static void AddModifierToKey( wxString& aFullKey, const wxString & aKey )
{
#if 1 // set to 0 for new behavior, 1 for old
aFullKey << wxT( " <" ) << aKey << wxT( ">" );
#else
if( aKey.IsSameAs(wxT( "/" ) ) )
aFullKey << wxT( "\t" ) << MODIFIER_ALT << aKey;
else
aFullKey << wxT( "\t" ) << MODIFIER_SHIFT << aKey;
#endif
}
/* AddHotkeyName /* AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value) * Add the key name from the Command id value ( m_Idcommand member value)
* aText = a wxString. returns aText + key name * aText = a wxString. returns aText + key name
* aList = pointer to a Ki_HotkeyInfo list of commands * aList = pointer to a Ki_HotkeyInfo list of commands
* aCommandId = Command Id value * aCommandId = Command Id value
* aIsShortCut = true to add <tab><keyname> (active shortcuts in menus) * aShortCutType = IS_HOTKEY to add <tab><keyname> (shortcuts in menus, same as hotkeys)
* = false to add <spaces><(keyname)> * IS_ACCELERATOR to add <tab><Shift+keyname> (accelerators in menus, not hotkeys)
* IS_COMMENT to add <spaces><(keyname)> mainly in tooltips
* Return a wxString (aTest + key name) if key found or aText without modification * Return a wxString (aTest + key name) if key found or aText without modification
*/ */
wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
int aCommandId, bool aIsShortCut ) int aCommandId, HOTKEY_ACTION_TYPE aShortCutType )
{ {
wxString msg = aText; wxString msg = aText;
wxString keyname; wxString keyname;
...@@ -191,10 +214,18 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, ...@@ -191,10 +214,18 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
if( !keyname.IsEmpty() ) if( !keyname.IsEmpty() )
{ {
if( aIsShortCut ) switch( aShortCutType )
msg << wxT( "\t" ) << keyname; {
else case IS_HOTKEY:
msg << wxT( " <" ) << keyname << wxT( ">" ); msg << wxT( "\t" ) << keyname;
break;
case IS_ACCELERATOR:
AddModifierToKey( msg, keyname );
break;
case IS_COMMENT:
msg << wxT( " (" ) << keyname << wxT( ")" );
break;
}
} }
return msg; return msg;
...@@ -206,14 +237,15 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, ...@@ -206,14 +237,15 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
* aText = a wxString. returns aText + key name * aText = a wxString. returns aText + key name
* aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands * aList = pointer to a Ki_HotkeyInfoSectionDescriptor DescrList of commands
* aCommandId = Command Id value * aCommandId = Command Id value
* aIsShortCut = true to add <tab><keyname> (active shortcuts in menus) * aShortCutType = IS_HOTKEY to add <tab><keyname> (active shortcuts in menus)
* = false to add <spaces><(keyname)> * IS_ACCELERATOR to add <tab><Shift+keyname> (active accelerators in menus)
* IS_COMMENT to add <spaces><(keyname)>
* Return a wxString (aText + key name) if key found or aText without modification * Return a wxString (aText + key name) if key found or aText without modification
*/ */
wxString AddHotkeyName( const wxString& aText, wxString AddHotkeyName( const wxString& aText,
struct Ki_HotkeyInfoSectionDescriptor* aDescList, struct Ki_HotkeyInfoSectionDescriptor* aDescList,
int aCommandId, int aCommandId,
bool aIsShortCut ) HOTKEY_ACTION_TYPE aShortCutType )
{ {
wxString msg = aText; wxString msg = aText;
wxString keyname; wxString keyname;
...@@ -228,11 +260,18 @@ wxString AddHotkeyName( const wxString& aText, ...@@ -228,11 +260,18 @@ wxString AddHotkeyName( const wxString& aText,
if( !keyname.IsEmpty() ) if( !keyname.IsEmpty() )
{ {
if( aIsShortCut ) switch( aShortCutType )
msg << wxT( "\t" ) << keyname; {
else case IS_HOTKEY:
msg << wxT( " <" ) << keyname << wxT( ">" ); msg << wxT( "\t" ) << keyname;
break;
case IS_ACCELERATOR:
AddModifierToKey( msg, keyname );
break;
case IS_COMMENT:
msg << wxT( " (" ) << keyname << wxT( ")" );
break;
}
break; break;
} }
} }
......
This diff is collapsed.
...@@ -116,9 +116,9 @@ void LIB_EDIT_FRAME::ReCreateHToolbar() ...@@ -116,9 +116,9 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
_( "Save current component to new library" ) ); _( "Save current component to new library" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr, HK_UNDO, false ); msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg ); m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr, HK_REDO, false ); msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr, HK_REDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg ); m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
...@@ -133,16 +133,16 @@ void LIB_EDIT_FRAME::ReCreateHToolbar() ...@@ -133,16 +133,16 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
_( "Test for duplicate pins and off grid pins" ) ); _( "Test for duplicate pins and off grid pins" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_ZOOM_IN, s_Libedit_Hokeys_Descr, HK_ZOOM_IN, false ); msg = AddHotkeyName( HELP_ZOOM_IN, s_Libedit_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, s_Libedit_Hokeys_Descr, HK_ZOOM_OUT, false ); msg = AddHotkeyName( HELP_ZOOM_OUT, s_Libedit_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW, false ); msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_FIT, s_Libedit_Hokeys_Descr, HK_ZOOM_AUTO, false ); msg = AddHotkeyName( HELP_ZOOM_FIT, s_Libedit_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -64,33 +64,33 @@ void SCH_EDIT_FRAME::ReCreateHToolbar() ...@@ -64,33 +64,33 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_UNDO, s_Schematic_Hokeys_Descr, HK_UNDO, false ); msg = AddHotkeyName( HELP_UNDO, s_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg ); m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), msg );
msg = AddHotkeyName( HELP_REDO, s_Schematic_Hokeys_Descr, HK_REDO, false ); msg = AddHotkeyName( HELP_REDO, s_Schematic_Hokeys_Descr, HK_REDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg ); m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_FIND, s_Schematic_Hokeys_Descr, HK_FIND_ITEM, false ); msg = AddHotkeyName( HELP_FIND, s_Schematic_Hokeys_Descr, HK_FIND_ITEM, IS_COMMENT );
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg ); m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_ZOOM_IN, s_Schematic_Hokeys_Descr, HK_ZOOM_IN, false ); msg = AddHotkeyName( HELP_ZOOM_IN, s_Schematic_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, s_Schematic_Hokeys_Descr, HK_ZOOM_OUT, false ); msg = AddHotkeyName( HELP_ZOOM_OUT, s_Schematic_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW, false ); msg = AddHotkeyName( HELP_ZOOM_REDRAW, s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_FIT, s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO, false ); msg = AddHotkeyName( HELP_ZOOM_FIT, s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
......
...@@ -47,22 +47,22 @@ void LIB_VIEW_FRAME::ReCreateHToolbar() ...@@ -47,22 +47,22 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Viewlib_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom in" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_IN, false ); HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
KiBitmap( zoom_in_xpm ), msg ); KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), s_Viewlib_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom out" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_OUT, false ); HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
KiBitmap( zoom_out_xpm ), msg ); KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), s_Viewlib_Hokeys_Descr, msg = AddHotkeyName( _( "Redraw view" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_REDRAW, false ); HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
KiBitmap( zoom_redraw_xpm ), msg ); KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Viewlib_Hokeys_Descr, msg = AddHotkeyName( _( "Zoom auto" ), s_Viewlib_Hokeys_Descr,
HK_ZOOM_AUTO, false ); HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
KiBitmap( zoom_fit_in_page_xpm ), msg ); KiBitmap( zoom_fit_in_page_xpm ), msg );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -42,16 +42,16 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void ) ...@@ -42,16 +42,16 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
_( "Print layers" ) ); _( "Print layers" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_IN, false ); msg = AddHotkeyName( _( "Zoom in" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_OUT, false ); msg = AddHotkeyName( _( "Zoom out" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_REDRAW, false ); msg = AddHotkeyName( _( "Redraw view" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_AUTO, false ); msg = AddHotkeyName( _( "Zoom auto" ), s_Gerbview_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
class EDA_DRAW_FRAME; class EDA_DRAW_FRAME;
/* Class to handle hotkey commnands. hotkeys have a default value /* Class to handle hotkey commands. hotkeys have a default value
* This class allows the real key code changed by user(from a key code list file) * This class allows the real key code changed by user(from a key code list file)
*/ */
class Ki_HotkeyInfo class Ki_HotkeyInfo
...@@ -93,6 +93,20 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandI ...@@ -93,6 +93,20 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** aList, int aCommandI
*/ */
int ReturnKeyCodeFromKeyName( const wxString& keyname ); int ReturnKeyCodeFromKeyName( const wxString& keyname );
/* An helper enum for AddHotkeyName function
* In menus we can an a hot key, or an accelerator , or sometimes just a comment
* Hot keys can perform actions using the current mouse cursor position
* Accelerators performs the same action as the associated menu
* A comment is used in tool tips for some tools (zoom ..)
* to show the hot key that perfoms this action
*/
enum HOTKEY_ACTION_TYPE
{
IS_HOTKEY,
IS_ACCELERATOR,
IS_COMMENT
};
/** /**
* Function AddHotkeyName * Function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value) * Add the key name from the Command id value ( m_Idcommand member value)
...@@ -105,7 +119,7 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname ); ...@@ -105,7 +119,7 @@ int ReturnKeyCodeFromKeyName( const wxString& keyname );
*/ */
wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
int aCommandId, int aCommandId,
bool aIsShortCut = true); HOTKEY_ACTION_TYPE aShortCutType = IS_HOTKEY);
/** /**
* Function AddHotkeyName * Function AddHotkeyName
...@@ -120,7 +134,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList, ...@@ -120,7 +134,7 @@ wxString AddHotkeyName( const wxString& aText, Ki_HotkeyInfo** aList,
wxString AddHotkeyName( const wxString& aText, wxString AddHotkeyName( const wxString& aText,
struct Ki_HotkeyInfoSectionDescriptor* aDescrList, struct Ki_HotkeyInfoSectionDescriptor* aDescrList,
int aCommandId, int aCommandId,
bool aIsShortCut = true); HOTKEY_ACTION_TYPE aShortCutType = IS_HOTKEY );
/** /**
* Function DisplayHotkeyList * Function DisplayHotkeyList
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -44,11 +44,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -44,11 +44,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
filesMenu->Append( item ); filesMenu->Append( item );
// Open // Open
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, text = AddHotkeyName( _( "&Open" ), g_Board_Editor_Hokeys_Descr,
_( "&Open\tCtrl+O" ), HK_LOAD_BOARD );
_( "Delete current board and load new board" ) ); AddMenuItem( filesMenu, ID_LOAD_FILE, text,
SET_BITMAP( KiBitmap( open_document_xpm ) ); _( "Delete current board and load new board" ),
filesMenu->Append( item ); KiBitmap( open_document_xpm ) );
// Load Recent submenu // Load Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
...@@ -78,11 +78,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -78,11 +78,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
// Save // Save
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD, text = AddHotkeyName( _( "&Save" ), g_Board_Editor_Hokeys_Descr,
_( "&Save\tCtrl+S" ), HK_SAVE_BOARD );
_( "Save current board" ) ); AddMenuItem( filesMenu, ID_SAVE_BOARD, text,
SET_BITMAP( KiBitmap( save_xpm ) ); _( "Save current board" ),
filesMenu->Append( item ); KiBitmap( save_xpm ) );
// Save As // Save As
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS, item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
...@@ -204,7 +204,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -204,7 +204,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Print // Print
item = new wxMenuItem( filesMenu, wxID_PRINT, item = new wxMenuItem( filesMenu, wxID_PRINT,
_( "&Print\tCtrl+P" ), _( "&Print" ),
_( "Print board" ) ); _( "Print board" ) );
SET_BITMAP( KiBitmap( print_button_xpm ) ); SET_BITMAP( KiBitmap( print_button_xpm ) );
filesMenu->Append( item ); filesMenu->Append( item );
...@@ -336,20 +336,23 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -336,20 +336,23 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
* for Zoom in and Zoom out sub menus * for Zoom in and Zoom out sub menus
*/ */
// Zoom In // Zoom In
text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN, false ); text = AddHotkeyName( _( "Zoom In" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_IN, IS_ACCELERATOR );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL ); item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL );
SET_BITMAP( KiBitmap( zoom_in_xpm ) ); SET_BITMAP( KiBitmap( zoom_in_xpm ) );
viewMenu->Append( item ); viewMenu->Append( item );
// Zoom Out // Zoom Out
text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_OUT, false ); text = AddHotkeyName( _( "Zoom Out" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_OUT, IS_ACCELERATOR );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL ); item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL );
SET_BITMAP( KiBitmap( zoom_out_xpm ) ); SET_BITMAP( KiBitmap( zoom_out_xpm ) );
viewMenu->Append( item ); viewMenu->Append( item );
// Fit on Screen // Fit on Screen
text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_AUTO ); text = AddHotkeyName( _( "Fit on Screen" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ZOOM_AUTO );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL ); item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL );
SET_BITMAP( KiBitmap( zoom_fit_in_page_xpm ) ); SET_BITMAP( KiBitmap( zoom_fit_in_page_xpm ) );
...@@ -361,8 +364,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -361,8 +364,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW ); text = AddHotkeyName( _( "Redraw" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_REDRAW );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, HELP_ZOOM_REDRAW, wxITEM_NORMAL );
wxITEM_NORMAL );
SET_BITMAP( KiBitmap( zoom_redraw_xpm ) ); SET_BITMAP( KiBitmap( zoom_redraw_xpm ) );
viewMenu->Append( item ); viewMenu->Append( item );
viewMenu->AppendSeparator(); viewMenu->AppendSeparator();
...@@ -387,7 +389,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -387,7 +389,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* placeMenu = new wxMenu; wxMenu* placeMenu = new wxMenu;
// Module // Module
text = AddHotkeyName( _( "Module" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_MODULE, false ); text = AddHotkeyName( _( "Module" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_MODULE, IS_ACCELERATOR );
item = new wxMenuItem( placeMenu, ID_PCB_MODULE_BUTT, text, item = new wxMenuItem( placeMenu, ID_PCB_MODULE_BUTT, text,
_( "Add modules" ), wxITEM_NORMAL ); _( "Add modules" ), wxITEM_NORMAL );
...@@ -395,7 +397,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -395,7 +397,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
placeMenu->Append( item ); placeMenu->Append( item );
// Track // Track
text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, false ); text = AddHotkeyName( _( "Track" ), g_Pcbnew_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK, IS_ACCELERATOR );
item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text, item = new wxMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), wxITEM_NORMAL ); _( "Add tracks and vias" ), wxITEM_NORMAL );
......
...@@ -87,16 +87,16 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() ...@@ -87,16 +87,16 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar()
_( "Print module" ) ); _( "Print module" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_IN, false ); msg = AddHotkeyName( _( "Zoom in" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( _( "Zoom out" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_OUT, false ); msg = AddHotkeyName( _( "Zoom out" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, false ); msg = AddHotkeyName( _( "Redraw view" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_AUTO, false ); msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Editor_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -217,9 +217,9 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() ...@@ -217,9 +217,9 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
#endif #endif
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_UNDO, g_Board_Editor_Hokeys_Descr, HK_UNDO, false ); msg = AddHotkeyName( HELP_UNDO, g_Board_Editor_Hokeys_Descr, HK_UNDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), HELP_UNDO ); m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, KiBitmap( undo_xpm ), HELP_UNDO );
msg = AddHotkeyName( HELP_REDO, g_Board_Editor_Hokeys_Descr, HK_REDO, false ); msg = AddHotkeyName( HELP_REDO, g_Board_Editor_Hokeys_Descr, HK_REDO, IS_COMMENT );
m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), HELP_REDO ); m_HToolBar->AddTool( wxID_REDO, wxEmptyString, KiBitmap( redo_xpm ), HELP_REDO );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
...@@ -229,20 +229,20 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() ...@@ -229,20 +229,20 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
_( "Plot (HPGL, PostScript, or GERBER format)" ) ); _( "Plot (HPGL, PostScript, or GERBER format)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_ZOOM_IN, g_Board_Editor_Hokeys_Descr, HK_ZOOM_IN, false ); msg = AddHotkeyName( HELP_ZOOM_IN, g_Board_Editor_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_OUT, false ); msg = AddHotkeyName( HELP_ZOOM_OUT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Board_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, false ); msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Board_Editor_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, KiBitmap( zoom_redraw_xpm ), msg );
msg = AddHotkeyName( HELP_ZOOM_FIT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_AUTO, false ); msg = AddHotkeyName( HELP_ZOOM_FIT, g_Board_Editor_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg ); m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( HELP_FIND, g_Board_Editor_Hokeys_Descr, HK_FIND_ITEM, false ); msg = AddHotkeyName( HELP_FIND, g_Board_Editor_Hokeys_Descr, HK_FIND_ITEM, IS_COMMENT );
m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg ); m_HToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiBitmap( find_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
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