Commit 94372b81 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: fix bug 783535. Minor code cleaning.

Pcbnew: fix very minor issue.
parent a367dea4
...@@ -339,22 +339,11 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu ) ...@@ -339,22 +339,11 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
{ {
wxASSERT( aMenu != NULL ); wxASSERT( aMenu != NULL );
wxMenuItem* item = NULL;
// Copy version string to clipboard for bug report purposes. // Copy version string to clipboard for bug report purposes.
item = new wxMenuItem( aMenu, ID_HELP_COPY_VERSION_STRING, ADD_MENUITEM_WITH_HELP( aMenu, ID_HELP_COPY_VERSION_STRING,
_( "Copy &Version Information" ), _( "Copy &Version Information" ),
_( "Copy the version string to clipboard to send with bug reports" ) ); _( "Copy the version string to clipboard to send with bug reports" ),
copy_button );
// For some reason images are not always added to the OSX menu items. Anyone want
// to clarify as to why this is the case? Putting this information in some formal
// developer notes would be helpful. A good place to put this information would be
// ./documentation/guidelines/UIpolicies.txt.
#if !defined( __WXMAC__ )
item->SetBitmap( copy_button );
#endif
aMenu->Append( item );
} }
......
...@@ -632,41 +632,34 @@ void AddHotkeyConfigMenu( wxMenu* aMenu ) ...@@ -632,41 +632,34 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
if( aMenu == NULL ) if( aMenu == NULL )
return; return;
wxMenuItem* item;
wxMenu* HotkeySubmenu = new wxMenu(); wxMenu* HotkeySubmenu = new wxMenu();
/* List existing hotkey menu*/ /* List existing hotkey menu*/
item = new wxMenuItem( HotkeySubmenu, ADD_MENUITEM_WITH_HELP( 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" ),
item->SetBitmap( info_xpm ); info_xpm );
HotkeySubmenu->Append( item );
/* Call hotkeys editor*/ /* Call hotkeys editor*/
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR, ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
_( "Edit Hotkeys" ), _( "Edit Hotkeys" ),
_( "Call the hotkeys editor" ) ); _( "Call the hotkeys editor" ),
item->SetBitmap( editor_xpm ); editor_xpm );
HotkeySubmenu->Append( item );
HotkeySubmenu->AppendSeparator(); HotkeySubmenu->AppendSeparator();
/* create hotkey file to export current hotkeys config */ /* create hotkey file to export current hotkeys config */
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG, ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "Export Hotkeys Config" ), _( "Export Hotkeys Config" ),
_( _( "Create a hotkey configuration file to export the current hotkey config" ),
"Create a hotkey configuration file to export the current hotkey config" ) save_setup_xpm );
);
item->SetBitmap( save_setup_xpm );
HotkeySubmenu->Append( item );
/* Reload hotkey file */ /* Reload hotkey file */
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG, ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "Import Hotkeys Config" ), _( "Import Hotkeys Config" ),
_( "Load an existing hotkey configuration file" ) ); _( "Load an existing hotkey configuration file" ),
item->SetBitmap( reload_xpm ); reload_xpm );
HotkeySubmenu->Append( item );
/* Append HotkeySubmenu to menu */ /* Append HotkeySubmenu to menu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu,
......
...@@ -60,7 +60,8 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) ...@@ -60,7 +60,8 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
if( item->IsNew() ) if( item->IsNew() )
{ {
SAFE_DELETE( item ); delete item;
item = NULL;
} }
else // Move command on an existing text item, restore the copy of the original. else // Move command on an existing text item, restore the copy of the original.
{ {
...@@ -77,7 +78,7 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) ...@@ -77,7 +78,7 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
item->ClearFlags(); item->ClearFlags();
} }
screen->SetCurItem( NULL ); screen->SetCurItem( item );
} }
......
...@@ -115,6 +115,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME ) ...@@ -115,6 +115,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent ) EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_LIBEDIT_GEN_SVG_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_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::OnColorConfig ) EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::OnColorConfig )
EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame ) EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
......
...@@ -26,18 +26,17 @@ ...@@ -26,18 +26,17 @@
void SCH_EDIT_FRAME::ReCreateMenuBar() void SCH_EDIT_FRAME::ReCreateMenuBar()
{ {
// Create and try to get the current menubar // Create and try to get the current menubar
wxString text; wxString text;
wxMenuItem* item; wxMenuBar* menuBar = GetMenuBar();
wxMenuBar* menuBar = GetMenuBar();
if( ! menuBar ) if( !menuBar )
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
// 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 );
// Recreate all menus: // Recreate all menus:
...@@ -45,23 +44,22 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -45,23 +44,22 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// New // New
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_NEW_PROJECT, ID_NEW_PROJECT,
_( "&New\tCtrl+N" ), _( "&New\tCtrl+N" ),
_( "New schematic project" ) ); _( "New schematic project" ),
SET_BITMAP( new_xpm ); new_xpm );
fileMenu->Append( item );
// Open // Open
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_LOAD_PROJECT, ID_LOAD_PROJECT,
_( "&Open\tCtrl+O" ), _( "&Open\tCtrl+O" ),
_( "Open an existing schematic project" ) ); _( "Open an existing schematic project" ),
SET_BITMAP( open_document_xpm ); open_document_xpm );
fileMenu->Append( item );
// Open Recent submenu // Open Recent submenu
static wxMenu* openRecentMenu; static wxMenu* openRecentMenu;
// Add this menu to list menu managed by m_fileHistory // Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history // (the file history will be updated when adding/removing files in history
if( openRecentMenu ) if( openRecentMenu )
...@@ -73,105 +71,97 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -73,105 +71,97 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
wxID_ANY, _( "Open &Recent" ), wxID_ANY, _( "Open &Recent" ),
_( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ),
open_project_xpm ); open_project_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Save schematic project // Save schematic project
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_SAVE_PROJECT, ID_SAVE_PROJECT,
_( "&Save Whole Schematic Project\tCtrl+S" ), _( "&Save Whole Schematic Project\tCtrl+S" ),
_( "Save all sheets in the schematic project" ) ); _( "Save all sheets in the schematic project" ),
SET_BITMAP( save_project_xpm ); save_project_xpm );
fileMenu->Append( item );
// Save current sheet // Save current sheet
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_SAVE_ONE_SHEET, ID_SAVE_ONE_SHEET,
_( "Save &Current Sheet Only" ), _( "Save &Current Sheet Only" ),
_( "Save only current schematic sheet" ) ); _( "Save only current schematic sheet" ),
SET_BITMAP( save_xpm ); save_xpm );
fileMenu->Append( item );
// Save current sheet as // Save current sheet as
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( 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..." ),
SET_BITMAP( save_as_xpm ); save_as_xpm );
fileMenu->Append( item );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Print // Print
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_PRINT, wxID_PRINT,
_( "P&rint" ), _( "P&rint" ),
_( "Print schematic" ) ); _( "Print schematic" ),
SET_BITMAP( print_button ); print_button );
fileMenu->Append( item );
// Plot submenu // Plot submenu
wxMenu* choice_plot_fmt = new wxMenu; wxMenu* choice_plot_fmt = new wxMenu;
// Plot PostScript // Plot PostScript
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS, ADD_MENUITEM_WITH_HELP( choice_plot_fmt, ID_GEN_PLOT_PS,
_( "Plot PostScript" ), _( "Plot PostScript" ),
_( "Plot schematic sheet in PostScript format" ) ); _( "Plot schematic sheet in PostScript format" ),
SET_BITMAP( plot_PS_xpm ); plot_PS_xpm );
choice_plot_fmt->Append( item );
// Plot HPGL // Plot HPGL
item = new wxMenuItem( choice_plot_fmt, ADD_MENUITEM_WITH_HELP( 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" ),
SET_BITMAP( plot_HPG_xpm ); plot_HPG_xpm );
choice_plot_fmt->Append( item );
// Plot SVG // Plot SVG
item = new wxMenuItem( choice_plot_fmt, ADD_MENUITEM_WITH_HELP( 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" ),
SET_BITMAP( plot_xpm ); plot_xpm );
choice_plot_fmt->Append( item );
// Plot DXF // Plot DXF
item = new wxMenuItem( choice_plot_fmt, ADD_MENUITEM_WITH_HELP( 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" ),
SET_BITMAP( plot_xpm ); plot_xpm );
choice_plot_fmt->Append( item );
// Plot to Clipboard (Windows only) // Plot to Clipboard (Windows only)
#ifdef __WINDOWS__ #ifdef __WINDOWS__
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD, ADD_MENUITEM_WITH_HELP( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
_( "Plot to Clipboard" ), _( "Plot to Clipboard" ),
_( "Export drawings to clipboard" ) ); _( "Export drawings to clipboard" ),
SET_BITMAP( copy_button ); copy_button );
choice_plot_fmt->Append( item );
#endif // __WINDOWS__ #endif // __WINDOWS__
// Plot submenu // Plot submenu
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, choice_plot_fmt, ADD_MENUITEM_WITH_HELP_AND_SUBMENU( fileMenu, choice_plot_fmt,
ID_GEN_PLOT, _( "&Plot" ), ID_GEN_PLOT, _( "&Plot" ),
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ), _(
"Plot schematic sheet in HPGL, PostScript or SVG format" ),
plot_xpm ); plot_xpm );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit EESchema" ) ); _( "Quit EESchema" ),
SET_BITMAP( exit_xpm ); exit_xpm );
fileMenu->Append( item );
// Menu Edit: // Menu Edit:
wxMenu* editMenu = new wxMenu; wxMenu* editMenu = new wxMenu;
...@@ -179,44 +169,39 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -179,44 +169,39 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Undo // Undo
text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO ); text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
item = new wxMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( editMenu, wxID_UNDO, text, HELP_UNDO,
SET_BITMAP( undo_xpm ); undo_xpm );
editMenu->Append( item );
// Redo // Redo
text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO ); text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO );
item = new wxMenuItem( editMenu, wxID_REDO, text, HELP_REDO, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( editMenu, wxID_REDO, text, HELP_REDO,
SET_BITMAP( redo_xpm ); redo_xpm );
editMenu->Append( item );
// Delete // Delete
editMenu->AppendSeparator(); editMenu->AppendSeparator();
item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT, ADD_MENUITEM_WITH_HELP( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
_( "Delete" ), HELP_DELETE_ITEMS, wxITEM_NORMAL ); _( "Delete" ), HELP_DELETE_ITEMS,
SET_BITMAP( delete_body_xpm ); delete_body_xpm );
editMenu->Append( item );
// Separator // Separator
editMenu->AppendSeparator(); editMenu->AppendSeparator();
// Find // Find
text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM ); text = AddHotkeyName( _( "&Find" ), s_Schematic_Hokeys_Descr, HK_FIND_ITEM );
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( editMenu, ID_FIND_ITEMS, text, HELP_FIND,
SET_BITMAP( find_xpm ); find_xpm );
editMenu->Append( item );
// Separator // Separator
editMenu->AppendSeparator(); editMenu->AppendSeparator();
// Backannotate // Backannotate
item = new wxMenuItem( editMenu, ADD_MENUITEM_WITH_HELP( editMenu,
ID_BACKANNO_ITEMS, ID_BACKANNO_ITEMS,
_( "Backannotate" ), _( "Backannotate" ),
_( "Back annotated footprint fields" ), _( "Back annotated footprint fields" ),
wxITEM_NORMAL );
SET_BITMAP( backanno_xpm ); backanno_xpm );
editMenu->Append( item );
// Menu View: // Menu View:
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
...@@ -239,32 +224,28 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -239,32 +224,28 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Zoom in // Zoom in
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_IN, false ); // add comment, not a shortcut ID_ZOOM_IN, false ); // add comment, not a shortcut
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
SET_BITMAP( zoom_in_xpm ); zoom_in_xpm );
viewMenu->Append( item );
// Zoom out // Zoom out
text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Zoom Out" ), s_Schematic_Hokeys_Descr,
ID_ZOOM_OUT, false ); // add comment, not a shortcut ID_ZOOM_OUT, false ); // add comment, not a shortcut
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
SET_BITMAP( zoom_out_xpm ); zoom_out_xpm );
viewMenu->Append( item );
// 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 );
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
SET_BITMAP( zoom_fit_in_page_xpm ); zoom_fit_in_page_xpm );
viewMenu->Append( item );
// 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 );
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW,
SET_BITMAP( zoom_redraw_xpm ); zoom_redraw_xpm );
viewMenu->Append( item );
// Menu place: // Menu place:
// @todo unify IDs // @todo unify IDs
...@@ -273,90 +254,80 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -273,90 +254,80 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Component // Component
text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Component" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut HK_ADD_NEW_COMPONENT, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_SCH_PLACE_COMPONENT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_SCH_PLACE_COMPONENT, text,
HELP_PLACE_COMPONENTS, wxITEM_NORMAL ); HELP_PLACE_COMPONENTS,
SET_BITMAP( add_component_xpm ); add_component_xpm );
placeMenu->Append( item );
// Power port // Power port
text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Power port" ), s_Schematic_Hokeys_Descr,
HK_ADD_NEW_POWER, false ); // add comment, not a shortcut HK_ADD_NEW_POWER, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_PLACE_POWER_BUTT, text,
HELP_PLACE_POWERPORT, wxITEM_NORMAL ); HELP_PLACE_POWERPORT,
SET_BITMAP( add_power_xpm ); add_power_xpm );
placeMenu->Append( item );
// Wire // Wire
text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_WIRE, false ); // add comment, not a shortcut HK_BEGIN_WIRE, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_WIRE_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_WIRE_BUTT, text,
HELP_PLACE_WIRE, wxITEM_NORMAL ); HELP_PLACE_WIRE,
SET_BITMAP( add_line_xpm ); add_line_xpm );
placeMenu->Append( item );
// Bus // Bus
text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus" ), s_Schematic_Hokeys_Descr,
HK_BEGIN_BUS, false ); // add comment, not a shortcut HK_BEGIN_BUS, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_BUS_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_BUS_BUTT, text,
HELP_PLACE_BUS, wxITEM_NORMAL ); HELP_PLACE_BUS,
SET_BITMAP( add_bus_xpm ); add_bus_xpm );
placeMenu->Append( item );
// Wire to Bus entry // Wire to Bus entry
text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Wire to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut HK_ADD_WIRE_ENTRY, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_WIRETOBUS_ENTRY_BUTT, text,
HELP_PLACE_WIRE2BUS_ENTRY, wxITEM_NORMAL ); HELP_PLACE_WIRE2BUS_ENTRY,
SET_BITMAP( add_line2bus_xpm ); add_line2bus_xpm );
placeMenu->Append( item );
// Bus to Bus entry // Bus to Bus entry
text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Bus to bus entry" ), s_Schematic_Hokeys_Descr,
HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut HK_ADD_BUS_ENTRY, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_BUSTOBUS_ENTRY_BUTT, text,
HELP_PLACE_BUS2BUS_ENTRY, wxITEM_NORMAL ); HELP_PLACE_BUS2BUS_ENTRY,
SET_BITMAP( add_bus2bus_xpm ); add_bus2bus_xpm );
placeMenu->Append( item );
// No connect flag // No connect flag
text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "No connect flag" ), s_Schematic_Hokeys_Descr,
HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut HK_ADD_NOCONN_FLAG, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( placeMenu, ID_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG,
SET_BITMAP( noconn_button ); noconn_button );
placeMenu->Append( item );
// Net name // Net name
text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Label" ), s_Schematic_Hokeys_Descr,
HK_ADD_LABEL, false ); // add comment, not a shortcut HK_ADD_LABEL, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_LABEL_BUTT, text,
HELP_PLACE_NETLABEL, wxITEM_NORMAL ); HELP_PLACE_NETLABEL,
SET_BITMAP( add_line_label_xpm ); add_line_label_xpm );
placeMenu->Append( item );
// Global label // Global label
text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Global label" ), s_Schematic_Hokeys_Descr,
HK_ADD_GLABEL, false ); // add comment, not a shortcut HK_ADD_GLABEL, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_GLABEL_BUTT, text,
HELP_PLACE_GLOBALLABEL, wxITEM_NORMAL ); HELP_PLACE_GLOBALLABEL,
SET_BITMAP( add_glabel_xpm ); add_glabel_xpm );
placeMenu->Append( item );
// Junction // Junction
text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Junction" ), s_Schematic_Hokeys_Descr,
HK_ADD_JUNCTION, false ); // add comment, not a shortcut HK_ADD_JUNCTION, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_JUNCTION_BUTT, text,
HELP_PLACE_JUNCTION, wxITEM_NORMAL ); HELP_PLACE_JUNCTION,
SET_BITMAP( add_junction_xpm ); add_junction_xpm );
placeMenu->Append( item );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
// Hierarchical label // Hierarchical label
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut HK_ADD_HLABEL, false ); // add comment, not a shortcut
text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical label" ), s_Schematic_Hokeys_Descr,
HK_ADD_HLABEL, false ); // add comment, not a shortcut HK_ADD_HLABEL, false ); // add comment, not a shortcut
ADD_MENUITEM_WITH_HELP( placeMenu, ID_HIERLABEL_BUTT, ADD_MENUITEM_WITH_HELP( placeMenu, ID_HIERLABEL_BUTT,
text, HELP_PLACE_HIER_LABEL, text, HELP_PLACE_HIER_LABEL,
add_hierarchical_label_xpm ); add_hierarchical_label_xpm );
...@@ -365,26 +336,23 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -365,26 +336,23 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Hierarchical sheet // Hierarchical sheet
text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Hierarchical sheet" ), s_Schematic_Hokeys_Descr,
HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut HK_ADD_HIER_SHEET, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_SHEET_SYMBOL_BUTT, text,
HELP_PLACE_SHEET, wxITEM_NORMAL ); HELP_PLACE_SHEET,
SET_BITMAP( add_hierarchical_subsheet_xpm ); add_hierarchical_subsheet_xpm );
placeMenu->Append( item );
// Import hierarchical sheet // Import hierarchical sheet
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_IMPORT_HLABEL_BUTT, ID_IMPORT_HLABEL_BUTT,
_( "Import Hierarchical Label" ), _( "Import Hierarchical Label" ),
HELP_IMPORT_SHEETPIN, wxITEM_NORMAL ); HELP_IMPORT_SHEETPIN,
SET_BITMAP( import_hierarchical_label_xpm ); import_hierarchical_label_xpm );
placeMenu->Append( item );
// Add hierarchical Pin to Sheet // Add hierarchical Pin to Sheet
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_SHEET_PIN_BUTT, ID_SHEET_PIN_BUTT,
_( "Add Hierarchical Pin to Sheet" ), _( "Add Hierarchical Pin to Sheet" ),
HELP_PLACE_SHEETPIN, wxITEM_NORMAL ); HELP_PLACE_SHEETPIN,
SET_BITMAP( add_hierar_pin_xpm ); add_hierar_pin_xpm );
placeMenu->Append( item );
// Separator // Separator
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
...@@ -392,50 +360,45 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -392,50 +360,45 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Graphic line or polygon // Graphic line or polygon
text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic polyline" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut HK_ADD_GRAPHIC_POLYLINE, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_LINE_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICLINES, wxITEM_NORMAL ); HELP_PLACE_GRAPHICLINES,
SET_BITMAP( add_dashed_line_xpm ); add_dashed_line_xpm );
placeMenu->Append( item );
// Graphic text // Graphic text
text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr, text = AddHotkeyName( _( "Graphic text" ), s_Schematic_Hokeys_Descr,
HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut HK_ADD_GRAPHIC_TEXT, false ); // add comment, not a shortcut
item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT, text, ADD_MENUITEM_WITH_HELP( placeMenu, ID_TEXT_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICTEXTS, wxITEM_NORMAL ); HELP_PLACE_GRAPHICTEXTS,
SET_BITMAP( add_text_xpm ); add_text_xpm );
placeMenu->Append( item );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Library // Library
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Library preferences" ) ); _( "Library preferences" ),
SET_BITMAP( library_xpm ); library_xpm );
preferencesMenu->Append( item );
// Colors // Colors
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_COLORS_SETUP, ID_COLORS_SETUP,
_( "&Colors" ), _( "&Colors" ),
_( "Color preferences" ) ); _( "Color preferences" ),
SET_BITMAP( palette_xpm ); palette_xpm );
preferencesMenu->Append( item );
// Options (Preferences on WXMAC) // Options (Preferences on WXMAC)
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
wxID_PREFERENCES, wxID_PREFERENCES,
#ifdef __WXMAC__ #ifdef __WXMAC__
_( "&Preferences..." ), _( "&Preferences..." ),
#else #else
_( "&Options" ), _( "&Options" ),
#endif // __WXMAC__ #endif // __WXMAC__
_( "EESchema preferences" ) ); _( "EESchema preferences" ),
SET_BITMAP( preference_xpm ); preference_xpm );
preferencesMenu->Append( item );
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu ); wxGetApp().AddMenuLanguageList( preferencesMenu );
...@@ -447,20 +410,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -447,20 +410,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
// Save preferences // Save preferences
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
_( "&Save preferences" ), _( "&Save preferences" ),
_( "Save application preferences" ) ); _( "Save application preferences" ),
SET_BITMAP( save_setup_xpm ); save_setup_xpm );
preferencesMenu->Append( item );
// Read preferences // Read preferences
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_READ, ID_CONFIG_READ,
_( "&Read preferences" ), _( "&Read preferences" ),
_( "Read application preferences" ) ); _( "Read application preferences" ),
SET_BITMAP( read_setup_xpm ); read_setup_xpm );
preferencesMenu->Append( item );
// Help Menu: // Help Menu:
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
...@@ -469,28 +430,26 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() ...@@ -469,28 +430,26 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contents // Contents
item = new wxMenuItem( helpMenu, ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the Eeschema handbook" ) ); _( "Open the Eeschema handbook" ),
SET_BITMAP( online_help_xpm ); online_help_xpm );
helpMenu->Append( item );
// About EESchema // About EESchema
item = new wxMenuItem( helpMenu, ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_ABOUT, wxID_ABOUT,
_( "&About EESchema" ), _( "&About EESchema" ),
_( "About EESchema schematic designer" ) ); _( "About EESchema schematic designer" ),
SET_BITMAP( info_xpm ); info_xpm );
helpMenu->Append( item );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
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, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) ); menuBar->Append( helpMenu, _( "&Help" ) );
menuBar->Thaw(); menuBar->Thaw();
......
...@@ -21,17 +21,16 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -21,17 +21,16 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
{ {
// Create and try to get the current menubar // Create and try to get the current menubar
wxString text; wxString text;
wxMenuItem *item; wxMenuBar* menuBar = GetMenuBar();
wxMenuBar *menuBar = GetMenuBar();
if( ! menuBar ) if( !menuBar )
menuBar = new wxMenuBar(); menuBar = new wxMenuBar();
// 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 );
// Recreate all menus: // Recreate all menus:
...@@ -39,87 +38,75 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -39,87 +38,75 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* fileMenu = new wxMenu; wxMenu* fileMenu = new wxMenu;
// Save current library // Save current library
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_LIBEDIT_SAVE_CURRENT_LIB, ID_LIBEDIT_SAVE_CURRENT_LIB,
_( "&Save Current Library\tCtrl+S" ), _( "&Save Current Library\tCtrl+S" ),
_( "Save the current active library" ) ); _( "Save the current active library" ),
SET_BITMAP( save_xpm ); save_xpm );
fileMenu->Append( item );
// Save current library as... // Save current library as...
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( 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..." ),
SET_BITMAP( save_as_xpm ); save_as_xpm );
fileMenu->Append( item );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Export as png file // Export as png file
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_LIBEDIT_GEN_PNG_FILE, ID_LIBEDIT_GEN_PNG_FILE,
_( "&Create PNG File from Screen" ), _( "&Create PNG File from Screen" ),
_( "Create a PNG file from the component displayed on screen" ) ); _( "Create a PNG file from the component displayed on screen" ),
SET_BITMAP( plot_xpm ); plot_xpm );
fileMenu->Append( item );
// Export as SVG file // Export as SVG file
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
ID_LIBEDIT_GEN_SVG_FILE, ID_LIBEDIT_GEN_SVG_FILE,
_( "&Create SVG File" ), _( "&Create SVG File" ),
_( "Create a SVG file from the current loaded component" ) ); _( "Create a SVG file from the current loaded component" ),
SET_BITMAP( plot_xpm ); plot_xpm );
fileMenu->Append( item );
// Separator // Separator
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
// Quit // Quit
item = new wxMenuItem( fileMenu, ADD_MENUITEM_WITH_HELP( fileMenu,
wxID_EXIT, wxID_EXIT,
_( "&Quit" ), _( "&Quit" ),
_( "Quit Library Editor" ) ); _( "Quit Library Editor" ),
SET_BITMAP( exit_xpm ); exit_xpm );
fileMenu->Append( item );
// Edit menu // Edit menu
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 );
item = new wxMenuItem( editMenu, ADD_MENUITEM_WITH_HELP( editMenu,
wxID_UNDO, wxID_UNDO,
text, text,
_( "Undo last edition" ), _( "Undo last edition" ),
wxITEM_NORMAL ); undo_xpm );
SET_BITMAP( undo_xpm );
editMenu->Append( item );
// Redo // Redo
text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO); text = AddHotkeyName( _( "Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );
ADD_MENUITEM_WITH_HELP( editMenu,
item = new wxMenuItem( editMenu, wxID_REDO,
wxID_REDO, text,
text, _( "Redo the last undo command" ),
_( "Redo the last undo command" ), redo_xpm );
wxITEM_NORMAL );
SET_BITMAP( redo_xpm );
editMenu->Append( item );
// Separator // Separator
editMenu->AppendSeparator(); editMenu->AppendSeparator();
// Delete // Delete
item = new wxMenuItem( editMenu, ADD_MENUITEM_WITH_HELP( editMenu,
ID_LIBEDIT_DELETE_ITEM_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT,
_( "Delete" ), _( "Delete" ),
HELP_DELETE_ITEMS, HELP_DELETE_ITEMS,
wxITEM_NORMAL ); delete_body_xpm );
SET_BITMAP( delete_body_xpm );
editMenu->Append( item );
// Menu View: // Menu View:
wxMenu* viewMenu = new wxMenu; wxMenu* viewMenu = new wxMenu;
...@@ -138,109 +125,89 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -138,109 +125,89 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
*/ */
// Zoom in // Zoom in
text =_( "Zoom In" ); text = _( "Zoom In" );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN,
SET_BITMAP( zoom_in_xpm ); zoom_in_xpm );
viewMenu->Append( item );
// Zoom out // Zoom out
text = _( "Zoom Out" ); text = _( "Zoom Out" );
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, wxITEM_NORMAL ); ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT,
SET_BITMAP( zoom_out_xpm ); zoom_out_xpm );
viewMenu->Append( item );
// 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 );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT,
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, wxITEM_NORMAL ); zoom_fit_in_page_xpm );
SET_BITMAP( zoom_fit_in_page_xpm );
viewMenu->Append( item );
// 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 );
ADD_MENUITEM_WITH_HELP( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW,
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, wxITEM_NORMAL ); zoom_redraw_xpm );
SET_BITMAP( zoom_redraw_xpm );
viewMenu->Append( item );
// Menu Place: // Menu Place:
wxMenu* placeMenu = new wxMenu; wxMenu* placeMenu = new wxMenu;
// Pin // Pin
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_PIN_BUTT,
_( "&Pin" ), _( "&Pin" ),
HELP_ADD_PIN, HELP_ADD_PIN,
wxITEM_NORMAL ); pin_xpm );
SET_BITMAP( pin_xpm );
placeMenu->Append( item );
// Graphic text // Graphic text
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_BODY_TEXT_BUTT, ID_LIBEDIT_BODY_TEXT_BUTT,
_( "Graphic text" ), _( "Graphic text" ),
HELP_ADD_BODYTEXT, HELP_ADD_BODYTEXT,
wxITEM_NORMAL ); add_text_xpm );
SET_BITMAP( add_text_xpm );
placeMenu->Append( item );
// Graphic rectangle // Graphic rectangle
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_BODY_RECT_BUTT, ID_LIBEDIT_BODY_RECT_BUTT,
_( "Rectangle" ), _( "Rectangle" ),
HELP_ADD_BODYRECT, HELP_ADD_BODYRECT,
wxITEM_NORMAL ); add_rectangle_xpm );
SET_BITMAP( add_rectangle_xpm );
placeMenu->Append( item );
// Graphic Circle // Graphic Circle
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_BODY_CIRCLE_BUTT, ID_LIBEDIT_BODY_CIRCLE_BUTT,
_( "Circle" ), _( "Circle" ),
HELP_ADD_BODYCIRCLE, HELP_ADD_BODYCIRCLE,
wxITEM_NORMAL ); add_circle_xpm );
SET_BITMAP( add_circle_xpm );
placeMenu->Append( item );
// Graphic Arc // Graphic Arc
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_BODY_ARC_BUTT, ID_LIBEDIT_BODY_ARC_BUTT,
_( "Arc" ), _( "Arc" ),
HELP_ADD_BODYARC, HELP_ADD_BODYARC,
wxITEM_NORMAL ); add_arc_xpm );
SET_BITMAP( add_arc_xpm );
placeMenu->Append( item );
// Graphic Line or Polygon // Graphic Line or Polygon
item = new wxMenuItem( placeMenu, ADD_MENUITEM_WITH_HELP( placeMenu,
ID_LIBEDIT_BODY_LINE_BUTT, ID_LIBEDIT_BODY_LINE_BUTT,
_( "Line or Polygon" ), _( "Line or Polygon" ),
HELP_ADD_BODYPOLYGON, HELP_ADD_BODYPOLYGON,
wxITEM_NORMAL ); add_polygon_xpm );
SET_BITMAP( add_polygon_xpm );
placeMenu->Append( item );
// Menu Preferences: // Menu Preferences:
wxMenu* preferencesMenu = new wxMenu; wxMenu* preferencesMenu = new wxMenu;
// Library // Library
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_REQ, ID_CONFIG_REQ,
_( "&Library" ), _( "&Library" ),
_( "Library preferences" ) ); _( "Library preferences" ),
SET_BITMAP( library_xpm ); library_xpm );
preferencesMenu->Append( item );
// Colors // Colors
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_COLORS_SETUP, ID_COLORS_SETUP,
_( "&Colors" ), _( "&Colors" ),
_( "Color preferences" ) ); _( "Color preferences" ),
SET_BITMAP( palette_xpm ); palette_xpm );
preferencesMenu->Append( item );
// Language submenu // Language submenu
wxGetApp().AddMenuLanguageList( preferencesMenu ); wxGetApp().AddMenuLanguageList( preferencesMenu );
...@@ -252,20 +219,18 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -252,20 +219,18 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator(); preferencesMenu->AppendSeparator();
// Save preferences // Save preferences
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_SAVE, ID_CONFIG_SAVE,
_( "&Save preferences" ), _( "&Save preferences" ),
_( "Save application preferences" ) ); _( "Save application preferences" ),
SET_BITMAP( save_setup_xpm ); save_setup_xpm );
preferencesMenu->Append( item );
// Read preferences // Read preferences
item = new wxMenuItem( preferencesMenu, ADD_MENUITEM_WITH_HELP( preferencesMenu,
ID_CONFIG_READ, ID_CONFIG_READ,
_( "&Read preferences" ), _( "&Read preferences" ),
_( "Read application preferences" ) ); _( "Read application preferences" ),
SET_BITMAP( read_setup_xpm ); read_setup_xpm );
preferencesMenu->Append( item );
// Menu Help: // Menu Help:
wxMenu* helpMenu = new wxMenu; wxMenu* helpMenu = new wxMenu;
...@@ -273,13 +238,19 @@ void LIB_EDIT_FRAME::ReCreateMenuBar() ...@@ -273,13 +238,19 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Version info // Version info
AddHelpVersionInfoMenuEntry( helpMenu ); AddHelpVersionInfoMenuEntry( helpMenu );
// Contens // Contents
item = new wxMenuItem( helpMenu, ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_HELP, wxID_HELP,
_( "&Contents" ), _( "&Contents" ),
_( "Open the eeschema manual" ) ); _( "Open the eeschema manual" ),
SET_BITMAP( online_help_xpm ); online_help_xpm );
helpMenu->Append( item );
// About EESchema
ADD_MENUITEM_WITH_HELP( helpMenu,
wxID_ABOUT,
_( "&About EESchema" ),
_( "About EESchema schematic designer" ),
info_xpm );
// Create the menubar and append all submenus // Create the menubar and append all submenus
menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( fileMenu, _( "&File" ) );
......
...@@ -144,6 +144,8 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList ) ...@@ -144,6 +144,8 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList )
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem ) void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
{ {
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) ); wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
if( aItem == NULL )
return;
SCH_SCREEN* screen = GetScreen(); SCH_SCREEN* screen = GetScreen();
......
...@@ -103,6 +103,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -103,6 +103,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
INSTALL_UNBUFFERED_DC( dc, DrawPanel ); INSTALL_UNBUFFERED_DC( dc, DrawPanel );
item = screen->GetCurItem(); // Can be modified by previous calls.
switch( id ) switch( id )
{ {
......
...@@ -101,7 +101,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) ...@@ -101,7 +101,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_POPUP_SCH_MOVE_ITEM, SCH_EDIT_FRAME::OnMoveItem ) EVT_TOOL( ID_POPUP_SCH_MOVE_ITEM, SCH_EDIT_FRAME::OnMoveItem )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp ) EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout ) EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Tools and buttons for vertical toolbar. // Tools and buttons for vertical toolbar.
EVT_TOOL( ID_CANCEL_CURRENT_COMMAND, SCH_EDIT_FRAME::OnCancelCurrentCommand ) EVT_TOOL( ID_CANCEL_CURRENT_COMMAND, SCH_EDIT_FRAME::OnCancelCurrentCommand )
......
...@@ -328,7 +328,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName ) ...@@ -328,7 +328,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
GetScreen()->GetFileName(), PcbFileWildcard, GetScreen()->GetFileName(), PcbFileWildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() != wxID_OK )
return false; return false;
GetScreen()->SetFileName( dlg.GetPath() ); GetScreen()->SetFileName( dlg.GetPath() );
......
...@@ -156,7 +156,8 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); ...@@ -156,7 +156,8 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
frame->GetScreen()->SetFileName( fn.GetFullPath( wxPATH_UNIX ) ); frame->GetScreen()->SetFileName( fn.GetFullPath( wxPATH_UNIX ) );
frame->SetTitle( frame->GetScreen()->GetFileName() ); frame->SetTitle( frame->GetScreen()->GetFileName() );
frame->UpdateFileHistory( frame->GetScreen()->GetFileName() ); frame->UpdateFileHistory( frame->GetScreen()->GetFileName() );
frame->OnModify(); // Ready to save the new empty board frame->OnModify(); // Ready to save the new empty board
g_SaveTime = time( NULL ); // Init the time out to save the board
wxString msg; wxString msg;
msg.Printf( _( "File <%s> does not exist.\nThis is normal for a new project" ), msg.Printf( _( "File <%s> does not exist.\nThis is normal for a new project" ),
......
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