KiCad PCB EDA Suite
kicad/menubar.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
32 #include <bitmaps.h>
33 #include <hotkeys_basic.h>
34 #include <menus_helpers.h>
35 
36 #include "kicad.h"
37 #include "pgm_kicad.h"
38 
39 
40 // Menubar and toolbar event table
41 BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
42  // Window events
43  EVT_SIZE( KICAD_MANAGER_FRAME::OnSize )
44  EVT_CLOSE( KICAD_MANAGER_FRAME::OnCloseWindow )
45 
46  // Toolbar events
48  EVT_TOOL( ID_NEW_PROJECT_FROM_TEMPLATE, KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate )
50 
51  // Menu events
53  EVT_MENU( wxID_EXIT, KICAD_MANAGER_FRAME::OnExit )
54  EVT_MENU( ID_TO_TEXT_EDITOR, KICAD_MANAGER_FRAME::OnOpenTextEditor )
55  EVT_MENU( ID_BROWSE_AN_SELECT_FILE, KICAD_MANAGER_FRAME::OnOpenFileInTextEditor )
57  EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor )
58  EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser )
59  EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
61  KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
65  EVT_MENU( wxID_HELP, KICAD_MANAGER_FRAME::GetKicadHelp )
66  EVT_MENU( wxID_INDEX, KICAD_MANAGER_FRAME::GetKicadHelp )
67  EVT_MENU( ID_HELP_GET_INVOLVED, KICAD_MANAGER_FRAME::GetKicadContribute )
68  EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout )
70 
71  // Range menu events
73  KICAD_MANAGER_FRAME::language_change )
74 
75  EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory )
76 
77  // Hotkey management (show list, edit ...) events
79  KICAD_MANAGER_FRAME::Process_Config )
80 
81 
82  // Special functions
83  EVT_MENU( ID_INIT_WATCHED_PATHS, KICAD_MANAGER_FRAME::OnChangeWatchedPaths )
84 
85  // Button events (in command frame), and menu events equivalent to buttons
86  EVT_BUTTON( ID_TO_SCH, KICAD_MANAGER_FRAME::OnRunEeschema )
87  EVT_MENU( ID_TO_SCH, KICAD_MANAGER_FRAME::OnRunEeschema )
88 
89  EVT_BUTTON( ID_TO_SCH_LIB_EDITOR, KICAD_MANAGER_FRAME::OnRunSchLibEditor )
90  EVT_MENU( ID_TO_SCH_LIB_EDITOR, KICAD_MANAGER_FRAME::OnRunSchLibEditor )
91 
92  EVT_BUTTON( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew )
93  EVT_MENU( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew )
94 
95  EVT_BUTTON( ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnRunPcbFpEditor )
96  EVT_MENU( ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnRunPcbFpEditor )
97 
98  EVT_BUTTON( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview )
99  EVT_MENU( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview )
100 
101  EVT_BUTTON( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter )
102  EVT_MENU( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter )
103 
104  EVT_BUTTON( ID_TO_PCB_CALCULATOR, KICAD_MANAGER_FRAME::OnRunPcbCalculator )
105  EVT_MENU( ID_TO_PCB_CALCULATOR, KICAD_MANAGER_FRAME::OnRunPcbCalculator )
106 
107  EVT_BUTTON( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor )
108  EVT_MENU( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor )
109 
111  KICAD_MANAGER_FRAME::OnChangeIconsOptions )
112 
113  EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser )
114  EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER,
115  KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser )
116  EVT_UPDATE_UI_RANGE( ID_TO_SCH, ID_TO_PCB_FP_EDITOR,
117  KICAD_MANAGER_FRAME::OnUpdateRequiresProject )
118 
119 END_EVENT_TABLE()
120 
122 {
133 };
134 
136 
137 // Remark: the hotkey message info is used as keyword in hotkey config files and
138 // as comments in help windows, therefore translated only when displayed
139 // they are marked _HKI to be extracted by translation tools
140 // See hotkeys_basic.h for more info
141 
142 // hotkeys command:
143 static EDA_HOTKEY HkNewProjectFromTemplate( _HKI( "New Project From Template" ),
145 static EDA_HOTKEY HkRefresh( _HKI( "Refresh Project Tree" ), HK_REFRESH, GR_KB_CTRL + 'R' );
146 static EDA_HOTKEY HkRunEeschema( _HKI( "Run Eeschema" ), HK_RUN_EESCHEMA, 'E' + GR_KB_CTRL, 0 );
147 static EDA_HOTKEY HkRunLibedit( _HKI( "Run LibEdit" ), HK_RUN_LIBEDIT, 'L' + GR_KB_CTRL, 0 );
148 static EDA_HOTKEY HkRunPcbnew( _HKI( "Run Pcbnew" ), HK_RUN_PCBNEW, 'P' + GR_KB_CTRL, 0 );
149 static EDA_HOTKEY HkRunModedit( _HKI( "Run FpEditor" ), HK_RUN_FPEDITOR, 'F' + GR_KB_CTRL, 0 );
150 static EDA_HOTKEY HkRunGerbview( _HKI( "Run Gerbview" ), HK_RUN_GERBVIEW, 'G' + GR_KB_CTRL, 0 );
151 static EDA_HOTKEY HkRunBm2Cmp( _HKI( "Run Bitmap2Component" ),
152  HK_RUN_BM2COMPONENT, 'B' + GR_KB_CTRL, 0 );
153 static EDA_HOTKEY HkRunPcbCalc( _HKI( "Run PcbCalculator" ),
154  HK_RUN_PCBCALCULATOR, 'A' + GR_KB_CTRL, 0 );
155 static EDA_HOTKEY HkRunPleditor( _HKI( "Run PlEditor" ), HK_RUN_PLEDITOR, 'Y' + GR_KB_CTRL, 0 );
156 
157 // Common: hotkeys_basic.h
158 static EDA_HOTKEY HkNewProject( _HKI( "New Project" ), HK_NEW, GR_KB_CTRL + 'N' );
159 static EDA_HOTKEY HkOpenProject( _HKI( "Open Project" ), HK_OPEN, GR_KB_CTRL + 'O' );
160 static EDA_HOTKEY HkSaveProject( _HKI( "Save Project" ), HK_SAVE, GR_KB_CTRL + 'S' );
161 static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
162 
163 // List of hotkey descriptors
165 {
167  // Currently there is nothing to save
168  // (Kicad manager does not save any info in .pro file)
169 #if 0
170  &HkSaveProject,
171 #endif
172  &HkRefresh, &HkHelp,
176  NULL
177 };
178 
179 // list of sections and corresponding hotkey list for Kicad
180 // (used to create an hotkey config file, and edit hotkeys )
181 // here we have only one section.
182 static wxString sectionTitle( _HKI( "Kicad Manager Hotkeys" ) );
183 
186  { NULL, NULL, NULL }
187 };
189 
190 
195 {
196  wxString msg;
197  static wxMenu* openRecentMenu; // Open Recent submenu,
198  // static to remember this menu
199 
201 
202  // Create and try to get the current menubar
203  wxMenuBar* menuBar = GetMenuBar();
204 
205  if( !menuBar )
206  menuBar = new wxMenuBar();
207 
208  // Delete all existing menus so they can be rebuilt.
209  // This allows language changes of the menu text on the fly.
210  menuBar->Freeze();
211 
212  // Before deleting, remove the menus managed by m_fileHistory
213  // (the file history will be updated when adding/removing files in history)
214  if( openRecentMenu )
215  PgmTop().GetFileHistory().RemoveMenu( openRecentMenu );
216 
217  // Delete all existing menus
218  while( menuBar->GetMenuCount() )
219  delete menuBar->Remove( 0 );
220 
221  // Recreate all menus:
222 
223  // Menu File:
224  wxMenu* fileMenu = new wxMenu;
225 
226  // New project creation
227  wxMenu* newprjSubMenu = new wxMenu();
228  msg = AddHotkeyName( _( "&Project..." ), kicad_Manager_Hokeys_Descr, HK_NEW );
229  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT, msg,
230  _( "Create new blank project" ),
231  KiBitmap( new_project_xpm ) );
232  msg = AddHotkeyName( _( "Project from &Template..." ),
233  kicad_Manager_Hokeys_Descr, HK_NEW_PRJ_TEMPLATE );
234  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT_FROM_TEMPLATE, msg,
235  _( "Create new project from template" ),
236  KiBitmap( new_project_with_template_xpm ) );
237  AddMenuItem( fileMenu, newprjSubMenu,
238  wxID_ANY,
239  _( "&New" ),
240  _( "Create new project" ),
241  KiBitmap( new_project_xpm ) );
242 
243  // Open
244  msg = AddHotkeyName( _( "&Open Project..." ), kicad_Manager_Hokeys_Descr, HK_OPEN );
245  AddMenuItem( fileMenu, ID_LOAD_PROJECT, msg,
246  _( "Open an existing project" ),
247  KiBitmap( open_project_xpm ) );
248 
249  // File history
250  openRecentMenu = new wxMenu();
251  PgmTop().GetFileHistory().UseMenu( openRecentMenu );
252  PgmTop().GetFileHistory().AddFilesToMenu( );
253  AddMenuItem( fileMenu, openRecentMenu,
254  wxID_ANY,
255  _( "Open &Recent" ),
256  _( "Open a recent project" ),
257  KiBitmap( recent_xpm ) );
258 
259  // Currently there is nothing to save
260  // (Kicad manager does not save any info in .pro file)
261 #if 0
262  // Save
263  msg = AddHotkeyName( _( "&Save" ), kicad_Manager_Hokeys_Descr, HK_SAVE );
264  AddMenuItem( fileMenu, ID_SAVE_PROJECT, msg,
265  _( "Save current project" ),
266  KiBitmap( save_project_xpm ) );
267 #endif
268 
269  fileMenu->AppendSeparator();
270  wxMenu* importprjSubMenu = new wxMenu();
271 
272  AddMenuItem( importprjSubMenu, ID_IMPORT_EAGLE_PROJECT, _( "Eagle CAD" ),
273  _( "Import Eagle CAD XML schematic and board" ),
274  KiBitmap( new_project_xpm ) );
275 
276 
277  AddMenuItem( fileMenu, importprjSubMenu,
278  wxID_ANY,
279  _( "Import Project" ),
280  _( "Import project files from other software" ),
281  KiBitmap( new_project_xpm ) );
282 
283 
284  fileMenu->AppendSeparator();
285 
286  // Archive
287  AddMenuItem( fileMenu,
289  _( "&Archive Project..." ),
290  _( "Archive all needed project files into zip archive" ),
291  KiBitmap( zip_xpm ) );
292 
293  // Unarchive
294  AddMenuItem( fileMenu,
296  _( "&Unarchive Project..." ),
297  _( "Unarchive project files from zip archive" ),
298  KiBitmap( unzip_xpm ) );
299 
300  // Separator
301  fileMenu->AppendSeparator();
302 
303  // Quit
304  AddMenuItem( fileMenu,
305  wxID_EXIT,
306  _( "&Close" ),
307  _( "Close KiCad" ),
308  KiBitmap( exit_xpm ) );
309 
310  // View Menu:
311  wxMenu* viewMenu = new wxMenu();
312 
313  // Refresh project tree
314  msg = AddHotkeyName( _( "&Refresh" ), kicad_Manager_Hokeys_Descr, HK_REFRESH );
315  AddMenuItem( viewMenu, ID_PROJECT_TREE_REFRESH, msg,
316  _( "Refresh project tree" ),
317  KiBitmap( reload_xpm ) );
318 
319  // Menu Browse:
320  wxMenu* browseMenu = new wxMenu();
321 
322  // Text editor
323  AddMenuItem( browseMenu,
325  _( "Open Text E&ditor" ),
326  _( "Launch preferred text editor" ),
327  KiBitmap( editor_xpm ) );
328 
329  // View file
330  AddMenuItem( browseMenu,
332  _( "&Open Local File" ),
333  _( "Edit local file" ),
334  KiBitmap( browse_files_xpm ) );
335 
336  // Menu Preferences:
337  wxMenu* preferencesMenu = new wxMenu;
338 
339  // Path configuration edit dialog.
340  AddMenuItem( preferencesMenu,
342  _( "Configure Pa&ths" ),
343  _( "Edit path configuration environment variables" ),
344  KiBitmap( path_xpm ) );
345 
346  // Text editor
347  AddMenuItem( preferencesMenu,
349  _( "&Set Text Editor" ),
350  _( "Set your preferred text editor" ),
351  KiBitmap( editor_xpm ) );
352 
353  // PDF Viewer submenu:System browser or user defined checkbox
354  wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
355 
356  // Default
357  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
358  _( "System &Default PDF Viewer" ),
359  _( "Use system default PDF viewer" ),
360  KiBitmap( datasheet_xpm ),
361  wxITEM_CHECK );
362  SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
363  Pgm().UseSystemPdfBrowser() );
364 
365  // Favourite
366  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
367  _( "&Favourite PDF Viewer" ),
368  _( "Use favourite PDF viewer" ),
369  KiBitmap( datasheet_xpm ),
370  wxITEM_CHECK );
371  SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
372  !Pgm().UseSystemPdfBrowser() );
373 
374  SubMenuPdfBrowserChoice->AppendSeparator();
375  // Append PDF Viewer submenu to preferences
376  AddMenuItem( SubMenuPdfBrowserChoice,
378  _( "Set &PDF Viewer" ),
379  _( "Set favourite PDF viewer" ),
380  KiBitmap( datasheet_xpm ) );
381 
382  // PDF viewer submenu
383  AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1,
384  _( "&PDF Viewer" ),
385  _( "PDF viewer preferences" ),
386  KiBitmap( datasheet_xpm ) );
387 
388  // Hotkey submenu
389  preferencesMenu->AppendSeparator();
390  AddHotkeyConfigMenu( preferencesMenu );
391 
392  // Language submenu
393  preferencesMenu->AppendSeparator();
394  Pgm().AddMenuLanguageList( preferencesMenu );
395 
396  // Icons options submenu
397  preferencesMenu->AppendSeparator();
398  AddMenuIconsOptions( preferencesMenu );
399 
400  // Menu Tools:
401  wxMenu* toolsMenu = new wxMenu;
402 
403  msg = AddHotkeyName( _( "Edit Schematic" ), kicad_Manager_Hokeys_Descr, HK_RUN_EESCHEMA );
404  AddMenuItem( toolsMenu, ID_TO_SCH, msg, KiBitmap( eeschema_xpm ) );
405 
406  msg = AddHotkeyName( _( "Manage Symbol Libraries" ),
407  kicad_Manager_Hokeys_Descr, HK_RUN_LIBEDIT );
408  AddMenuItem( toolsMenu, ID_TO_SCH_LIB_EDITOR, msg, KiBitmap( libedit_xpm ) );
409 
410  msg = AddHotkeyName( _( "Edit PCB Layout" ),
411  kicad_Manager_Hokeys_Descr, HK_RUN_PCBNEW );
412  AddMenuItem( toolsMenu, ID_TO_PCB, msg, KiBitmap( pcbnew_xpm ) );
413 
414  msg = AddHotkeyName( _( "Edit PCB Footprint" ),
415  kicad_Manager_Hokeys_Descr, HK_RUN_FPEDITOR );
416  AddMenuItem( toolsMenu, ID_TO_PCB_FP_EDITOR, msg, KiBitmap( module_editor_xpm ) );
417 
418  msg = AddHotkeyName( _( "View Gerber Files" ),
419  kicad_Manager_Hokeys_Descr, HK_RUN_GERBVIEW );
420  AddMenuItem( toolsMenu, ID_TO_GERBVIEW, msg, KiBitmap( icon_gerbview_small_xpm ) );
421 
422  msg = AddHotkeyName( _( "Convert Image" ),
423  kicad_Manager_Hokeys_Descr, HK_RUN_BM2COMPONENT );
424  AddMenuItem( toolsMenu, ID_TO_BITMAP_CONVERTER, msg,
425  _( "Bitmap2Component - Convert bitmap images to Eeschema\n"
426  "or Pcbnew elements" ),
427  KiBitmap( image_xpm ) );
428 
429  msg = AddHotkeyName( _( "Run PCB Calculator" ), kicad_Manager_Hokeys_Descr, HK_RUN_PCBCALCULATOR );
430  AddMenuItem( toolsMenu, ID_TO_PCB_CALCULATOR, msg,
431  _( "Pcb calculator - Calculator for components, track width, etc." ),
432  KiBitmap( pcbcalculator_xpm ) );
433 
434  msg = AddHotkeyName( _( "Edit Page Layout" ), kicad_Manager_Hokeys_Descr, HK_RUN_PLEDITOR );
435  AddMenuItem( toolsMenu, ID_TO_PL_EDITOR, msg,
436  _( "Pl editor - Worksheet layout editor" ),
437  KiBitmap( pagelayout_load_xpm ) );
438 
439  // Menu Help:
440  wxMenu* helpMenu = new wxMenu;
441 
442  // Contents
443  AddMenuItem( helpMenu, wxID_HELP,
444  _( "KiCad &Manual" ),
445  _( "Open KiCad user manual" ),
446  KiBitmap( online_help_xpm ) );
447 
448  AddMenuItem( helpMenu, wxID_INDEX,
449  _( "&Getting Started in KiCad" ),
450  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
451  KiBitmap( help_xpm ) );
452 
453  AddMenuItem( helpMenu,
455  _( "&List Hotkeys" ),
456  _( "Displays the current hotkeys list and corresponding commands" ),
457  KiBitmap( hotkeys_xpm ) );
458 
459  // Separator
460  helpMenu->AppendSeparator();
461 
462  // Get involved with KiCad
464  _( "Get &Involved" ),
465  _( "Contribute to KiCad (opens a web browser)" ),
466  KiBitmap( info_xpm ) );
467 
468  helpMenu->AppendSeparator();
469 
470  // About
471  AddMenuItem( helpMenu, wxID_ABOUT,
472  _( "&About KiCad" ),
473  _( "About KiCad" ),
474  KiBitmap( about_xpm ) );
475 
476  // Create the menubar and append all submenus
477  menuBar->Append( fileMenu, _( "&File" ) );
478  menuBar->Append( viewMenu, _( "&View" ) );
479  menuBar->Append( toolsMenu, _( "&Tools" ) );
480  menuBar->Append( browseMenu, _( "&Browse" ) );
481  menuBar->Append( preferencesMenu, _( "&Preferences" ) );
482  menuBar->Append( helpMenu, _( "&Help" ) );
483 
484  menuBar->Thaw();
485 
486  // Associate the menu bar with the frame, if no previous menubar
487  if( GetMenuBar() == NULL )
488  SetMenuBar( menuBar );
489  else
490  menuBar->Refresh();
491 
492  // Add the hotkey to the "show hotkey list" menu, because we do not have
493  // a management of the keyboard keys in Kicad.
494  // So all hotheys should be added to the menubar
495  // Note Use wxMenuBar::SetLabel only after the menubar
496  // has been associated with a frame. (see wxWidgets doc)
497  msg = AddHotkeyName( menuBar->GetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST ),
499  menuBar->SetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg );
500 }
501 
502 
507 {
508  // Check if toolbar is not already created
509  if( m_mainToolBar != NULL )
510  return;
511 
512  // Allocate memory for m_mainToolBar
513  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
514  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
515 
516  // New
517  m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
518  KiBitmap( new_project_xpm ),
519  _( "Create new project" ) );
520 
521  m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
522  KiBitmap( new_project_with_template_xpm ),
523  _( "Create new project from template" ) );
524 
525  // Load
526  m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
527  KiBitmap( open_project_xpm ),
528  _( "Open existing project" ) );
529 
530  // Currently there is nothing to save
531  // (Kicad manager does not save any info in .pro file)
532 #if 0
533  // Save
534  m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
535  KiBitmap( save_project_xpm ),
536  _( "Save current project" ) );
537 #endif
538 
539  // Separator
540  m_mainToolBar->AddSeparator();
541 
542  // Archive
543  m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
544  KiBitmap( zip_xpm ),
545  _( "Archive all project files" ) );
546 
547  // Unarchive
548  m_mainToolBar->AddTool( ID_READ_ZIP_ARCHIVE, wxEmptyString,
549  KiBitmap( unzip_xpm ),
550  _( "Unarchive project files from zip archive" ) );
551 
552  // Separator
553  m_mainToolBar->AddSeparator();
554 
555  // Refresh project tree
556  m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
557  KiBitmap( reload_xpm ),
558  _( "Refresh project tree" ) );
559 
560  // Create m_mainToolBar
561  m_mainToolBar->Realize();
562 }
ID_LANGUAGE_CHOICE_END
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:87
static EDA_HOTKEY HkRunPcbnew(_HKI("Run Pcbnew"), HK_RUN_PCBNEW, 'P'+GR_KB_CTRL, 0)
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
static EDA_HOTKEY HkHelp(_HKI("Help (this window)"), HK_HELP, '?')
KICAD_MANAGER_FRAME::language_change EVT_MENU_RANGE(ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, KICAD_MANAGER_FRAME::Process_Config) EVT_MENU_RANGE(ID_KICAD_SELECT_ICONS_OPTIONS
static EDA_HOTKEY HkRunGerbview(_HKI("Run Gerbview"), HK_RUN_GERBVIEW, 'G'+GR_KB_CTRL, 0)
static EDA_HOTKEY HkSaveProject(_HKI("Save Project"), HK_SAVE, GR_KB_CTRL+ 'S')
static EDA_HOTKEY HkNewProject(_HKI("New Project"), HK_NEW, GR_KB_CTRL+ 'N')
static EDA_HOTKEY HkRunPcbCalc(_HKI("Run PcbCalculator"), HK_RUN_PCBCALCULATOR, 'A'+GR_KB_CTRL, 0)
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard EVT_UPDATE_UI_RANGE(ID_MODEDIT_PAD_TOOL, ID_MODEDIT_MEASUREMENT_TOOL, FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH
static EDA_HOTKEY HkRunEeschema(_HKI("Run Eeschema"), HK_RUN_EESCHEMA, 'E'+GR_KB_CTRL, 0)
static EDA_HOTKEY HkRunBm2Cmp(_HKI("Run Bitmap2Component"), HK_RUN_BM2COMPONENT, 'B'+GR_KB_CTRL, 0)
static EDA_HOTKEY HkOpenProject(_HKI("Open Project"), HK_OPEN, GR_KB_CTRL+ 'O')
struct EDA_HOTKEY_CONFIG kicad_Manager_Hokeys_Descr[]
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
hotkey_id_commnand
KICAD_MANAGER_FRAME::language_change ID_KICAD_SELECT_ICON_OPTIONS_END
KICAD_MANAGER_FRAME is the KiCad main frame.
EDA_HOTKEY_CONFIG * m_manager_Hokeys_Descr
Definition: kicad.h:310
EDA_HOTKEY * common_Hotkey_List[]
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser) EVT_MENU_RANGE(ID_LANGUAGE_CHOICE
static EDA_HOTKEY HkRunLibedit(_HKI("Run LibEdit"), HK_RUN_LIBEDIT, 'L'+GR_KB_CTRL, 0)
static EDA_HOTKEY HkNewProjectFromTemplate(_HKI("New Project From Template"), HK_NEW_PRJ_TEMPLATE, 'T'+GR_KB_CTRL)
static EDA_HOTKEY HkRunModedit(_HKI("Run FpEditor"), HK_RUN_FPEDITOR, 'F'+GR_KB_CTRL, 0)
void RecreateBaseHToolbar()
(Re)Create the horizontal toolbar
EVT_TOOL(ID_FOOTPRINT_WIZARD_SELECT_WIZARD, FOOTPRINT_WIZARD_FRAME::SelectCurrentWizard) EVT_TOOL(ID_FOOTPRINT_WIZARD_RESET_TO_DEFAULT
static EDA_HOTKEY HkRunPleditor(_HKI("Run PlEditor"), HK_RUN_PLEDITOR, 'Y'+GR_KB_CTRL, 0)
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:145
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
ID_PREFERENCES_HOTKEY_END
static wxString sectionTitle(_HKI("Kicad Manager Hotkeys"))
void AddHotkeyConfigMenu(wxMenu *aMenu)
void AddMenuIconsOptions(wxMenu *MasterMenu)
Function AddMenuIconsOptions creates a menu list for icons in menu and icon sizes choice...
Definition: basicframe.cpp:692
wxString AddHotkeyName(const wxString &aText, EDA_HOTKEY **aList, int aCommandId, HOTKEY_ACTION_TYPE aShortCutType)
Function AddHotkeyName Add the key name from the Command id value ( m_Idcommand member value) ...
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
void ReCreateMenuBar() override
(Re)Create the menubar
KICAD_MANAGER_FRAME::language_change KICAD_MANAGER_FRAME::OnChangeIconsOptions EVT_UPDATE_UI(ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser) EVT_UPDATE_UI_RANGE(ID_TO_SCH
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
Definition: wxstruct.h:168
VTBL_ENTRY void AddMenuLanguageList(wxMenu *MasterMenu)
Function AddMenuLanguageList creates a menu list for language choice, and add it as submenu to Master...
Definition: pgm_base.cpp:824
Some functions to handle hotkeys in KiCad.
wxString g_CommonSectionTag
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
#define GR_KB_CTRL
Definition: common.h:64
KICAD_MANAGER_FRAME::language_change KICAD_MANAGER_FRAME::OnChangeIconsOptions ID_TO_PCB_FP_EDITOR
#define _HKI(x)
The main KiCad project manager frame.
Definition: kicad.h:137
static EDA_HOTKEY HkRefresh(_HKI("Refresh Project Tree"), HK_REFRESH, GR_KB_CTRL+ 'R')