Commit 1bd7fc8a authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Minor menu bar fixes.

* Fixed bug on Windows that prevented the menu short cuts from working
  properly.
* Fix duplicate menu short cut keys in KiCad, Pcbnew, and Eeschema.
* Add menu short cuts for all possible menu entries.
parent 1fde4ca8
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * This program source code file is part of KiCad, a free EDA CAD application.
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 *
 * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 2007-2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 *
 * This program is free software; you can redistribute it and/or
 * This program is free software; you can redistribute it and/or
@@ -1161,8 +1161,8 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )


    GetParent()->GeneralControl( &DC, pos, localkey );
    GetParent()->GeneralControl( &DC, pos, localkey );


#if 0
#ifdef __WINDOWS__
    event.Skip();   // Allow menu shortcut processing
    event.Skip();   // Allow menu shortcut processing on Windows.
#endif
#endif
}
}


+31 −6
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2010-2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

/**
/**
 * @file hotkeys_basic.cpp
 * @file hotkeys_basic.cpp
 * @brief Some functions to handle hotkeys in KiCad
 * @brief Some functions to handle hotkeys in KiCad
@@ -708,13 +733,13 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
    /* List existing hotkey menu*/
    /* List existing hotkey menu*/
    AddMenuItem( HotkeySubmenu,
    AddMenuItem( HotkeySubmenu,
                 ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
                 ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
                 _( "List Current Keys" ),
                 _( "&List Current Keys" ),
                 _( "Displays the current hotkeys list and corresponding commands" ),
                 _( "Displays the current hotkeys list and corresponding commands" ),
                 KiBitmap( info_xpm ) );
                 KiBitmap( info_xpm ) );


    /* Call hotkeys editor*/
    /* Call hotkeys editor*/
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
                 _( "Edit Hotkeys" ),
                 _( "&Edit Hotkeys" ),
                 _( "Call the hotkeys editor" ),
                 _( "Call the hotkeys editor" ),
                 KiBitmap( editor_xpm ) );
                 KiBitmap( editor_xpm ) );


@@ -722,19 +747,19 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )


    /* create hotkey file to export current hotkeys config */
    /* create hotkey file to export current hotkeys config */
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
                 _( "Export Hotkeys Config" ),
                 _( "E&xport Hotkeys" ),
                 _( "Create a hotkey configuration file to export the current hotkey config" ),
                 _( "Create a hotkey configuration file to export the current hotkeys" ),
                 KiBitmap( save_setup_xpm ) );
                 KiBitmap( save_setup_xpm ) );


    /* Reload hotkey file */
    /* Reload hotkey file */
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
    AddMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
                 _( "Import Hotkeys Config" ),
                 _( "&Import Hotkeys" ),
                 _( "Load an existing hotkey configuration file" ),
                 _( "Load an existing hotkey configuration file" ),
                 KiBitmap( reload_xpm ) );
                 KiBitmap( reload_xpm ) );


    /* Append HotkeySubmenu to menu */
    /* Append HotkeySubmenu to menu */
    AddMenuItem( aMenu, HotkeySubmenu,
    AddMenuItem( aMenu, HotkeySubmenu,
                 ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ),
                 ID_PREFERENCES_HOTKEY_SUBMENU, _( "&Hotkeys" ),
                 _( "Hotkeys configuration and preferences" ),
                 _( "Hotkeys configuration and preferences" ),
                 KiBitmap( hotkeys_xpm ) );
                 KiBitmap( hotkeys_xpm ) );
}
}
+212 −187
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

