Commit 6b39096b authored by Jerry Jacobs's avatar Jerry Jacobs

Cleanup of all menubar code, see CHANGELOG.txt

parent e764474f
......@@ -4,6 +4,13 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2011-Apr-6, UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
================================================================================
Cleanup of all the menubar code to have the same style, remove the C comments.
Make the wxMenu behave native on OSX for KiCad, CvPCB and Gerbview and remove
unneeded ifdefs when using the wxIDs. Add a OnQuit for the gerber frame.
Change item->SetBitmap( item ) to use macro SET_BITMAP for menu items.
2011-Apr-4, UPDATE Jerry Jacobs <xor.gate.engineering@gmail.com>
================================================================================
More native OSX changes, this removes some WXMAC defines replaced by wxID
......
......@@ -673,3 +673,4 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
ID_PREFERENCES_HOTKEY_SUBMENU, _( "Hotkeys" ),
_( "Hotkeys configuration and preferences" ), hotkeys_xpm );
}
......@@ -43,9 +43,9 @@ BEGIN_EVENT_TABLE( CVPCB_MAINFRAME, EDA_BASE_FRAME )
CVPCB_MAINFRAME::OnQuit )
EVT_MENU( ID_GENERAL_HELP,
CVPCB_MAINFRAME::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT,
EVT_MENU( wxID_ABOUT,
CVPCB_MAINFRAME::GetKicadAbout )
EVT_MENU( ID_CONFIG_REQ,
EVT_MENU( wxID_PREFERENCES,
CVPCB_MAINFRAME::ConfigCvpcb )
EVT_MENU( ID_CONFIG_SAVE,
CVPCB_MAINFRAME::Update_Config )
......
......@@ -83,14 +83,6 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit()
{
/* WXMAC application specific */
#ifdef __WXMAC__
// wxApp::SetExitOnFrameDelete(false);
wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
#endif /* __WXMAC__ */
wxFileName filename;
wxString message;
CVPCB_MAINFRAME* frame = NULL;
......
/*
* menubar.cpp
* Build the CvPCB MenuBar
/**
* @file cvpcb/menubar.cpp
* @brief (Re)Create the menubar for cvpcb
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -14,9 +14,12 @@
#include "bitmaps.h"
/**
* @brief (Re)Create the menubar for the cvpcb mainframe
*/
void CVPCB_MAINFRAME::ReCreateMenuBar()
{
// Create and try to get the current menubar
wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar();
......@@ -31,53 +34,72 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Recreate all menus:
// Menu File:
wxMenu* filesMenu = new wxMenu;
ADD_MENUITEM_WITH_HELP( filesMenu, ID_LOAD_PROJECT,
_( "&Open" ), _( "Open a net list file" ),
open_document_xpm );
/* Open Recent submenu */
// Open
ADD_MENUITEM_WITH_HELP( filesMenu,
ID_LOAD_PROJECT,
_( "&Open" ),
_( "Open a net list file" ),
open_document_xpm );
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1, _( "Open &Recent" ),
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu, -1,
_( "Open &Recent" ),
_("Open a recent opened netlist document" ),
open_project_xpm );
// Separator
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, ID_SAVE_PROJECT,
_( "&Save As..." ),
_( "Save new net list and footprint list files" ),
save_xpm );
/* Quit on all platforms except WXMAC */
#if !defined(__WXMAC__)
// Save as
ADD_MENUITEM_WITH_HELP( filesMenu,
ID_SAVE_PROJECT,
_( "&Save As..." ),
_( "Save new net list and footprint list files" ),
save_xpm );
// Separator
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, wxID_EXIT,
_( "&Quit" ), _( "Quit CvPCB" ),
exit_xpm );
#endif /* !defined( __WXMAC__) */
// Menu Configuration:
wxMenu* configmenu = new wxMenu;
ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
_( "Set libraries and library search paths" ),
config_xpm );
wxGetApp().AddMenuLanguageList( configmenu );
item = new wxMenuItem( configmenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
// Quit
ADD_MENUITEM_WITH_HELP( filesMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit CvPCB" ),
exit_xpm );
// Menu Preferences:
wxMenu* preferencesMenu = new wxMenu;
// Options (Preferences on WXMAC)
ADD_MENUITEM_WITH_HELP( preferencesMenu,
wxID_PREFERENCES,
#ifdef __WXMAC__
_( "&Preferences..." ),
#else
_( "&Options" ),
#endif // __WXMAC__
_( "Set libraries and library search paths" ),
config_xpm );
// Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu );
// Keep open on save
item = new wxMenuItem( preferencesMenu, ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE,
_( "Keep Open On Save" ),
_( "Prevent CVPcb from exiting after saving netlist file" ),
wxITEM_CHECK );
configmenu->Append( item );
preferencesMenu->Append( item );
SETBITMAPS( window_close_xpm );
configmenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( configmenu, ID_CONFIG_SAVE,
// Separator
preferencesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( preferencesMenu, ID_CONFIG_SAVE,
_( "&Save Project File" ),
_( "Save changes to the project file" ),
save_setup_xpm );
......@@ -85,25 +107,23 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Version info
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
_( "Open the cvpcb manual" ),
online_help_xpm );
/* About on all platforms except WXMAC */
#if !defined(__WXMAC__)
ADD_MENUITEM_WITH_HELP( helpMenu, ID_KICAD_ABOUT,
_( "&About" ),
_( "About cvpcb schematic to pcb converter" ),
// About
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT,
_( "&About CvPCB" ),
_( "About CvPCB schematic to pcb converter" ),
info_xpm );
#endif /* !defined(__WXMAC__) */
// Create the menubar and append all submenus
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
menuBar->Thaw();
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,7 +38,7 @@ EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, GERBVIEW_FRAME::OnGbrFileHistory )
EVT_MENU_RANGE( ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILE9,
GERBVIEW_FRAME::OnDrlFileHistory )
EVT_MENU( ID_EXIT, GERBVIEW_FRAME::Process_Special_Functions )
EVT_MENU( wxID_EXIT, GERBVIEW_FRAME::OnQuit )
// menu Preferences
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
......@@ -46,7 +46,7 @@ EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
EVT_MENU( ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
GERBVIEW_FRAME::OnSelectOptionToolbar )
EVT_MENU( ID_GERBVIEW_OPTIONS_SETUP, GERBVIEW_FRAME::InstallGerberOptionsDialog )
EVT_MENU( wxID_PREFERENCES, GERBVIEW_FRAME::InstallGerberOptionsDialog )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EDA_DRAW_FRAME::SetLanguage )
......@@ -61,7 +61,7 @@ EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
// Menu Help
EVT_MENU( ID_GENERAL_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_KICAD_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, GERBVIEW_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_COPY, GERBVIEW_FRAME::Process_Special_Functions )
......@@ -147,10 +147,6 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
switch( id )
{
case ID_EXIT:
Close( true );
break;
case ID_GERBVIEW_GLOBAL_DELETE:
Erase_Current_Layer( true );
ClearMsgPanel();
......@@ -277,6 +273,10 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
DrawPanel->Refresh();
}
void GERBVIEW_FRAME::OnQuit( wxCommandEvent& event )
{
Close( true );
}
/**
* Function SetLanguage
......
......@@ -64,11 +64,6 @@ bool WinEDA_App::OnInit()
wxFileName fn;
GERBVIEW_FRAME* frame = NULL;
#ifdef __WXMAC__
wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
wxApp::s_macPreferencesMenuItemId = ID_GERBVIEW_OPTIONS_SETUP;
#endif /* __WXMAC__ */
InitEDA_Appl( wxT( "GerbView" ), APP_TYPE_GERBVIEW );
if( m_Checker && m_Checker->IsAnotherRunning() )
......
......@@ -308,6 +308,16 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
*/
void OnSelectDisplayMode( wxCommandEvent& event );
/**
* Function OnQuit
* called on request of application quit
*/
void OnQuit( wxCommandEvent& event );
/**
* Function OnHotKey
* called when on hotkey trigger
*/
void OnHotKey( wxDC* DC, int hotkey, EDA_ITEM* DrawStruct );
GERBER_DRAW_ITEM* GerberGeneralLocateAndDisplay();
......
/*************************************/
/* menubar.cpp: Build the main menu */
/*************************************/
/**
* @file gerbview/menubar.cpp
* @brief (Re)Create the main menubar for GerbView
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
//#include "macros.h"
#include "gerbview.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "hotkeys.h"
/**
* @brief (Re)Create the menubar for the gerbview frame
*/
void GERBVIEW_FRAME::ReCreateMenuBar( void )
{
// Create and try to get the current menubar
wxMenuBar* menuBar = GetMenuBar();
if( !menuBar )
......@@ -28,115 +30,176 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
delete menuBar->Remove( 0 );
// Recreate all menus:
wxMenu* filesMenu = new wxMenu;
ADD_MENUITEM_WITH_HELP( filesMenu, wxID_FILE, _( "Load &Gerber File" ),
_(
"Load a new Gerber file on the current layer. Previous data will be deleted" ),
// Menu File:
wxMenu* fileMenu = new wxMenu;
// Load
ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_FILE,
_( "Load &Gerber File" ),
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ),
gerber_file_xpm );
ADD_MENUITEM_WITH_HELP( filesMenu, ID_GERBVIEW_LOAD_DRILL_FILE,
// Excellon
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_GERBVIEW_LOAD_DRILL_FILE,
_( "Load &EXCELLON Drill File" ),
_( "Load excellon drill file" ),
gerbview_drill_file_xpm );
ADD_MENUITEM_WITH_HELP( filesMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
// Dcodes
ADD_MENUITEM_WITH_HELP( fileMenu, ID_GERBVIEW_LOAD_DCODE_FILE,
_( "Load &DCodes" ),
_( "Load D-Codes definition file" ),
gerber_open_dcode_file_xpm );
// Open Recent submenus
// Recent gerber files
wxMenu* openRecentGbrMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentGbrMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentGbrMenu,
wxID_ANY, _( "Open &Recent Gerber File" ),
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentGbrMenu,
wxID_ANY,
_( "Open &Recent Gerber File" ),
_( "Open a recent opened Gerber file" ),
gerber_recent_files_xpm );
// Recent drill files
wxMenu* openRecentDrlMenu = new wxMenu();
m_drillFileHistory.AddFilesToMenu( openRecentDrlMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentDrlMenu,
wxID_ANY, _( "Open Recent &Drill File" ),
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentDrlMenu,
wxID_ANY,
_( "Open Recent &Drill File" ),
_( "Open a recent opened drill file" ),
open_project_xpm );
// Separator
fileMenu->AppendSeparator();
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, ID_GERBVIEW_ERASE_ALL,
// Clear all
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_GERBVIEW_ERASE_ALL,
_( "&Clear All" ),
_( "Clear all layers. All data will be deleted" ),
gerbview_clear_layers_xpm );
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, ID_GERBVIEW_EXPORT_TO_PCBNEW,
// Separator
fileMenu->AppendSeparator();
// Export to pcbnew
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_GERBVIEW_EXPORT_TO_PCBNEW,
_( "Export to &Pcbnew" ),
_( "Export data in pcbnew format" ),
export_xpm );
// Separator
fileMenu->AppendSeparator();
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, wxID_PRINT,
// Print
ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_PRINT,
_( "P&rint" ),
_( "Print gerber" ),
print_button );
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, ID_EXIT,
// Separator
fileMenu->AppendSeparator();
// Exit
ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_EXIT,
_( "E&xit" ),
_( "Quit Gerbview" ),
exit_xpm );
// Configuration and preferences:
wxMenu* configmenu = new wxMenu;
ADD_MENUITEM_WITH_HELP( configmenu, ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
// Menu for configuration and preferences
wxMenu* configMenu = new wxMenu;
// Hide layer manager
ADD_MENUITEM_WITH_HELP( configMenu,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
_( "Hide &Layers Manager" ),
_( "Show/hide the layers manager toolbar" ),
layers_manager_xpm );
ADD_MENUITEM_WITH_HELP( configmenu, ID_GERBVIEW_OPTIONS_SETUP,
// Options (Preferences on WXMAC)
ADD_MENUITEM_WITH_HELP( configMenu,
wxID_PREFERENCES,
#ifdef __WXMAC__
_( "Preferences..." ),
#else
_( "&Options" ),
#endif // __WXMAC__
_( "Set options to draw items" ),
preference_xpm );
wxGetApp().AddMenuLanguageList( configmenu );
// Language submenu
wxGetApp().AddMenuLanguageList( configMenu );
AddHotkeyConfigMenu( configmenu );
// Hotkey submenu
AddHotkeyConfigMenu( configMenu );
// Menu miscellaneous
wxMenu* miscellaneousMenu = new wxMenu;
wxMenu* miscellaneous_menu = new wxMenu;
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_SHOW_LIST_DCODES,
// List dcodes
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
ID_GERBVIEW_SHOW_LIST_DCODES,
_( "&List DCodes" ),
_( "List and edit D-codes" ), show_dcodenumber_xpm );
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_SHOW_SOURCE,
_( "List and edit D-codes" ),
show_dcodenumber_xpm );
// Show source
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
ID_GERBVIEW_SHOW_SOURCE,
_( "&Show Source" ),
_( "Show source file for the current layer" ),
tools_xpm );
miscellaneous_menu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_GERBVIEW_GLOBAL_DELETE,
// Separator
miscellaneousMenu->AppendSeparator();
// Clear layer
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
ID_GERBVIEW_GLOBAL_DELETE,
_( "&Clear Layer" ),
_( "Clear current layer" ), general_deletions_xpm );
_( "Clear current layer" ),
general_deletions_xpm );
miscellaneous_menu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
// Separator
miscellaneousMenu->AppendSeparator();
// Text editor
ADD_MENUITEM_WITH_HELP( miscellaneousMenu,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
editor_xpm );
// Menu Help:
// Menu Help
wxMenu* helpMenu = new wxMenu;
// Version info
AddHelpVersionInfoMenuEntry( helpMenu );
ADD_MENUITEM_WITH_HELP( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
_( "Open the gerbview manual" ), help_xpm );
ADD_MENUITEM_WITH_HELP( helpMenu, ID_KICAD_ABOUT, _( "&About Gerbview" ),
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu,
ID_GENERAL_HELP,
_( "&Contents" ),
_( "Open the gerbview manual" ),
help_xpm );
// About gerbview
ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_ABOUT,
_( "&About GerbView" ),
_( "About gerbview gerber and drill viewer" ),
online_help_xpm );
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( miscellaneous_menu, _( "&Miscellaneous" ) );
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( configMenu, _( "&Preferences" ) );
menuBar->Append( miscellaneousMenu, _( "&Miscellaneous" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
menuBar->Thaw();
......
/**
* @file kicad/menubar.cpp
* @brief Project manager menubars and toolbars
* @brief (Re)Create the project manager menubar for KiCad
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -70,6 +70,7 @@ END_EVENT_TABLE()
*/
void WinEDA_MainFrame::ReCreateMenuBar()
{
// Create and try to get the current menubar
wxMenuItem* item;
wxMenuBar* menuBar = GetMenuBar();
......@@ -84,72 +85,86 @@ void WinEDA_MainFrame::ReCreateMenuBar()
// Recreate all menus:
// Files menu
wxMenu* filesMenu = new wxMenu;
// Menu File:
wxMenu* fileMenu = new wxMenu;
// Open
ADD_MENUITEM_WITH_HELP( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ),
_( "Open an existing project" ),
open_project_xpm );
// Open Recent submenu
wxMenu* openRecentMenu = new wxMenu();
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
wxID_ANY, _( "Open &Recent" ),
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, openRecentMenu,
wxID_ANY,
_( "Open &Recent" ),
_( "Open a recent opened schematic project" ),
open_project_xpm );
// New
ADD_MENUITEM_WITH_HELP( filesMenu, ID_NEW_PROJECT,
ADD_MENUITEM_WITH_HELP( fileMenu, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ),
_( "Start a new project" ),
new_project_xpm );
/* Save */
ADD_MENUITEM_WITH_HELP( filesMenu, ID_SAVE_PROJECT, _( "&Save\tCtrl+S" ),
// Save
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_SAVE_PROJECT,
_( "&Save\tCtrl+S" ),
_( "Save current project" ),
save_project_xpm );
// Archive
filesMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
fileMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_SAVE_AND_ZIP_FILES,
_( "&Archive" ),
_( "Archive project files in zip archive" ),
zip_xpm );
// Unarchive
ADD_MENUITEM_WITH_HELP( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
ADD_MENUITEM_WITH_HELP( fileMenu,
ID_READ_ZIP_ARCHIVE,
_( "&Unarchive" ),
_( "Unarchive project files from zip file" ),
unzip_xpm );
// Quit
filesMenu->AppendSeparator();
// Separator
fileMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( filesMenu, wxID_EXIT, _( "&Quit" ),
// Quit
ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_EXIT,
_( "&Quit" ),
_( "Quit KiCad" ),
exit_xpm );
// Browse menu
// Menu Browse:
wxMenu* browseMenu = new wxMenu();
// Text editor
ADD_MENUITEM_WITH_HELP( browseMenu, ID_TO_EDITOR,
ADD_MENUITEM_WITH_HELP( browseMenu,
ID_TO_EDITOR,
_( "Text E&ditor" ),
_( "Launch preferred text editor" ),
editor_xpm );
// View file
ADD_MENUITEM_WITH_HELP( browseMenu, ID_BROWSE_AN_SELECT_FILE,
ADD_MENUITEM_WITH_HELP( browseMenu,
ID_BROWSE_AN_SELECT_FILE,
_( "&View File" ),
_( "View, read or edit file with a text editor" ),
browse_files_xpm );
// Preferences menu
wxMenu* PreferencesMenu = new wxMenu;
// Menu Preferences:
wxMenu* preferencesMenu = new wxMenu;
// Text editor
ADD_MENUITEM_WITH_HELP( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_SELECT_PREFERED_EDITOR,
_( "&Text Editor" ),
_( "Select your preferred text editor" ),
editor_xpm );
......@@ -191,36 +206,44 @@ void WinEDA_MainFrame::ReCreateMenuBar()
_( "Select your favourite PDF viewer used to browse datasheets" ),
datasheet_xpm );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( PreferencesMenu,
SubMenuPdfBrowserChoice,
-1, _( "PDF Viewer" ),
// PDF viewer submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( preferencesMenu,
SubMenuPdfBrowserChoice, -1,
_( "PDF Viewer" ),
_( "PDF viewer preferences" ),
datasheet_xpm );
// Add languages list:
PreferencesMenu->AppendSeparator();
wxGetApp().AddMenuLanguageList( PreferencesMenu );
// Language submenu
preferencesMenu->AppendSeparator();
wxGetApp().AddMenuLanguageList( preferencesMenu );
// Help menu
// Menu Help:
wxMenu* helpMenu = new wxMenu;
// Version info
AddHelpVersionInfoMenuEntry( helpMenu );
// Contents
ADD_MENUITEM_WITH_HELP( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
ADD_MENUITEM_WITH_HELP( helpMenu,
ID_GENERAL_HELP,
_( "&Contents" ),
_( "Open the kicad manual" ),
online_help_xpm );
// About
// Separator
helpMenu->AppendSeparator();
ADD_MENUITEM_WITH_HELP( helpMenu, wxID_ABOUT, _( "&About" ),
// About
ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_ABOUT,
_( "&About KiCad" ),
_( "About kicad project manager" ),
info_xpm );
// Create the menubar and append all submenus
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( browseMenu, _( "&Browse" ) );
menuBar->Append( PreferencesMenu, _( "&Preferences" ) );
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
menuBar->Thaw();
......@@ -238,44 +261,44 @@ void WinEDA_MainFrame::ReCreateMenuBar()
*/
void WinEDA_MainFrame::RecreateBaseHToolbar()
{
/* Check if toolbar is not already created */
// Check if toolbar is not already created
if( m_HToolBar != NULL )
return;
/* Allocate memory for m_HToolBar */
// Allocate memory for m_HToolBar
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
/* New */
// New
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
wxBitmap( new_project_xpm ),
_( "Start a new project" ) );
/* Load */
// Load
m_HToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
wxBitmap( open_project_xpm ),
_( "Load existing project" ) );
/* Save */
// Save
m_HToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
wxBitmap( save_project_xpm ),
_( "Save current project" ) );
/* Separator */
// Separator
m_HToolBar->AddSeparator();
/* Archive */
// Archive
m_HToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
wxBitmap( zip_xpm ),
_( "Archive all project files" ) );
/* Separator */
// Separator
m_HToolBar->AddSeparator();
/* Refresh project tree */
// Refresh project tree
m_HToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
wxBitmap( reload_xpm ),
_( "Refresh project tree" ) );
/* Create m_HToolBar */
// Create m_HToolBar
m_HToolBar->Realize();
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment