Push help menu down into EDA_BASE_FRAME.

This commit is contained in:
Jeff Young 2019-05-18 11:27:36 +01:00
parent 952108dd43
commit 7d9a0b06e0
26 changed files with 93 additions and 410 deletions

View File

@ -45,7 +45,6 @@ void EDA_3D_VIEWER::CreateMenuBar()
wxMenu* editMenu = new wxMenu;
wxMenu* viewMenu = new wxMenu;
wxMenu* prefsMenu = new wxMenu;
wxMenu* helpMenu = new wxMenu;
menuBar->Append( fileMenu, _( "&File" ) );
@ -292,39 +291,7 @@ void EDA_3D_VIEWER::CreateMenuBar()
_( "Reset to Default Settings" ),
KiBitmap( tools_xpm ) );
// Help menu
// /////////////////////////////////////////////////////////////////////////
menuBar->Append( helpMenu, _( "&Help" ) );
AddMenuItem( helpMenu, wxID_HELP,
_( "Pcbnew &Manual" ),
_( "Open Pcbnew Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
wxString text = AddHotkeyName( _( "&List Hotkeys..." ), GetHotkeyConfig(), HK_HELP );
AddMenuItem( helpMenu, ID_MENU3D_HELP_HOTKEY_SHOW_CURRENT_LIST,
text,
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About KiCad" ),
_( "Display KiCad About dialog" ),
KiBitmap( about_xpm ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
}

View File

@ -135,7 +135,6 @@ BEGIN_EVENT_TABLE( EDA_3D_VIEWER, EDA_BASE_FRAME )
EVT_MENU( ID_DISABLE_RAY_TRACING, EDA_3D_VIEWER::OnDisableRayTracing )
EVT_MENU_RANGE( ID_MENU3D_GRID, ID_MENU3D_GRID_END, EDA_3D_VIEWER::On3DGridSelection )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_CLOSE( EDA_3D_VIEWER::OnCloseWindow )

View File

@ -42,6 +42,9 @@
#include <panel_hotkeys_editor.h>
#include <dialogs/panel_common_settings.h>
#include <widgets/paged_dialog.h>
#include <bitmaps.h>
#include <tool/action_menu.h>
#include <menus_helpers.h>
/// The default auto save interval is 10 minutes.
@ -68,6 +71,14 @@ static const wxString entrySizeX = "Size_x"; ///< Width of frame, in pixels (suf
static const wxString entryMaximized = "Maximized"; ///< Nonzero iff frame is maximized (suffix)
///@}
BEGIN_EVENT_TABLE( EDA_BASE_FRAME, wxFrame )
EVT_MENU( wxID_HELP, EDA_BASE_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_BASE_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_BASE_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
END_EVENT_TABLE()
EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
long aStyle, const wxString& aFrameName ) :
@ -230,6 +241,36 @@ void EDA_BASE_FRAME::ReCreateMenuBar()
}
void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
{
wxMenu* helpMenu = new wxMenu;
AddMenuItem( helpMenu, wxID_HELP,
_( "&Help" ),
_( "Open product documentation in a web browser" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started with KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, _( "&List Hotkeys..." ),
_( "Displays current hotkeys table and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ),
_( "Open \"Contribute to KiCad\" in a web browser" ),
KiBitmap( info_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
aMenuBar->Append( helpMenu, _( "&Help" ) );
}
void EDA_BASE_FRAME::ShowChangedLanguage()
{
if( GetMenuBar() )

View File

@ -143,11 +143,7 @@ void ACTION_MENU::DisplayTitle( bool aDisplay )
wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, int aId, const BITMAP_OPAQUE* aIcon )
{
#ifdef DEBUG
if( FindItem( aId ) != NULL )
wxLogWarning( wxT( "Adding more than one menu entry with the same ID may result in"
"undefined behaviour" ) );
#endif
wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" );
wxMenuItem* item = new wxMenuItem( this, aId, aLabel, wxEmptyString, wxITEM_NORMAL );
set_wxMenuIcon( item, aIcon );
@ -156,6 +152,18 @@ wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, int aId, const BITMAP_OPAQ
}
wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, const wxString& aTooltip, int aId,
const BITMAP_OPAQUE* aIcon )
{
wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" );
wxMenuItem* item = new wxMenuItem( this, aId, aLabel, aTooltip, wxITEM_NORMAL );
set_wxMenuIcon( item, aIcon );
return Append( item );
}
wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry )
{
/// ID numbers for tool actions need to have a value higher than ACTION_ID

View File

@ -65,8 +65,6 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, KIWAY_PLAYER )
// Menu events
EVT_MENU( ID_SAVE_PROJECT, CVPCB_MAINFRAME::OnSaveAndContinue )
EVT_MENU( wxID_EXIT, CVPCB_MAINFRAME::OnQuit )
EVT_MENU( wxID_HELP, CVPCB_MAINFRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, CVPCB_MAINFRAME::GetKicadAbout )
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, CVPCB_MAINFRAME::OnConfigurePaths )
EVT_MENU( ID_CVPCB_EQUFILES_LIST_EDIT, CVPCB_MAINFRAME::OnEditEquFilesList )

View File

@ -84,27 +84,10 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Language submenu
Pgm().AddMenuLanguageList( preferencesMenu );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Manual Contents
AddMenuItem( helpMenu, wxID_HELP, _( "CvPcb &Manual" ),
_( "Open CvPcb Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
// About CvPcb
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
// Create the menubar and append all submenus
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -123,10 +123,6 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( wxID_EXIT, LIB_EDIT_FRAME::CloseWindow )
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings )
EVT_MENU( ID_MENU_CANVAS_CAIRO, LIB_EDIT_FRAME::OnSwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL, LIB_EDIT_FRAME::OnSwitchCanvas )

View File

@ -281,50 +281,16 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
_( "Use Modern Toolset with software graphics (fall-back)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu,
wxID_HELP,
_( "Eeschema &Manual" ),
_( "Open the Eeschema Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu,
wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
text = AddHotkeyName( _( "&List Hotkeys..." ), g_Libedit_Hotkeys_Descr, HK_HELP );
AddMenuItem( helpMenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
text,
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
// About Eeschema
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
//
// Create the menubar and append all submenus
//
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( inspectMenu, _( "&Inspect" ) );
menuBar->Append( preferencesMenu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -53,9 +53,6 @@ static void prepareInspectMenu( wxMenu* aParentMenu );
// Build the tools menu
static void prepareToolsMenu( wxMenu* aParentMenu );
// Build the help menu
static void prepareHelpMenu( wxMenu* aParentMenu );
// Build the preferences menu
static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu );
@ -213,12 +210,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* preferencesMenu = new wxMenu;
preparePreferencesMenu( this, preferencesMenu );
//
// Help Menu:
//
wxMenu* helpMenu = new wxMenu;
prepareHelpMenu( helpMenu );
// Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
@ -227,7 +218,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
menuBar->Append( inspectMenu, _( "&Inspect" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( preferencesMenu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;
@ -432,31 +423,6 @@ void prepareToolsMenu( wxMenu* aParentMenu )
}
void prepareHelpMenu( wxMenu* aParentMenu )
{
AddMenuItem( aParentMenu, wxID_HELP, _( "Eeschema &Manual" ),
_( "Open Eeschema Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( aParentMenu, wxID_INDEX, _( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hotkeys_Descr, HK_HELP );
AddMenuItem( aParentMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, text,
_( "Displays current hotkeys table and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
}
static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu )
{
// Path configuration edit dialog.

View File

@ -262,10 +262,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_BUS_MANAGER, SCH_EDIT_FRAME::OnLaunchBusManager )
EVT_TOOL( ID_BACKANNO_ITEMS, SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile )
EVT_TOOL( ID_UPDATE_FIELDS, SCH_EDIT_FRAME::OnUpdateFields )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings )
#ifdef KICAD_SPICE

View File

@ -146,36 +146,11 @@ void LIB_VIEW_FRAME::ReCreateMenuBar()
viewMenu->AddSeparator();
viewMenu->AddItem( EE_ACTIONS::showElectricalTypes, EE_CONDITIONS::ShowAlways );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "Eeschema &Manual" ),
_( "Open Eeschema manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About Eeschema" ),
_( "About Eeschema schematic designer" ),
KiBitmap( info_xpm ) );
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -80,9 +80,7 @@ BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME )
EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::DClickOnCmpList )
// Menu (and/or hotkey) events
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_EXIT, LIB_VIEW_FRAME::CloseLibraryViewer )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( ID_SET_RELATIVE_OFFSET, LIB_VIEW_FRAME::OnSetRelativeOffset )
EVT_UPDATE_UI( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, LIB_VIEW_FRAME::onUpdateNormalBodyStyleButton )

View File

@ -99,12 +99,6 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, EDA_DRAW_FRAME )
// menu Miscellaneous
EVT_MENU( ID_GERBVIEW_ERASE_CURR_LAYER, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_PRINT, GERBVIEW_FRAME::ToPrinter )
EVT_COMBOBOX( ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnSelectActiveLayer )

View File

@ -321,37 +321,14 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
_( "Clear the graphic layer currently selected" ),
KiBitmap( delete_sheet_xpm ) );
// Help menu
wxMenu* helpMenu = new wxMenu;
AddMenuItem( helpMenu, wxID_HELP, _( "Gerbview &Manual" ),
_( "Open the GerbView Manual" ),
KiBitmap( online_help_xpm ) );
text = AddHotkeyName( _( "&List Hotkeys..." ), GerbviewHotkeysDescr, HK_HELP );
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, text,
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
// Separator
helpMenu->AppendSeparator();
// Get involved with KiCad
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
helpMenu->AppendSeparator();
// About Kicad
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
//
// Append menus to the menubar
//
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( miscellaneousMenu, _( "&Tools" ) );
menuBar->Append( configMenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
// Associate the menu bar with the frame, if no previous menubar
SetMenuBar( menuBar );

View File

@ -190,6 +190,8 @@ protected:
virtual wxString help_name();
DECLARE_EVENT_TABLE()
public:
EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
@ -350,6 +352,11 @@ public:
*/
virtual void ReCreateMenuBar();
/**
* Adds the standard KiCad help menu to the menubar.
*/
void AddStandardHelpMenu( wxMenuBar* aMenuBar );
/**
* Checks if \a aFileName can be written.
* <p>

View File

@ -74,13 +74,12 @@ public:
/**
* Function Add()
* Adds an entry to the menu. After highlighting/selecting the entry, a TOOL_EVENT command is
* sent that contains ID of the entry.
* @param aLabel is the text label show in the menu.
* @param aId is the ID that is sent in the TOOL_EVENT. It should be unique for every entry.
* @param aIcon is an optional icon.
* Adds a wxWidgets-style entry to the menu. After highlighting/selecting the entry,
* a wxWidgets event is generated.
*/
wxMenuItem* Add( const wxString& aLabel, int aId, const BITMAP_OPAQUE* aIcon = NULL );
wxMenuItem* Add( const wxString& aLabel, int aId, const BITMAP_OPAQUE* aIcon );
wxMenuItem* Add( const wxString& aLabel, const wxString& aToolTip, int aId,
const BITMAP_OPAQUE* aIcon );
/**
* Function Add()

View File

@ -61,10 +61,6 @@ BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
EVT_MENU( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles )
EVT_MENU( ID_READ_ZIP_ARCHIVE, KICAD_MANAGER_FRAME::OnUnarchiveFiles )
EVT_MENU( ID_PROJECT_TREE_REFRESH, KICAD_MANAGER_FRAME::OnRefresh )
EVT_MENU( wxID_HELP, KICAD_MANAGER_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, KICAD_MANAGER_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, KICAD_MANAGER_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout )
EVT_MENU( ID_IMPORT_EAGLE_PROJECT, KICAD_MANAGER_FRAME::OnImportEagleFiles )
// Range menu events
@ -400,47 +396,13 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
_( "Edit worksheet graphics and text" ),
KiBitmap( pagelayout_load_xpm ) );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "KiCad &Manual" ),
_( "Open KiCad user manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
AddMenuItem( helpMenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "&List Hotkeys" ),
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
// Separator
helpMenu->AppendSeparator();
// Get involved with KiCad
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
helpMenu->AppendSeparator();
// About
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
// Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( browseMenu, _( "&Browse" ) );
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -76,12 +76,6 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_MENU_SWITCH_BGCOLOR, PL_EDITOR_FRAME::Process_Config )
EVT_MENU( ID_MENU_GRID_ONOFF, PL_EDITOR_FRAME::Process_Config )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_DELETE, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, PL_EDITOR_FRAME::GetLayoutFromUndoList )
EVT_TOOL( wxID_REDO, PL_EDITOR_FRAME::GetLayoutFromRedoList )

View File

@ -181,41 +181,13 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
// Language submenu
Pgm().AddMenuLanguageList( preferencesMenu );
// Menu Help
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu, wxID_HELP, _( "Page Layout Editor &Manual" ),
_( "Open the Page Layout Editor Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX, _( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
msg = AddHotkeyName( _( "&List Hotkeys" ), PlEditorHotkeysDescr, HK_HELP );
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg,
_( "Displays the current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED, _( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
// Separator
helpMenu->AppendSeparator();
// About Kicad
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), wxEmptyString, KiBitmap( about_xpm ) );
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( preferencesMenu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -154,12 +154,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_PCB_USER_GRID_SETUP, FOOTPRINT_EDIT_FRAME::OnGridSettings )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, FOOTPRINT_EDIT_FRAME::Show3D_Frame )

View File

@ -78,12 +78,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, EDA_DRAW_FRAME )
EVT_MENU( wxID_EXIT, FOOTPRINT_VIEWER_FRAME::CloseFootprintViewer )
EVT_MENU( ID_SET_RELATIVE_OFFSET, FOOTPRINT_VIEWER_FRAME::OnSetRelativeOffset )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Toolbar events
EVT_TOOL( ID_MODVIEW_SELECT_PART, FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint )
EVT_TOOL( ID_MODVIEW_OPTIONS, FOOTPRINT_VIEWER_FRAME::InstallDisplayOptions )

View File

@ -357,37 +357,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Language submenu
Pgm().AddMenuLanguageList( prefs_menu );
//----- Help menu --------------------
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "Pcbnew &Manual" ),
_( "Open the Pcbnew Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
text = AddHotkeyName( _( "&List Hotkeys..." ), m_hotkeysDescrList, HK_HELP );
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
text,
_( "Displays current hotkeys table and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
// About Pcbnew
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
//------------------------------------
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
@ -396,7 +366,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
menuBar->Append( inspectMenu, _( "&Inspect" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( prefs_menu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;

View File

@ -323,11 +323,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
preparePreferencesMenu( this, configmenu );
//------ Help menu ----------------------------------------------------------
wxMenu* helpMenu = new wxMenu;
prepareHelpMenu( helpMenu );
// Append all menus to the menuBar
//------ Append all menus to the menuBar ------------------------------------
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( viewMenu, _( "&View" ) );
@ -336,7 +332,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
menuBar->Append( inspectMenu, _( "&Inspect" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( configmenu, _( "P&references" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;
@ -539,39 +535,6 @@ void prepareToolsMenu( wxMenu* aParentMenu )
}
// Build the help menu
void prepareHelpMenu( wxMenu* aParentMenu )
{
AddMenuItem( aParentMenu, wxID_HELP,
_( "Pcbnew &Manual" ),
_( "Open Pcbnew Manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( aParentMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Board_Editor_Hotkeys_Descr, HK_HELP );
AddMenuItem( aParentMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
text,
_( "Display current hotkeys list and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, ID_HELP_GET_INVOLVED,
_( "Get &Involved" ),
_( "Contribute to KiCad (opens a web browser)" ),
KiBitmap( info_xpm ) );
aParentMenu->AppendSeparator();
AddMenuItem( aParentMenu, wxID_ABOUT, _( "&About KiCad" ), KiBitmap( about_xpm ) );
}
// Build the files menu.
void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
{

View File

@ -184,12 +184,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_PCB_EDIT_TEXT_AND_GRAPHICS, PCB_EDIT_FRAME::OnEditTextAndGraphics )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, PCB_EDIT_FRAME::Show3D_Frame )

View File

@ -362,8 +362,6 @@ public:
void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, const bool aEdit = true );
void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, const bool aEdit = true );
void GetKicadAbout( wxCommandEvent& event );
/**
* Function IsGridVisible() , virtual
* @return true if the grid must be shown

View File

@ -24,6 +24,9 @@
#include <macros.h>
#include <menus_helpers.h>
#include <tool/actions.h>
#include <tool/conditional_menu.h>
#include <tool/tool_manager.h>
#include <tools/selection_tool.h>
#include "help_common_strings.h"
#include "hotkeys.h"
#include "footprint_viewer_frame.h"
@ -115,6 +118,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateVToolbar()
// Virtual function
void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
{
SELECTION_TOOL* selTool = m_toolManager->GetTool<SELECTION_TOOL>();
// wxWidgets handles the Mac Application menu behind the scenes, but that means
// we always have to start from scratch with a new wxMenuBar.
wxMenuBar* oldMenuBar = GetMenuBar();
@ -133,23 +137,13 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
KiBitmap( exit_xpm ) );
// View menu
wxMenu* viewMenu = new wxMenu;
CONDITIONAL_MENU* viewMenu = new CONDITIONAL_MENU( false, selTool );
text = AddHotkeyName( _( "Zoom &In" ), g_Module_Viewer_Hotkeys_Descr,
HK_ZOOM_IN, IS_ACCELERATOR );
AddMenuItem( viewMenu, ID_VIEWER_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
text = AddHotkeyName( _( "Zoom &Out" ), g_Module_Viewer_Hotkeys_Descr,
HK_ZOOM_OUT, IS_ACCELERATOR );
AddMenuItem( viewMenu, ID_VIEWER_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
text = AddHotkeyName( _( "&Fit on Screen" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_AUTO );
AddMenuItem( viewMenu, ID_VIEWER_ZOOM_PAGE, text, _( "Zoom to fit footprint" ),
KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), g_Module_Viewer_Hotkeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_VIEWER_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
viewMenu->AddSeparator();
viewMenu->AddItem( ACTIONS::zoomInCenter, SELECTION_CONDITIONS::ShowAlways );
viewMenu->AddItem( ACTIONS::zoomOutCenter, SELECTION_CONDITIONS::ShowAlways );
viewMenu->AddItem( ACTIONS::zoomFitScreen, SELECTION_CONDITIONS::ShowAlways );
viewMenu->AddItem( ACTIONS::zoomRedraw, SELECTION_CONDITIONS::ShowAlways );
viewMenu->AppendSeparator();
@ -158,32 +152,10 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar()
AddMenuItem( viewMenu, ID_MODVIEW_SHOW_3D_VIEW, text, _( "Show footprint in 3D viewer" ),
KiBitmap( three_d_xpm ) );
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "Pcbnew &Manual" ),
_( "Open the Pcbnew manual" ),
KiBitmap( online_help_xpm ) );
AddMenuItem( helpMenu, wxID_INDEX,
_( "&Getting Started in KiCad" ),
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
// About Pcbnew
helpMenu->AppendSeparator();
AddMenuItem( helpMenu, wxID_ABOUT,
_( "&About Pcbnew" ),
_( "About Pcbnew PCB designer" ),
KiBitmap( info_xpm ) );
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
AddStandardHelpMenu( menuBar );
SetMenuBar( menuBar );
delete oldMenuBar;