/**
/**
 * @file eeschema/menubar.cpp
 * @file eeschema/menubar.cpp
 * @brief (Re)Create the main menubar for the schematic frame
 * @brief (Re)Create the main menubar for the schematic frame
@@ -32,6 +57,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // Delete all existing menus so they can be rebuilt.
    // Delete all existing menus so they can be rebuilt.
    // This allows language changes of the menu text on the fly.
    // This allows language changes of the menu text on the fly.
    menuBar->Freeze();
    menuBar->Freeze();

    while( menuBar->GetMenuCount() )
    while( menuBar->GetMenuCount() )
        delete menuBar->Remove( 0 );
        delete menuBar->Remove( 0 );


@@ -90,7 +116,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // 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 ) );


@@ -100,14 +126,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // Page settings
    // Page settings
    AddMenuItem( fileMenu,
    AddMenuItem( fileMenu,
                 ID_SHEET_SET,
                 ID_SHEET_SET,
                _( "P&age Settings" ),
                 _( "Pa&ge 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" ),
                 _( "Pri&nt" ),
                 _( "Print schematic" ),
                 _( "Print schematic" ),
                 KiBitmap( print_button_xpm ) );
                 KiBitmap( print_button_xpm ) );


@@ -116,28 +142,28 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()


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


@@ -145,7 +171,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
#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 ) );


@@ -171,19 +197,19 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    wxMenu* editMenu = new wxMenu;
    wxMenu* editMenu = new wxMenu;


    // Undo
    // Undo
    text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
    text = AddHotkeyName( _( "&Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );


    AddMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
    AddMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );


    // Redo
    // Redo
    text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
    text = AddHotkeyName( _( "&Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );


    AddMenuItem( editMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
    AddMenuItem( editMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );


    // 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
@@ -218,17 +244,17 @@ 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,
                          HK_ZOOM_IN, IS_ACCELERATOR );  // add an accelerator, 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,
                          HK_ZOOM_OUT, IS_ACCELERATOR );  // add accelerator, 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
    text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
    text = AddHotkeyName( _( "&Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );


    AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
    AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );


@@ -238,12 +264,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // Hierarchy
    // Hierarchy
    AddMenuItem( viewMenu,
    AddMenuItem( viewMenu,
                 ID_HIERARCHY,
                 ID_HIERARCHY,
                _( "H&ierarchy" ),
                 _( "&Hierarchy" ),
                 _( "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 );
    AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
    AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );


    // Menu place:
    // Menu place:
@@ -251,68 +277,68 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    wxMenu* placeMenu = new wxMenu;
    wxMenu* placeMenu = new wxMenu;


    // Component
    // Component
    text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr,
    text = AddHotkeyName( _( "&Component" ), s_Schematic_Hokeys_Descr,
                          HK_ADD_NEW_COMPONENT, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // addan accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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( _( "Gl&obal Label" ), s_Schematic_Hokeys_Descr,
                          HK_ADD_GLABEL, IS_ACCELERATOR );    // add an accelerator, 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, IS_ACCELERATOR );    // add an accelerator, 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,
@@ -322,9 +348,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    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, IS_ACCELERATOR );          // add an accelerator, not a shortcut
    text = AddHotkeyName( _( "Hierarchical Label" ), s_Schematic_Hokeys_Descr,
                          HK_ADD_HLABEL, IS_ACCELERATOR );          // add an accelerator, 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,
@@ -332,7 +356,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()




    // Hierarchical sheet
    // Hierarchical sheet
    text = AddHotkeyName( _( "Hierarchical Sheet" ), s_Schematic_Hokeys_Descr,
    text = AddHotkeyName( _( "H&ierarchical &Sheet" ), s_Schematic_Hokeys_Descr,
                          HK_ADD_HIER_SHEET, IS_ACCELERATOR );    // add an accelerator, 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,
@@ -341,14 +365,14 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // Import hierarchical sheet
    // Import hierarchical sheet
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_IMPORT_HLABEL_BUTT,
                 ID_IMPORT_HLABEL_BUTT,
                _( "Import Hierarchical Label" ),
                 _( "I&mport 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 Pi&n to Sheet" ),
                 HELP_PLACE_SHEETPIN,
                 HELP_PLACE_SHEETPIN,
                 KiBitmap( add_hierar_pin_xpm ) );
                 KiBitmap( add_hierar_pin_xpm ) );


@@ -472,7 +496,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    // 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 ) );


@@ -506,6 +530,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
                 _( "&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" ),
@@ -525,7 +550,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( placeMenu, _( "&Place" ) );
    menuBar->Append( placeMenu, _( "&Place" ) );
    menuBar->Append( preferencesMenu, _( "&Preferences" ) );
    menuBar->Append( preferencesMenu, _( "P&references" ) );
    menuBar->Append( toolsMenu, _( "&Tools" ) );
    menuBar->Append( toolsMenu, _( "&Tools" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );


+42 −15
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

/**
/**
 * @file eeschema/menubar_libedit.cpp
 * @file eeschema/menubar_libedit.cpp
 * @brief (Re)Create the main menubar for the component editor frame (LibEdit)
 * @brief (Re)Create the main menubar for the component editor frame (LibEdit)
@@ -46,7 +71,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    // Save current library as...
    // Save current library as...
    AddMenuItem( fileMenu,
    AddMenuItem( fileMenu,
                 ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
                 ID_LIBEDIT_SAVE_CURRENT_LIB_AS,
                 _( "Save Current Library &as" ),
                 _( "Save Current Library &As" ),
                 _( "Save current active library as..." ),
                 _( "Save current active library as..." ),
                 KiBitmap( save_as_xpm ) );
                 KiBitmap( save_as_xpm ) );


@@ -63,7 +88,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    // Export as SVG file
    // Export as SVG file
    AddMenuItem( fileMenu,
    AddMenuItem( fileMenu,
                 ID_LIBEDIT_GEN_SVG_FILE,
                 ID_LIBEDIT_GEN_SVG_FILE,
                 _( "&Create SVG File" ),
                 _( "Create S&VG File" ),
                 _( "Create a SVG file from the current loaded component" ),
                 _( "Create a SVG file from the current loaded component" ),
                 KiBitmap( plot_xpm ) );
                 KiBitmap( plot_xpm ) );


@@ -81,7 +106,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    wxMenu* editMenu = new wxMenu;
    wxMenu* editMenu = new wxMenu;


    // Undo
    // Undo
    text = AddHotkeyName( _( "Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );
    text = AddHotkeyName( _( "&Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );


    AddMenuItem( editMenu,
    AddMenuItem( editMenu,
                 wxID_UNDO,
                 wxID_UNDO,
@@ -90,7 +115,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
                 KiBitmap( undo_xpm ) );
                 KiBitmap( undo_xpm ) );


    // Redo
    // Redo
    text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
    text = AddHotkeyName( _( "&Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
    AddMenuItem( editMenu,
    AddMenuItem( editMenu,
                 wxID_REDO,
                 wxID_REDO,
                 text,
                 text,
@@ -103,7 +128,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    // Delete
    // Delete
    AddMenuItem( editMenu,
    AddMenuItem( editMenu,
                 ID_LIBEDIT_DELETE_ITEM_BUTT,
                 ID_LIBEDIT_DELETE_ITEM_BUTT,
                 _( "Delete" ),
                 _( "&Delete" ),
                 HELP_DELETE_ITEMS,
                 HELP_DELETE_ITEMS,
                 KiBitmap( delete_body_xpm ) );
                 KiBitmap( delete_body_xpm ) );


@@ -124,22 +149,22 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
     */
     */


    // Zoom in
    // Zoom in
    text = _( "Zoom In" );
    text = _( "Zoom &In" );
    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 = _( "Zoom Out" );
    text = _( "Zoom &Out" );
    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
    text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
    text = AddHotkeyName( _( "&Fit on Screen" ), s_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
    AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
    AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );


    // Separator
    // Separator
    viewMenu->AppendSeparator();
    viewMenu->AppendSeparator();


    // Redraw
    // Redraw
    text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
    text = AddHotkeyName( _( "&Redraw" ), s_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
    AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
    AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );


    // Menu Place:
    // Menu Place:
@@ -155,35 +180,35 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    // Graphic text
    // Graphic text
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_LIBEDIT_BODY_TEXT_BUTT,
                 ID_LIBEDIT_BODY_TEXT_BUTT,
                 _( "Graphic text" ),
                 _( "Graphic &Text" ),
                 HELP_ADD_BODYTEXT,
                 HELP_ADD_BODYTEXT,
                 KiBitmap( add_text_xpm ) );
                 KiBitmap( add_text_xpm ) );


    // Graphic rectangle
    // Graphic rectangle
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_LIBEDIT_BODY_RECT_BUTT,
                 ID_LIBEDIT_BODY_RECT_BUTT,
                 _( "Rectangle" ),
                 _( "&Rectangle" ),
                 HELP_ADD_BODYRECT,
                 HELP_ADD_BODYRECT,
                 KiBitmap( add_rectangle_xpm ) );
                 KiBitmap( add_rectangle_xpm ) );


    // Graphic Circle
    // Graphic Circle
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_LIBEDIT_BODY_CIRCLE_BUTT,
                 ID_LIBEDIT_BODY_CIRCLE_BUTT,
                 _( "Circle" ),
                 _( "&Circle" ),
                 HELP_ADD_BODYCIRCLE,
                 HELP_ADD_BODYCIRCLE,
                 KiBitmap( add_circle_xpm ) );
                 KiBitmap( add_circle_xpm ) );


    // Graphic Arc
    // Graphic Arc
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_LIBEDIT_BODY_ARC_BUTT,
                 ID_LIBEDIT_BODY_ARC_BUTT,
                 _( "Arc" ),
                 _( "&Arc" ),
                 HELP_ADD_BODYARC,
                 HELP_ADD_BODYARC,
                 KiBitmap( add_arc_xpm ) );
                 KiBitmap( add_arc_xpm ) );


    // Graphic Line or Polygon
    // Graphic Line or Polygon
    AddMenuItem( placeMenu,
    AddMenuItem( placeMenu,
                 ID_LIBEDIT_BODY_LINE_BUTT,
                 ID_LIBEDIT_BODY_LINE_BUTT,
                 _( "Line or Polygon" ),
                 _( "&Line or Polygon" ),
                 HELP_ADD_BODYPOLYGON,
                 HELP_ADD_BODYPOLYGON,
                 KiBitmap( add_polygon_xpm ) );
                 KiBitmap( add_polygon_xpm ) );


@@ -239,6 +264,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
                 _( "&Contents" ),
                 _( "&Contents" ),
                 _( "Open the Eeschema manual" ),
                 _( "Open the Eeschema manual" ),
                 KiBitmap( online_help_xpm ) );
                 KiBitmap( online_help_xpm ) );

    AddMenuItem( helpMenu,
    AddMenuItem( helpMenu,
                 wxID_INDEX,
                 wxID_INDEX,
                 _( "&Getting Started in KiCad" ),
                 _( "&Getting Started in KiCad" ),
@@ -247,6 +273,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()


    // About Eeschema
    // About Eeschema
    helpMenu->AppendSeparator();
    helpMenu->AppendSeparator();

    AddMenuItem( helpMenu,
    AddMenuItem( helpMenu,
                 wxID_ABOUT,
                 wxID_ABOUT,
                 _( "&About Eeschema" ),
                 _( "&About Eeschema" ),
@@ -258,7 +285,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( placeMenu, _( "&Place" ) );
    menuBar->Append( placeMenu, _( "&Place" ) );
    menuBar->Append( preferencesMenu, _( "&Preferences" ) );
    menuBar->Append( preferencesMenu, _( "P&references" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );


    menuBar->Thaw();
    menuBar->Thaw();
+28 −3
Original line number Original line Diff line number Diff line
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2007 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
 * Copyright (C) 2009-2011 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

/**
/**
 * @file gerbview/menubar.cpp
 * @file gerbview/menubar.cpp
 * @brief (Re)Create the main menubar for GerbView
 * @brief (Re)Create the main menubar for GerbView
@@ -79,7 +104,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
    m_drillFileHistory.AddFilesToMenu( );
    m_drillFileHistory.AddFilesToMenu( );
    AddMenuItem( fileMenu, openRecentDrlMenu,
    AddMenuItem( fileMenu, openRecentDrlMenu,
                 wxID_ANY,
                 wxID_ANY,
                 _( "Open Recent &Drill File" ),
                 _( "Open Recent Dri&ll File" ),
                 _( "Open a recent opened drill file" ),
                 _( "Open a recent opened drill file" ),
                 KiBitmap( open_project_xpm ) );
                 KiBitmap( open_project_xpm ) );


@@ -99,7 +124,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
    // Export to Pcbnew
    // Export to Pcbnew
    AddMenuItem( fileMenu,
    AddMenuItem( fileMenu,
                 ID_GERBVIEW_EXPORT_TO_PCBNEW,
                 ID_GERBVIEW_EXPORT_TO_PCBNEW,
                 _( "Export to &Pcbnew" ),
                 _( "E&xport to Pcbnew" ),
                 _( "Export data in Pcbnew format" ),
                 _( "Export data in Pcbnew format" ),
                 KiBitmap( export_xpm ) );
                 KiBitmap( export_xpm ) );


@@ -109,7 +134,7 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
    // Print
    // Print
    AddMenuItem( fileMenu,
    AddMenuItem( fileMenu,
                 wxID_PRINT,
                 wxID_PRINT,
                 _( "P&rint" ),
                 _( "&Print" ),
                 _( "Print gerber" ),
                 _( "Print gerber" ),
                 KiBitmap( print_button_xpm ) );
                 KiBitmap( print_button_xpm ) );


Loading