PL Editor UI Improvements: Menubar, toolbar and hotkeys
This commit is contained in:
parent
55ce984f05
commit
82ce90ecdc
|
@ -83,7 +83,7 @@ const wxString LegacyFootprintLibPathWildcard( _( "Legacy footprint library file
|
||||||
const wxString EagleFootprintLibPathWildcard( _( "Eagle ver. 6.x XML library files (*.lbr)|*.lbr" ) );
|
const wxString EagleFootprintLibPathWildcard( _( "Eagle ver. 6.x XML library files (*.lbr)|*.lbr" ) );
|
||||||
const wxString GedaPcbFootprintLibFileWildcard( _( "Geda PCB footprint library file (*.fp)|*.fp" ) );
|
const wxString GedaPcbFootprintLibFileWildcard( _( "Geda PCB footprint library file (*.fp)|*.fp" ) );
|
||||||
const wxString ComponentFileExtensionWildcard( _( "Component-footprint link file (*.cmp)|*cmp" ) );
|
const wxString ComponentFileExtensionWildcard( _( "Component-footprint link file (*.cmp)|*cmp" ) );
|
||||||
const wxString PageLayoutDescrFileWildcard( _( "Page layout descr file (*.kicad_wks)|*kicad_wks" ) );
|
const wxString PageLayoutDescrFileWildcard( _( "Page layout design file (*.kicad_wks)|*kicad_wks" ) );
|
||||||
// generic:
|
// generic:
|
||||||
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
|
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,11 @@ void ParseHotkeyConfig( const wxString& data, struct EDA_HOTKEY_CONFIG* aDescLis
|
||||||
// these hotkey ID are used in many files, so they are define here only once.
|
// these hotkey ID are used in many files, so they are define here only once.
|
||||||
enum common_hotkey_id_commnand {
|
enum common_hotkey_id_commnand {
|
||||||
HK_NOT_FOUND = 0,
|
HK_NOT_FOUND = 0,
|
||||||
|
HK_NEW,
|
||||||
|
HK_OPEN,
|
||||||
|
HK_SAVE,
|
||||||
|
HK_SAVEAS,
|
||||||
|
HK_PRINT,
|
||||||
HK_RESET_LOCAL_COORD,
|
HK_RESET_LOCAL_COORD,
|
||||||
HK_SET_GRID_ORIGIN,
|
HK_SET_GRID_ORIGIN,
|
||||||
HK_RESET_GRID_ORIGIN,
|
HK_RESET_GRID_ORIGIN,
|
||||||
|
|
|
@ -62,7 +62,6 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_MENU( wxID_SAVE, PL_EDITOR_FRAME::Files_io )
|
EVT_MENU( wxID_SAVE, PL_EDITOR_FRAME::Files_io )
|
||||||
EVT_MENU( wxID_SAVEAS, PL_EDITOR_FRAME::Files_io )
|
EVT_MENU( wxID_SAVEAS, PL_EDITOR_FRAME::Files_io )
|
||||||
EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
|
EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
|
||||||
EVT_MENU( ID_LOAD_DEFAULT_PAGE_LAYOUT, PL_EDITOR_FRAME::Files_io )
|
|
||||||
EVT_MENU( ID_APPEND_DESCR_FILE, PL_EDITOR_FRAME::Files_io )
|
EVT_MENU( ID_APPEND_DESCR_FILE, PL_EDITOR_FRAME::Files_io )
|
||||||
|
|
||||||
EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter )
|
EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter )
|
||||||
|
|
|
@ -78,7 +78,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_LOAD_DEFAULT_PAGE_LAYOUT:
|
|
||||||
case wxID_NEW:
|
case wxID_NEW:
|
||||||
case wxID_OPEN:
|
case wxID_OPEN:
|
||||||
if( GetScreen()->IsModify() && !IsOK( this,
|
if( GetScreen()->IsModify() && !IsOK( this,
|
||||||
|
@ -94,11 +93,6 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_LOAD_DEFAULT_PAGE_LAYOUT:
|
|
||||||
pglayout.SetPageLayout();
|
|
||||||
OnNewPageLayout();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case wxID_NEW:
|
case wxID_NEW:
|
||||||
pglayout.AllowVoidList( true );
|
pglayout.AllowVoidList( true );
|
||||||
SetCurrFileName( wxEmptyString );
|
SetCurrFileName( wxEmptyString );
|
||||||
|
@ -108,7 +102,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
case ID_APPEND_DESCR_FILE:
|
case ID_APPEND_DESCR_FILE:
|
||||||
{
|
{
|
||||||
wxFileDialog openFileDialog(this, _("Append Page Layout Descr File"),
|
wxFileDialog openFileDialog(this, _("Append Existing Page Layout File"),
|
||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN);
|
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN);
|
||||||
|
|
||||||
|
@ -134,7 +128,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
case wxID_OPEN:
|
case wxID_OPEN:
|
||||||
{
|
{
|
||||||
wxFileDialog openFileDialog(this, _("Open file"), wxEmptyString,
|
wxFileDialog openFileDialog(this, _("Open"), wxEmptyString,
|
||||||
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN);
|
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_OPEN);
|
||||||
|
|
||||||
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
||||||
|
@ -170,7 +164,7 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event )
|
||||||
|
|
||||||
case wxID_SAVEAS:
|
case wxID_SAVEAS:
|
||||||
{
|
{
|
||||||
wxFileDialog openFileDialog(this, _("Create file"), wxEmptyString,
|
wxFileDialog openFileDialog(this, _("Save As"), wxEmptyString,
|
||||||
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_SAVE);
|
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_SAVE);
|
||||||
|
|
||||||
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
||||||
|
|
|
@ -88,17 +88,23 @@ static EDA_HOTKEY HkMoveEndPoint( _HKI( "Move End Point" ), HK_MOVE_END_POINT
|
||||||
static EDA_HOTKEY HkDeleteItem( _HKI( "Delete Item" ), HK_DELETE_ITEM, WXK_DELETE,
|
static EDA_HOTKEY HkDeleteItem( _HKI( "Delete Item" ), HK_DELETE_ITEM, WXK_DELETE,
|
||||||
ID_POPUP_ITEM_DELETE );
|
ID_POPUP_ITEM_DELETE );
|
||||||
|
|
||||||
// Undo Redo
|
// Common: hotkeys_basic.h
|
||||||
static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
|
static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
|
||||||
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
|
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
|
||||||
|
static EDA_HOTKEY HkNew( _HKI( "New" ), HK_NEW, GR_KB_CTRL + 'N', (int) wxID_NEW );
|
||||||
|
static EDA_HOTKEY HkOpen( _HKI( "Open" ), HK_OPEN, GR_KB_CTRL + 'O', (int) wxID_OPEN );
|
||||||
|
static EDA_HOTKEY HkSave( _HKI( "Save" ), HK_SAVE, GR_KB_CTRL + 'S', (int) wxID_SAVE );
|
||||||
|
static EDA_HOTKEY HkSaveAs( _HKI( "Save As" ), HK_SAVEAS, GR_KB_CTRL + GR_KB_SHIFT + 'S', (int) wxID_SAVEAS );
|
||||||
|
static EDA_HOTKEY HkPrint( _HKI( "Print" ), HK_PRINT, GR_KB_CTRL + 'P', (int) wxID_PRINT );
|
||||||
|
|
||||||
// List of common hotkey descriptors
|
// List of common hotkey descriptors
|
||||||
EDA_HOTKEY* s_Common_Hotkey_List[] =
|
EDA_HOTKEY* s_Common_Hotkey_List[] =
|
||||||
{
|
{
|
||||||
&HkHelp,
|
&HkNew, &HkOpen, &HkSave, &HkSaveAs, &HkPrint,
|
||||||
|
&HkUndo, &HkRedo,
|
||||||
&HkZoomIn, &HkZoomOut, &HkZoomRedraw, &HkZoomCenter,
|
&HkZoomIn, &HkZoomOut, &HkZoomRedraw, &HkZoomCenter,
|
||||||
&HkZoomAuto, &HkZoomSelection, &HkResetLocalCoord,
|
&HkZoomAuto, &HkZoomSelection, &HkResetLocalCoord,
|
||||||
&HkUndo, &HkRedo,
|
&HkHelp,
|
||||||
&HkMouseLeftClick,
|
&HkMouseLeftClick,
|
||||||
&HkMouseLeftDClick,
|
&HkMouseLeftDClick,
|
||||||
NULL
|
NULL
|
||||||
|
@ -176,8 +182,29 @@ bool PL_EDITOR_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode,
|
||||||
OnLeftDClick( aDC, aPosition );
|
OnLeftDClick( aDC, aPosition );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HK_HELP: // Display Current hotkey list
|
case HK_NEW:
|
||||||
DisplayHotkeyList( this, PlEditorHokeysDescr );
|
cmd.SetId( wxID_NEW );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HK_OPEN:
|
||||||
|
cmd.SetId( wxID_OPEN );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HK_SAVE:
|
||||||
|
cmd.SetId( wxID_SAVE );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HK_SAVEAS:
|
||||||
|
cmd.SetId( wxID_SAVEAS );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HK_PRINT:
|
||||||
|
cmd.SetId( wxID_PRINT );
|
||||||
|
GetEventHandler()->ProcessEvent( cmd );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HK_UNDO:
|
case HK_UNDO:
|
||||||
|
@ -222,6 +249,10 @@ bool PL_EDITOR_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode,
|
||||||
GetScreen()->m_O_Curseur = GetCrossHairPosition();
|
GetScreen()->m_O_Curseur = GetCrossHairPosition();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HK_HELP: // Display Current hotkey list
|
||||||
|
DisplayHotkeyList( this, PlEditorHokeysDescr );
|
||||||
|
break;
|
||||||
|
|
||||||
case HK_SET_GRID_ORIGIN:
|
case HK_SET_GRID_ORIGIN:
|
||||||
SetGridOrigin( GetCrossHairPosition() );
|
SetGridOrigin( GetCrossHairPosition() );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -40,6 +40,10 @@
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::ReCreateMenuBar()
|
void PL_EDITOR_FRAME::ReCreateMenuBar()
|
||||||
{
|
{
|
||||||
|
wxString msg;
|
||||||
|
static wxMenu* openRecentMenu; // Open Recent submenu,
|
||||||
|
// static to remember this menu
|
||||||
|
|
||||||
// Create and try to get the current menubar
|
// Create and try to get the current menubar
|
||||||
wxMenuBar* menuBar = GetMenuBar();
|
wxMenuBar* menuBar = GetMenuBar();
|
||||||
|
|
||||||
|
@ -50,68 +54,122 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
||||||
// 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();
|
||||||
|
|
||||||
|
// Before deleting, remove the menus managed by m_fileHistory
|
||||||
|
// (the file history will be updated when adding/removing files in history
|
||||||
|
if( openRecentMenu )
|
||||||
|
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
||||||
|
|
||||||
|
// Delete all existing menus
|
||||||
while( menuBar->GetMenuCount() )
|
while( menuBar->GetMenuCount() )
|
||||||
delete menuBar->Remove( 0 );
|
delete menuBar->Remove( 0 );
|
||||||
|
|
||||||
// Recreate all menus:
|
// Recreate all menus:
|
||||||
|
|
||||||
// Menu File:
|
// File Menu:
|
||||||
wxMenu* fileMenu = new wxMenu;
|
wxMenu* fileMenu = new wxMenu;
|
||||||
|
|
||||||
// Load
|
msg = AddHotkeyName( _( "&New" ), PlEditorHokeysDescr, HK_NEW );
|
||||||
AddMenuItem( fileMenu, wxID_NEW,
|
AddMenuItem( fileMenu, wxID_NEW, msg,
|
||||||
_( "&New Page Layout Design" ),
|
_( "Create new page layout design" ),
|
||||||
wxEmptyString, KiBitmap( new_generic_xpm ) );
|
KiBitmap( new_generic_xpm ) );
|
||||||
AddMenuItem( fileMenu, wxID_OPEN,
|
|
||||||
_( "Load Page Layout &File" ),
|
|
||||||
wxEmptyString, KiBitmap( pagelayout_load_xpm ) );
|
|
||||||
AddMenuItem( fileMenu, ID_LOAD_DEFAULT_PAGE_LAYOUT,
|
|
||||||
_( "Load &Default Page Layout" ),
|
|
||||||
wxEmptyString, KiBitmap( pagelayout_load_xpm ) );
|
|
||||||
|
|
||||||
// Recent gerber files
|
msg = AddHotkeyName( _( "&Open..." ), PlEditorHokeysDescr, HK_OPEN );
|
||||||
static wxMenu* openRecentMenu;
|
AddMenuItem( fileMenu, wxID_OPEN, msg,
|
||||||
|
_( "Open an existing page layout design file" ),
|
||||||
// Add this menu to list menu managed by m_fileHistory
|
KiBitmap( pagelayout_load_xpm ) );
|
||||||
// (the file history will be updated when adding/removing files in history
|
|
||||||
if( openRecentMenu )
|
|
||||||
Kiface().GetFileHistory().RemoveMenu( openRecentMenu );
|
|
||||||
|
|
||||||
openRecentMenu = new wxMenu();
|
openRecentMenu = new wxMenu();
|
||||||
|
|
||||||
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
Kiface().GetFileHistory().UseMenu( openRecentMenu );
|
||||||
Kiface().GetFileHistory().AddFilesToMenu();
|
Kiface().GetFileHistory().AddFilesToMenu();
|
||||||
|
|
||||||
AddMenuItem( fileMenu, openRecentMenu,
|
AddMenuItem( fileMenu, openRecentMenu,
|
||||||
wxID_ANY, _( "Open &Recent Page Layout File" ),
|
wxID_ANY,
|
||||||
wxEmptyString, KiBitmap( recent_xpm ) );
|
_( "Open &Recent" ),
|
||||||
|
_( "Open recent page layout design file" ),
|
||||||
|
KiBitmap( recent_xpm ) );
|
||||||
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
// Save current sheet
|
|
||||||
AddMenuItem( fileMenu, wxID_SAVE,
|
|
||||||
_( "&Save Page Layout Design" ),
|
|
||||||
wxEmptyString, KiBitmap( save_xpm ) );
|
|
||||||
|
|
||||||
// Save current sheet as
|
msg = AddHotkeyName( _( "&Save" ), PlEditorHokeysDescr, HK_SAVE );
|
||||||
AddMenuItem( fileMenu, wxID_SAVEAS,
|
AddMenuItem( fileMenu, wxID_SAVE, msg,
|
||||||
_( "Save Page Layout Design &As" ),
|
_( "Save current page layout design file" ),
|
||||||
wxEmptyString, KiBitmap( save_as_xpm ) );
|
KiBitmap( save_xpm ) );
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Save &As" ), PlEditorHokeysDescr, HK_SAVEAS );
|
||||||
|
AddMenuItem( fileMenu, wxID_SAVEAS, msg,
|
||||||
|
_( "Save current page layout design file with a different name" ),
|
||||||
|
KiBitmap( save_as_xpm ) );
|
||||||
|
|
||||||
// Print
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
AddMenuItem( fileMenu, wxID_PRINT, _( "&Print" ),
|
|
||||||
wxEmptyString, KiBitmap( print_button_xpm ) );
|
msg = AddHotkeyName( _( "&Print..." ), PlEditorHokeysDescr, HK_PRINT );
|
||||||
AddMenuItem( fileMenu, wxID_PREVIEW, _( "Print Pre&view" ),
|
AddMenuItem( fileMenu, wxID_PRINT, msg,
|
||||||
|
wxEmptyString, KiBitmap( print_button_xpm ) );
|
||||||
|
|
||||||
|
AddMenuItem( fileMenu, wxID_PREVIEW, _( "Print Pre&view..." ),
|
||||||
wxEmptyString, KiBitmap( print_button_xpm ) );
|
wxEmptyString, KiBitmap( print_button_xpm ) );
|
||||||
|
|
||||||
// Separator
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
|
||||||
// Exit
|
AddMenuItem( fileMenu, wxID_EXIT, _( "&Close" ),
|
||||||
AddMenuItem( fileMenu, wxID_EXIT,
|
_( "Close Page Layout Editor" ), KiBitmap( exit_xpm ) );
|
||||||
_( "&Close" ),
|
|
||||||
_( "&Close Page Layout Editor" ),
|
|
||||||
KiBitmap( exit_xpm ) );
|
// Edit Menu:
|
||||||
|
wxMenu* editMenu = new wxMenu;
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Undo" ), PlEditorHokeysDescr, HK_UNDO );
|
||||||
|
AddMenuItem( editMenu, wxID_UNDO, msg, wxEmptyString, KiBitmap( undo_xpm ) );
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Redo" ), PlEditorHokeysDescr, HK_REDO );
|
||||||
|
AddMenuItem( editMenu, wxID_REDO, msg, wxEmptyString, KiBitmap( redo_xpm ) );
|
||||||
|
|
||||||
|
editMenu->AppendSeparator();
|
||||||
|
|
||||||
|
AddMenuItem( editMenu, wxID_CUT, _( "Delete" ), wxEmptyString, KiBitmap( delete_xpm ) );
|
||||||
|
|
||||||
|
|
||||||
|
// View Menu:
|
||||||
|
wxMenu* viewMenu = new wxMenu;
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Zoom in" ), PlEditorHokeysDescr, HK_ZOOM_IN );
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_IN, msg, wxEmptyString, KiBitmap( zoom_in_xpm ) );
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Zoom out" ), PlEditorHokeysDescr, HK_ZOOM_OUT );
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_OUT, msg, wxEmptyString, KiBitmap( zoom_out_xpm ) );
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Zoom all" ), PlEditorHokeysDescr, HK_ZOOM_AUTO );
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_PAGE, msg, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ) );
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Zoom to selection" ), PlEditorHokeysDescr, HK_ZOOM_SELECTION );
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, msg, wxEmptyString, KiBitmap( zoom_area_xpm ) );
|
||||||
|
|
||||||
|
viewMenu->AppendSeparator();
|
||||||
|
|
||||||
|
msg = AddHotkeyName( _( "Redraw view" ), PlEditorHokeysDescr, HK_ZOOM_REDRAW );
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, msg, wxEmptyString, KiBitmap( zoom_redraw_xpm ) );
|
||||||
|
|
||||||
|
|
||||||
|
// Place Menu:
|
||||||
|
wxMenu* placeMenu = new wxMenu;
|
||||||
|
|
||||||
|
AddMenuItem( placeMenu, ID_POPUP_ITEM_ADD_LINE, _( "&Line..." ),
|
||||||
|
wxEmptyString, KiBitmap( add_dashed_line_xpm ) );
|
||||||
|
|
||||||
|
AddMenuItem( placeMenu, ID_POPUP_ITEM_ADD_RECT, _( "&Rectangle..." ),
|
||||||
|
wxEmptyString, KiBitmap( add_rectangle_xpm ) );
|
||||||
|
|
||||||
|
AddMenuItem( placeMenu, ID_POPUP_ITEM_ADD_TEXT, _( "&Text..." ),
|
||||||
|
wxEmptyString, KiBitmap( text_xpm ) );
|
||||||
|
|
||||||
|
AddMenuItem( placeMenu, ID_POPUP_ITEM_ADD_BITMAP, _( "&Bitmap..." ),
|
||||||
|
wxEmptyString, KiBitmap( image_xpm ) );
|
||||||
|
|
||||||
|
placeMenu->AppendSeparator();
|
||||||
|
|
||||||
|
AddMenuItem( placeMenu, ID_APPEND_DESCR_FILE, _( "&Append Existing Page Layout Design File..." ),
|
||||||
|
_( "Append an existing page layout design file to current file" ),
|
||||||
|
KiBitmap( pagelayout_load_xpm ) );
|
||||||
|
|
||||||
|
|
||||||
// Menu for preferences
|
// Menu for preferences
|
||||||
wxMenu* preferencesMenu = new wxMenu;
|
wxMenu* preferencesMenu = new wxMenu;
|
||||||
|
@ -159,8 +217,8 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
||||||
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
|
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
|
||||||
KiBitmap( help_xpm ) );
|
KiBitmap( help_xpm ) );
|
||||||
|
|
||||||
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
|
msg = AddHotkeyName( _( "&List Hotkeys" ), PlEditorHokeysDescr, HK_HELP );
|
||||||
_( "&List Hotkeys" ),
|
AddMenuItem( helpMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg,
|
||||||
_( "Displays the current hotkeys list and corresponding commands" ),
|
_( "Displays the current hotkeys list and corresponding commands" ),
|
||||||
KiBitmap( hotkeys_xpm ) );
|
KiBitmap( hotkeys_xpm ) );
|
||||||
|
|
||||||
|
@ -182,7 +240,10 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
// Append menus to the menubar
|
// Append menus to the menubar
|
||||||
menuBar->Append( fileMenu, _( "&File" ) );
|
menuBar->Append( fileMenu, _( "&File" ) );
|
||||||
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
||||||
|
menuBar->Append( viewMenu, _( "&View" ) );
|
||||||
|
menuBar->Append( placeMenu, _( "&Place" ) );
|
||||||
|
menuBar->Append( preferencesMenu, _( "P&references" ) );
|
||||||
menuBar->Append( helpMenu, _( "&Help" ) );
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
||||||
|
|
||||||
menuBar->Thaw();
|
menuBar->Thaw();
|
||||||
|
|
|
@ -48,12 +48,11 @@ void AddNewItemsCommand( wxMenu* aMainMenu )
|
||||||
KiBitmap( add_rectangle_xpm ) );
|
KiBitmap( add_rectangle_xpm ) );
|
||||||
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_TEXT, _( "Add Text" ),
|
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_TEXT, _( "Add Text" ),
|
||||||
KiBitmap( text_xpm ) );
|
KiBitmap( text_xpm ) );
|
||||||
AddMenuItem( aMainMenu, ID_POPUP_ITEM_APPEND_PAGE_LAYOUT,
|
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_BITMAP, _( "Add Bitmap" ),
|
||||||
_( "Append Page Layout Descr File" ),
|
|
||||||
KiBitmap( import_xpm ) );
|
|
||||||
AddMenuItem( aMainMenu, ID_POPUP_ITEM_ADD_BITMAP,
|
|
||||||
_( "Add Bitmap" ),
|
|
||||||
KiBitmap( image_xpm ) );
|
KiBitmap( image_xpm ) );
|
||||||
|
AddMenuItem( aMainMenu, ID_POPUP_ITEM_APPEND_PAGE_LAYOUT,
|
||||||
|
_( "Append Existing Page Layout Design File" ),
|
||||||
|
KiBitmap( pagelayout_load_xpm ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare the right-click pullup menu.
|
/* Prepare the right-click pullup menu.
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
wxMessageBox( ioe.What(), _( "Error writing page layout descr file" ) );
|
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public:
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
wxMessageBox( ioe.What(), _( "Error writing page layout descr file" ) );
|
wxMessageBox( ioe.What(), _( "Error writing page layout design file" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ void PL_EDITOR_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||||
{
|
{
|
||||||
if( filename.IsEmpty() )
|
if( filename.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxFileDialog openFileDialog(this, _("Create file"), wxEmptyString,
|
wxFileDialog openFileDialog(this, _("Save As"), wxEmptyString,
|
||||||
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_SAVE);
|
wxEmptyString, PageLayoutDescrFileWildcard, wxFD_SAVE);
|
||||||
|
|
||||||
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
if (openFileDialog.ShowModal() == wxID_CANCEL)
|
||||||
|
|
|
@ -52,7 +52,6 @@ enum pl_editor_ids
|
||||||
ID_SHOW_REAL_MODE,
|
ID_SHOW_REAL_MODE,
|
||||||
ID_SHOW_PL_EDITOR_MODE,
|
ID_SHOW_PL_EDITOR_MODE,
|
||||||
ID_SELECT_COORDINATE_ORIGIN,
|
ID_SELECT_COORDINATE_ORIGIN,
|
||||||
ID_LOAD_DEFAULT_PAGE_LAYOUT,
|
|
||||||
ID_SELECT_PAGE_NUMBER,
|
ID_SELECT_PAGE_NUMBER,
|
||||||
|
|
||||||
ID_APPEND_DESCR_FILE,
|
ID_APPEND_DESCR_FILE,
|
||||||
|
|
|
@ -52,12 +52,13 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void )
|
||||||
_( "New page layout design" ) );
|
_( "New page layout design" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_OPEN, wxEmptyString, KiBitmap( pagelayout_load_xpm ),
|
m_mainToolBar->AddTool( wxID_OPEN, wxEmptyString, KiBitmap( pagelayout_load_xpm ),
|
||||||
_( "Load a page layout file. Previous data will be deleted" ) );
|
_( "Open an existing page layout design file" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_project_xpm ),
|
m_mainToolBar->AddTool( wxID_SAVE, wxEmptyString, KiBitmap( save_project_xpm ),
|
||||||
_( "Save page layout design" ) );
|
_( "Save page layout design" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
|
|
||||||
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiBitmap( sheetset_xpm ),
|
m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiBitmap( sheetset_xpm ),
|
||||||
_( "Page settings" ) );
|
_( "Page settings" ) );
|
||||||
|
|
||||||
|
@ -65,14 +66,17 @@ void PL_EDITOR_FRAME::ReCreateHToolbar( void )
|
||||||
_( "Print page layout" ) );
|
_( "Print page layout" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( delete_xpm ),
|
m_mainToolBar->AddTool( wxID_CUT, wxEmptyString, KiBitmap( delete_xpm ),
|
||||||
_( "Delete selected item" ) );
|
_( "Delete selected item" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString,
|
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString,
|
||||||
KiBitmap( undo_xpm ), wxEmptyString );
|
KiBitmap( undo_xpm ), _( "Undo" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString,
|
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString,
|
||||||
KiBitmap( redo_xpm ), wxEmptyString );
|
KiBitmap( redo_xpm ), _( "Redo" ) );
|
||||||
|
|
||||||
// Standard Zoom controls:
|
// Standard Zoom controls:
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
|
|
Loading…
Reference in New Issue