Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
6b39096b
Commit
6b39096b
authored
Apr 06, 2011
by
Jerry Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of all menubar code, see CHANGELOG.txt
parent
e764474f
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
667 additions
and
454 deletions
+667
-454
CHANGELOG.txt
CHANGELOG.txt
+7
-0
hotkeys_basic.cpp
common/hotkeys_basic.cpp
+1
-0
cvframe.cpp
cvpcb/cvframe.cpp
+2
-2
cvpcb.cpp
cvpcb/cvpcb.cpp
+0
-8
menubar.cpp
cvpcb/menubar.cpp
+63
-43
menubar.cpp
eeschema/menubar.cpp
+158
-113
menubar_libedit.cpp
eeschema/menubar_libedit.cpp
+138
-90
events_called_functions.cpp
gerbview/events_called_functions.cpp
+7
-7
gerbview.cpp
gerbview/gerbview.cpp
+0
-5
gerbview_frame.h
gerbview/gerbview_frame.h
+10
-0
menubar.cpp
gerbview/menubar.cpp
+113
-50
menubar.cpp
kicad/menubar.cpp
+68
-45
menubar_modedit.cpp
pcbnew/menubar_modedit.cpp
+100
-91
No files found.
CHANGELOG.txt
View file @
6b39096b
...
...
@@ -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
...
...
common/hotkeys_basic.cpp
View file @
6b39096b
...
...
@@ -673,3 +673,4 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
ID_PREFERENCES_HOTKEY_SUBMENU
,
_
(
"Hotkeys"
),
_
(
"Hotkeys configuration and preferences"
),
hotkeys_xpm
);
}
cvpcb/cvframe.cpp
View file @
6b39096b
...
...
@@ -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_KICA
D_ABOUT
,
EVT_MENU
(
wxI
D_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
)
...
...
cvpcb/cvpcb.cpp
View file @
6b39096b
...
...
@@ -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
;
...
...
cvpcb/menubar.cpp
View file @
6b39096b
/*
* 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
);
configm
enu
->
Append
(
item
);
preferencesM
enu
->
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
(
configm
enu
,
_
(
"&Preferences"
)
);
menuBar
->
Append
(
preferencesM
enu
,
_
(
"&Preferences"
)
);
menuBar
->
Append
(
helpMenu
,
_
(
"&Help"
)
);
menuBar
->
Thaw
();
...
...
eeschema/menubar.cpp
View file @
6b39096b
This diff is collapsed.
Click to expand it.
eeschema/menubar_libedit.cpp
View file @
6b39096b
This diff is collapsed.
Click to expand it.
gerbview/events_called_functions.cpp
View file @
6b39096b
...
...
@@ -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_KICA
D_ABOUT
,
EDA_DRAW_FRAME
::
GetKicadAbout
)
EVT_MENU
(
wxI
D_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
...
...
gerbview/gerbview.cpp
View file @
6b39096b
...
...
@@ -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
()
)
...
...
gerbview/gerbview_frame.h
View file @
6b39096b
...
...
@@ -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
();
...
...
gerbview/menubar.cpp
View file @
6b39096b
/**
***********************************/
/* 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 submenu
s
//
Recent gerber file
s
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
,
_
(
"&Miscellaneou
s"
)
);
// Append menus to the menubar
menuBar
->
Append
(
fileMenu
,
_
(
"&File
"
)
);
menuBar
->
Append
(
configMenu
,
_
(
"&Preference
s"
)
);
menuBar
->
Append
(
miscellaneousMenu
,
_
(
"&Miscellaneous"
)
);
menuBar
->
Append
(
helpMenu
,
_
(
"&Help"
)
);
menuBar
->
Thaw
();
...
...
kicad/menubar.cpp
View file @
6b39096b
/**
* @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
*
file
s
Menu
=
new
wxMenu
;
//
Menu File:
wxMenu
*
fileMenu
=
new
wxMenu
;
// Open
ADD_MENUITEM_WITH_HELP
(
filesMenu
,
ID_LOAD_PROJECT
,
_
(
"&Open
\t
Ctrl+O"
),
ADD_MENUITEM_WITH_HELP
(
fileMenu
,
ID_LOAD_PROJECT
,
_
(
"&Open
\t
Ctrl+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
(
file
s
Menu
,
ID_NEW_PROJECT
,
ADD_MENUITEM_WITH_HELP
(
fileMenu
,
ID_NEW_PROJECT
,
_
(
"&New
\t
Ctrl+N"
),
_
(
"Start a new project"
),
new_project_xpm
);
/* Save */
ADD_MENUITEM_WITH_HELP
(
filesMenu
,
ID_SAVE_PROJECT
,
_
(
"&Save
\t
Ctrl+S"
),
// Save
ADD_MENUITEM_WITH_HELP
(
fileMenu
,
ID_SAVE_PROJECT
,
_
(
"&Save
\t
Ctrl+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
file
s
Menu
->
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:
P
referencesMenu
->
AppendSeparator
();
wxGetApp
().
AddMenuLanguageList
(
P
referencesMenu
);
//
Language submenu
p
referencesMenu
->
AppendSeparator
();
wxGetApp
().
AddMenuLanguageList
(
p
referencesMenu
);
//
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
(
file
s
Menu
,
_
(
"&File"
)
);
menuBar
->
Append
(
fileMenu
,
_
(
"&File"
)
);
menuBar
->
Append
(
browseMenu
,
_
(
"&Browse"
)
);
menuBar
->
Append
(
P
referencesMenu
,
_
(
"&Preferences"
)
);
menuBar
->
Append
(
p
referencesMenu
,
_
(
"&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
();
}
pcbnew/menubar_modedit.cpp
View file @
6b39096b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment