Preparing hotkeys/shortcuts changes in place menu.

This commit is contained in:
jean-pierre charras 2011-09-23 22:00:30 +02:00
parent edd35b4e90
commit 8db19bbd6a
18 changed files with 2822 additions and 2767 deletions

View File

@ -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 );
} }

View File

@ -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,
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,
* 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,
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;
} }
} }

View File

@ -42,17 +42,17 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// New // New
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_NEW_PROJECT, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ), _( "&New\tCtrl+N" ),
_( "New schematic project" ), _( "New schematic project" ),
KiBitmap( new_xpm ) ); KiBitmap( new_xpm ) );
// Open // Open
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_LOAD_PROJECT, ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ), _( "&Open\tCtrl+O" ),
_( "Open an existing schematic project" ), _( "Open an existing schematic project" ),
KiBitmap( open_document_xpm ) ); KiBitmap( open_document_xpm ) );
// Open Recent submenu // Open Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
@ -66,106 +66,106 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxGetApp().m_fileHistory.UseMenu( openRecentMenu ); wxGetApp().m_fileHistory.UseMenu( openRecentMenu );
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu ); wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
AddMenuItem( fileMenu, openRecentMenu, AddMenuItem( fileMenu, openRecentMenu,
wxID_ANY, _( "Open &Recent" ), wxID_ANY, _( "Open &Recent" ),
_( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ),
KiBitmap( open_project_xpm ) ); KiBitmap( open_project_xpm ) );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Save schematic project // Save schematic project
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_PROJECT, ID_SAVE_PROJECT,
_( "&Save Whole Schematic Project\tCtrl+S" ), _( "&Save Whole Schematic Project\tCtrl+S" ),
_( "Save all sheets in the schematic project" ), _( "Save all sheets in the schematic project" ),
KiBitmap( save_project_xpm ) ); KiBitmap( save_project_xpm ) );
// Save current sheet // Save current sheet
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET, ID_SAVE_ONE_SHEET,
_( "Save &Current Sheet Only" ), _( "Save &Current Sheet Only" ),
_( "Save only current schematic sheet" ), _( "Save only current schematic sheet" ),
KiBitmap( save_xpm ) ); KiBitmap( save_xpm ) );
// Save current sheet as // Save current sheet as
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_SAVE_ONE_SHEET_AS, ID_SAVE_ONE_SHEET_AS,
_( "Save Current Sheet &as" ), _( "Save Current Sheet &as" ),
_( "Save current schematic sheet as..." ), _( "Save current schematic sheet as..." ),
KiBitmap( save_as_xpm ) ); KiBitmap( save_as_xpm ) );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Page settings // Page settings
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_SHEET_SET, ID_SHEET_SET,
_( "P&age Settings" ), _( "P&age Settings" ),
_( "Settigns for page size and information" ), _( "Settigns for page size and information" ),
KiBitmap( sheetset_xpm ) ); KiBitmap( sheetset_xpm ) );
// Print // Print
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
wxID_PRINT, wxID_PRINT,
_( "P&rint" ), _( "P&rint" ),
_( "Print schematic" ), _( "Print schematic" ),
KiBitmap( print_button_xpm ) ); KiBitmap( print_button_xpm ) );
// Plot submenu // Plot submenu
wxMenu* choice_plot_fmt = new wxMenu; wxMenu* choice_plot_fmt = new wxMenu;
// Plot PostScript // Plot PostScript
AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS, AddMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
_( "Plot PostScript" ), _( "Plot PostScript" ),
_( "Plot schematic sheet in PostScript format" ), _( "Plot schematic sheet in PostScript format" ),
KiBitmap( plot_ps_xpm ) ); KiBitmap( plot_ps_xpm ) );
// Plot HPGL // Plot HPGL
AddMenuItem( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_HPGL, ID_GEN_PLOT_HPGL,
_( "Plot HPGL" ), _( "Plot HPGL" ),
_( "Plot schematic sheet in HPGL format" ), _( "Plot schematic sheet in HPGL format" ),
KiBitmap( plot_hpg_xpm ) ); KiBitmap( plot_hpg_xpm ) );
// Plot SVG // Plot SVG
AddMenuItem( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_SVG, ID_GEN_PLOT_SVG,
_( "Plot SVG" ), _( "Plot SVG" ),
_( "Plot schematic sheet in SVG format" ), _( "Plot schematic sheet in SVG format" ),
KiBitmap( plot_xpm ) ); KiBitmap( plot_xpm ) );
// Plot DXF // Plot DXF
AddMenuItem( choice_plot_fmt, AddMenuItem( choice_plot_fmt,
ID_GEN_PLOT_DXF, ID_GEN_PLOT_DXF,
_( "Plot DXF" ), _( "Plot DXF" ),
_( "Plot schematic sheet in DXF format" ), _( "Plot schematic sheet in DXF format" ),
KiBitmap( plot_xpm ) ); KiBitmap( plot_xpm ) );
// Plot to Clipboard (Windows only) // Plot to Clipboard (Windows only)
#ifdef __WINDOWS__ #ifdef __WINDOWS__
AddMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD, AddMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
_( "Plot to Clipboard" ), _( "Plot to Clipboard" ),
_( "Export drawings to clipboard" ), _( "Export drawings to clipboard" ),
KiBitmap( copy_button_xpm ) ); KiBitmap( copy_button_xpm ) );
#endif // __WINDOWS__ #endif // __WINDOWS__
// Plot submenu // Plot submenu
AddMenuItem( fileMenu, choice_plot_fmt, AddMenuItem( fileMenu, choice_plot_fmt,
ID_GEN_PLOT, _( "&Plot" ), ID_GEN_PLOT, _( "&Plot" ),
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ), _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
KiBitmap( plot_xpm ) ); KiBitmap( plot_xpm ) );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit EESchema" ), _( "Quit EESchema" ),
KiBitmap( exit_xpm ) ); KiBitmap( exit_xpm ) );
// Menu Edit: // Menu Edit:
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
@ -183,8 +183,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Delete // Delete
editMenu->AppendSeparator(); editMenu->AppendSeparator();
AddMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT, AddMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
_( "Delete" ), HELP_DELETE_ITEMS, _( "Delete" ), HELP_DELETE_ITEMS,
KiBitmap( delete_body_xpm ) ); KiBitmap( delete_body_xpm ) );
// Find // Find
editMenu->AppendSeparator(); editMenu->AppendSeparator();
@ -194,10 +194,10 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Backannotate // Backannotate
editMenu->AppendSeparator(); editMenu->AppendSeparator();
AddMenuItem( editMenu, AddMenuItem( editMenu,
ID_BACKANNO_ITEMS, ID_BACKANNO_ITEMS,
_( "&Backannotate" ), _( "&Backannotate" ),
_( "Back annotate the footprint fields" ), _( "Back annotate the footprint fields" ),
KiBitmap( import_footprint_names_xpm ) ); KiBitmap( import_footprint_names_xpm ) );
// Menu View: // Menu View:
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
@ -219,12 +219,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Zoom in // Zoom in
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_IN, false ); // add comment, not a shortcut HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) ); AddMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
// Zoom out // Zoom out
text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_OUT, false ); // add comment, not a shortcut HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) ); AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
// Fit on screen // Fit on screen
@ -237,10 +237,10 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Hierarchy // Hierarchy
AddMenuItem( viewMenu, AddMenuItem( viewMenu,
ID_HIERARCHY, ID_HIERARCHY,
_( "H&ierarchy" ), _( "H&ierarchy" ),
_( "Navigate schematic hierarchy" ), _( "Navigate schematic hierarchy" ),
KiBitmap( hierarchy_nav_xpm ) ); KiBitmap( hierarchy_nav_xpm ) );
// Redraw // Redraw
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW ); text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
@ -252,155 +252,155 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Component // Component
text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_SCH_PLACE_COMPONENT, text, AddMenuItem( placeMenu, ID_SCH_PLACE_COMPONENT, text,
HELP_PLACE_COMPONENTS, HELP_PLACE_COMPONENTS,
KiBitmap( add_component_xpm ) ); KiBitmap( add_component_xpm ) );
// Power port // Power port
text = AddHotkeyName( _( "Power Port" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Power Port" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_POWER, false ); // add comment, not a shortcut HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text, AddMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text,
HELP_PLACE_POWERPORT, HELP_PLACE_POWERPORT,
KiBitmap( add_power_xpm ) ); KiBitmap( add_power_xpm ) );
// Wire // Wire
text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_WIRE, false ); // add comment, not a shortcut HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_WIRE_BUTT, text, AddMenuItem( placeMenu, ID_WIRE_BUTT, text,
HELP_PLACE_WIRE, HELP_PLACE_WIRE,
KiBitmap( add_line_xpm ) ); KiBitmap( add_line_xpm ) );
// Bus // Bus
text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_BUS, false ); // add comment, not a shortcut HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_BUS_BUTT, text, AddMenuItem( placeMenu, ID_BUS_BUTT, text,
HELP_PLACE_BUS, HELP_PLACE_BUS,
KiBitmap( add_bus_xpm ) ); KiBitmap( add_bus_xpm ) );
// Wire to Bus entry // Wire to Bus entry
text = AddHotkeyName( _( "Wire to Bus Entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire to Bus Entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // addan accelerator, not a shortcut
AddMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text, AddMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
HELP_PLACE_WIRE2BUS_ENTRY, HELP_PLACE_WIRE2BUS_ENTRY,
KiBitmap( add_line2bus_xpm ) ); KiBitmap( add_line2bus_xpm ) );
// Bus to Bus entry // Bus to Bus entry
text = AddHotkeyName( _( "Bus to Bus Entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus to Bus Entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text, AddMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
HELP_PLACE_BUS2BUS_ENTRY, HELP_PLACE_BUS2BUS_ENTRY,
KiBitmap( add_bus2bus_xpm ) ); KiBitmap( add_bus2bus_xpm ) );
// No Connect Flag // No Connect Flag
text = AddHotkeyName( _( "No Connect Flag" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "No Connect Flag" ), s_Schematic_Hokeys_Descr,
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) ); AddMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
// Net name // Net name
text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_LABEL, false ); // add comment, not a shortcut HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_LABEL_BUTT, text, AddMenuItem( placeMenu, ID_LABEL_BUTT, text,
HELP_PLACE_NETLABEL, HELP_PLACE_NETLABEL,
KiBitmap( add_line_label_xpm ) ); KiBitmap( add_line_label_xpm ) );
// Global label // Global label
text = AddHotkeyName( _( "Global Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Global Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_GLABEL, false ); // add comment, not a shortcut HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_GLABEL_BUTT, text, AddMenuItem( placeMenu, ID_GLABEL_BUTT, text,
HELP_PLACE_GLOBALLABEL, HELP_PLACE_GLOBALLABEL,
KiBitmap( add_glabel_xpm ) ); KiBitmap( add_glabel_xpm ) );
// Junction // Junction
text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr,
HK_ADD_JUNCTION, false ); // add comment, not a shortcut HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_JUNCTION_BUTT, text, AddMenuItem( placeMenu, ID_JUNCTION_BUTT, text,
HELP_PLACE_JUNCTION, HELP_PLACE_JUNCTION,
KiBitmap( add_junction_xpm ) ); KiBitmap( add_junction_xpm ) );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
// Hierarchical label // Hierarchical label
text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_HIERLABEL_BUTT, AddMenuItem( placeMenu, ID_HIERLABEL_BUTT,
text, HELP_PLACE_HIER_LABEL, text, HELP_PLACE_HIER_LABEL,
KiBitmap( add_hierarchical_label_xpm ) ); KiBitmap( add_hierarchical_label_xpm ) );
// Hierarchical sheet // Hierarchical sheet
text = AddHotkeyName( _( "Hierarchical Sheet" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical Sheet" ), s_Schematic_Hokeys_Descr,
HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text, AddMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text,
HELP_PLACE_SHEET, HELP_PLACE_SHEET,
KiBitmap( add_hierarchical_subsheet_xpm ) ); KiBitmap( add_hierarchical_subsheet_xpm ) );
// Import hierarchical sheet // Import hierarchical sheet
AddMenuItem( placeMenu, AddMenuItem( placeMenu,
ID_IMPORT_HLABEL_BUTT, ID_IMPORT_HLABEL_BUTT,
_( "Import Hierarchical Label" ), _( "Import Hierarchical Label" ),
HELP_IMPORT_SHEETPIN, HELP_IMPORT_SHEETPIN,
KiBitmap( import_hierarchical_label_xpm ) ); KiBitmap( import_hierarchical_label_xpm ) );
// Add hierarchical Pin to Sheet // Add hierarchical Pin to Sheet
AddMenuItem( placeMenu, AddMenuItem( placeMenu,
ID_SHEET_PIN_BUTT, ID_SHEET_PIN_BUTT,
_( "Hierarchical Pin to Sheet" ), _( "Hierarchical Pin to Sheet" ),
HELP_PLACE_SHEETPIN, HELP_PLACE_SHEETPIN,
KiBitmap( add_hierar_pin_xpm ) ); KiBitmap( add_hierar_pin_xpm ) );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
// Graphic line or polygon // Graphic line or polygon
text = AddHotkeyName( _( "Graphic Polyline" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic Polyline" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text, AddMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICLINES, HELP_PLACE_GRAPHICLINES,
KiBitmap( add_dashed_line_xpm ) ); KiBitmap( add_dashed_line_xpm ) );
// Graphic text // Graphic text
text = AddHotkeyName( _( "Graphic Text" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic Text" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text, AddMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICTEXTS, HELP_PLACE_GRAPHICTEXTS,
KiBitmap( add_text_xpm ) ); KiBitmap( add_text_xpm ) );
// Graphic image // Graphic image
AddMenuItem( placeMenu, ID_ADD_IMAGE_BUTT, _("Image"), AddMenuItem( placeMenu, ID_ADD_IMAGE_BUTT, _( "Image" ),
HELP_PLACE_GRAPHICIMAGES, HELP_PLACE_GRAPHICIMAGES,
KiBitmap( image_xpm ) ); KiBitmap( image_xpm ) );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Library // Library
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Library preferences" ), _( "Library preferences" ),
KiBitmap( library_xpm ) ); KiBitmap( library_xpm ) );
// Colors // Colors
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
ID_COLORS_SETUP, ID_COLORS_SETUP,
_( "&Colors" ), _( "&Colors" ),
_( "Color preferences" ), _( "Color preferences" ),
KiBitmap( palette_xpm ) ); KiBitmap( palette_xpm ) );
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
#ifdef __WXMAC__ #ifdef __WXMAC__
preferencesMenu->Append(wxID_PREFERENCES); preferencesMenu->Append( wxID_PREFERENCES );
#else #else
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
wxID_PREFERENCES, wxID_PREFERENCES,
_( "&Options" ), _( "&Options" ),
_( "EESchema preferences" ), _( "EESchema preferences" ),
KiBitmap( preference_xpm ) ); KiBitmap( preference_xpm ) );
#endif // __WXMAC__ #endif // __WXMAC__
@ -415,83 +415,83 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Save preferences // Save preferences
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
_( "&Save Preferences" ), _( "&Save Preferences" ),
_( "Save application preferences" ), _( "Save application preferences" ),
KiBitmap( save_setup_xpm ) ); KiBitmap( save_setup_xpm ) );
// Read preferences // Read preferences
AddMenuItem( preferencesMenu, AddMenuItem( preferencesMenu,
ID_CONFIG_READ, ID_CONFIG_READ,
_( "&Read Preferences" ), _( "&Read Preferences" ),
_( "Read application preferences" ), _( "Read application preferences" ),
KiBitmap( read_setup_xpm ) ); KiBitmap( read_setup_xpm ) );
// Menu Tools: // Menu Tools:
wxMenu* toolsMenu = new wxMenu; wxMenu* toolsMenu = new wxMenu;
// Library viewer // Library viewer
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_LIBRARY, ID_TO_LIBRARY,
_( "Library &Browser" ), _( "Library &Browser" ),
_( "Library browser" ), _( "Library browser" ),
KiBitmap( library_browse_xpm ) ); KiBitmap( library_browse_xpm ) );
// Library editor // Library editor
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_LIBRARY, ID_TO_LIBRARY,
_( "Library &Editor" ), _( "Library &Editor" ),
_( "Library editor" ), _( "Library editor" ),
KiBitmap( libedit_xpm ) ); KiBitmap( libedit_xpm ) );
// Separator // Separator
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
// Annotate // Annotate
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_ANNOTATE, ID_GET_ANNOTATE,
_( "&Annotate" ), _( "&Annotate" ),
_( "Annotate the components in the schematic" ), _( "Annotate the components in the schematic" ),
KiBitmap( annotate_xpm ) ); KiBitmap( annotate_xpm ) );
// ERC // ERC
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_ERC, ID_GET_ERC,
_( "ER&C" ), _( "ER&C" ),
_( "Perform electrical rule check" ), _( "Perform electrical rule check" ),
KiBitmap( erc_xpm ) ); KiBitmap( erc_xpm ) );
// Generate netlist // Generate netlist
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_NETLIST, ID_GET_NETLIST,
_( "Generate &Netlist" ), _( "Generate &Netlist" ),
_( "Generate the component netlist" ), _( "Generate the component netlist" ),
KiBitmap( netlist_xpm ) ); KiBitmap( netlist_xpm ) );
// Generate bill of materials // Generate bill of materials
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_GET_TOOLS, ID_GET_TOOLS,
_( "Generate Bill of Materials" ), _( "Generate Bill of Materials" ),
_( "Generate bill of materials" ), _( "Generate bill of materials" ),
KiBitmap( tools_xpm ) ); KiBitmap( tools_xpm ) );
// Separator // Separator
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
//Run CVPcb //Run CVPcb
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_CVPCB, ID_TO_CVPCB,
_( "A&ssign Component Footprints" ), _( "A&ssign Component Footprints" ),
_( "Run CVPcb" ), _( "Run CVPcb" ),
KiBitmap( cvpcb_xpm ) ); KiBitmap( cvpcb_xpm ) );
// Run PCBNew // Run PCBNew
AddMenuItem( toolsMenu, AddMenuItem( toolsMenu,
ID_TO_PCB, ID_TO_PCB,
_( "&Layout Printed Circuit Board" ), _( "&Layout Printed Circuit Board" ),
_( "Run PCBNew" ), _( "Run PCBNew" ),
KiBitmap( pcbnew_xpm ) ); KiBitmap( pcbnew_xpm ) );
// Help Menu: // Help Menu:
@ -502,23 +502,23 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Contents // Contents
AddMenuItem( helpMenu, AddMenuItem( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the Eeschema handbook" ), _( "Open the Eeschema handbook" ),
KiBitmap( online_help_xpm ) ); KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, AddMenuItem( helpMenu,
wxID_INDEX, wxID_INDEX,
_( "&Getting Started in KiCad" ), _( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ), _( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) ); KiBitmap( help_xpm ) );
// About EESchema // About EESchema
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
AddMenuItem( helpMenu, AddMenuItem( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About EESchema" ), _( "&About EESchema" ),
_( "About EESchema schematic designer" ), _( "About EESchema schematic designer" ),
KiBitmap( info_xpm ) ); KiBitmap( info_xpm ) );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );

View File

@ -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()
_( "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();

View File

@ -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 );

View File

@ -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 );

View File

@ -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();

View File

@ -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
*/ */
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 );
*/ */
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,
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

View File

@ -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()
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()
// 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()
* 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()
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()
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()
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 );

View File

@ -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();

View File

@ -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()
_( "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();