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) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 1992-2018 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, GR_KB_CTRL + WXK_F1 );
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 
185  { &g_CommonSectionTag, common_Hotkey_List, &sectionTitle },
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  // wxWidgets handles the Mac Application menu behind the scenes, but that means
203  // we always have to start from scratch with a new wxMenuBar.
204  wxMenuBar* oldMenuBar = GetMenuBar();
205  wxMenuBar* menuBar = new wxMenuBar();
206 
207  // Before deleting, remove the menus managed by m_fileHistory
208  // (the file history will be updated when adding/removing files in history)
209  if( openRecentMenu )
210  PgmTop().GetFileHistory().RemoveMenu( openRecentMenu );
211 
212  // Recreate all menus:
213 
214  // Menu File:
215  wxMenu* fileMenu = new wxMenu;
216 
217  // New project creation
218  wxMenu* newprjSubMenu = new wxMenu();
219  msg = AddHotkeyName( _( "&Project..." ), kicad_Manager_Hokeys_Descr, HK_NEW );
220  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT, msg,
221  _( "Create new blank project" ),
222  KiBitmap( new_project_xpm ) );
223  msg = AddHotkeyName( _( "Project from &Template..." ),
224  kicad_Manager_Hokeys_Descr, HK_NEW_PRJ_TEMPLATE );
225  AddMenuItem( newprjSubMenu, ID_NEW_PROJECT_FROM_TEMPLATE, msg,
226  _( "Create new project from template" ),
227  KiBitmap( new_project_with_template_xpm ) );
228  AddMenuItem( fileMenu, newprjSubMenu,
229  wxID_ANY,
230  _( "&New" ),
231  _( "Create new project" ),
232  KiBitmap( new_project_xpm ) );
233 
234  // Open
235  msg = AddHotkeyName( _( "&Open Project..." ), kicad_Manager_Hokeys_Descr, HK_OPEN );
236  AddMenuItem( fileMenu, ID_LOAD_PROJECT, msg,
237  _( "Open an existing project" ),
238  KiBitmap( open_project_xpm ) );
239 
240  // File history
241  openRecentMenu = new wxMenu();
242  PgmTop().GetFileHistory().UseMenu( openRecentMenu );
243  PgmTop().GetFileHistory().AddFilesToMenu( );
244  AddMenuItem( fileMenu, openRecentMenu,
245  wxID_ANY,
246  _( "Open &Recent" ),
247  _( "Open a recent project" ),
248  KiBitmap( recent_xpm ) );
249 
250  // Currently there is nothing to save
251  // (Kicad manager does not save any info in .pro file)
252 #if 0
253  // Save
254  msg = AddHotkeyName( _( "&Save" ), kicad_Manager_Hokeys_Descr, HK_SAVE );
255  AddMenuItem( fileMenu, ID_SAVE_PROJECT, msg,
256  _( "Save current project" ),
257  KiBitmap( save_project_xpm ) );
258 #endif
259 
260  fileMenu->AppendSeparator();
261  wxMenu* importprjSubMenu = new wxMenu();
262 
263  AddMenuItem( importprjSubMenu, ID_IMPORT_EAGLE_PROJECT, _( "EAGLE CAD..." ),
264  _( "Import EAGLE CAD XML schematic and board" ),
265  KiBitmap( import_project_xpm ) );
266 
267 
268  AddMenuItem( fileMenu, importprjSubMenu,
269  wxID_ANY,
270  _( "Import Project" ),
271  _( "Import project files from other software" ),
272  KiBitmap( import_project_xpm ) );
273 
274 
275  fileMenu->AppendSeparator();
276 
277  // Archive
278  AddMenuItem( fileMenu,
280  _( "&Archive Project..." ),
281  _( "Archive all needed project files into zip archive" ),
282  KiBitmap( zip_xpm ) );
283 
284  // Unarchive
285  AddMenuItem( fileMenu,
287  _( "&Unarchive Project..." ),
288  _( "Unarchive project files from zip archive" ),
289  KiBitmap( unzip_xpm ) );
290 
291  // Separator
292  fileMenu->AppendSeparator();
293 
294  // Quit
295  AddMenuItem( fileMenu,
296  wxID_EXIT,
297  _( "&Exit" ),
298  _( "Close KiCad" ),
299  KiBitmap( exit_xpm ) );
300 
301  // View Menu:
302  wxMenu* viewMenu = new wxMenu();
303 
304  // Refresh project tree
305  msg = AddHotkeyName( _( "&Refresh" ), kicad_Manager_Hokeys_Descr, HK_REFRESH );
306  AddMenuItem( viewMenu, ID_PROJECT_TREE_REFRESH, msg,
307  _( "Refresh project tree" ),
308  KiBitmap( reload_xpm ) );
309 
310 #ifdef __APPLE__
311  viewMenu->AppendSeparator();
312 #endif
313 
314  // Menu Browse:
315  wxMenu* browseMenu = new wxMenu();
316 
317  // Text editor
318  AddMenuItem( browseMenu,
320  _( "Open Text E&ditor" ),
321  _( "Launch preferred text editor" ),
322  KiBitmap( editor_xpm ) );
323 
324  // View file
325  AddMenuItem( browseMenu,
327  _( "&Open Local File..." ),
328  _( "Edit local file" ),
329  KiBitmap( browse_files_xpm ) );
330 
331  // Menu Preferences:
332  wxMenu* preferencesMenu = new wxMenu;
333 
334  // Path configuration edit dialog.
335  AddMenuItem( preferencesMenu,
337  _( "Configure Pa&ths..." ),
338  _( "Edit path configuration environment variables" ),
339  KiBitmap( path_xpm ) );
340 
341  // Text editor
342  AddMenuItem( preferencesMenu,
344  _( "&Set Text Editor..." ),
345  _( "Set your preferred text editor" ),
346  KiBitmap( editor_xpm ) );
347 
348  // PDF Viewer submenu:System browser or user defined checkbox
349  wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
350 
351  // Default
352  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
353  _( "System &Default PDF Viewer" ),
354  _( "Use system default PDF viewer" ),
355  KiBitmap( datasheet_xpm ),
356  wxITEM_CHECK );
357  SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
358  Pgm().UseSystemPdfBrowser() );
359 
360  // Favourite
361  AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
362  _( "&Favorite PDF Viewer" ),
363  _( "Use favorite PDF viewer" ),
364  KiBitmap( datasheet_xpm ),
365  wxITEM_CHECK );
366  SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
367  !Pgm().UseSystemPdfBrowser() );
368 
369  SubMenuPdfBrowserChoice->AppendSeparator();
370  // Append PDF Viewer submenu to preferences
371  AddMenuItem( SubMenuPdfBrowserChoice,
373  _( "Set &PDF Viewer..." ),
374  _( "Set favorite PDF viewer" ),
375  KiBitmap( datasheet_xpm ) );
376 
377  // PDF viewer submenu
378  AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1,
379  _( "&PDF Viewer" ),
380  _( "PDF viewer preferences" ),
381  KiBitmap( datasheet_xpm ) );
382 
383  preferencesMenu->AppendSeparator();
384 
385  // Icons options submenu
386  AddMenuIconsOptions( preferencesMenu );
387 
388  preferencesMenu->AppendSeparator();
389 
390  // Language submenu
391  Pgm().AddMenuLanguageList( preferencesMenu );
392  // Hotkey submenu
393  AddHotkeyConfigMenu( preferencesMenu );
394 
395 
396  // Menu Tools:
397  wxMenu* toolsMenu = new wxMenu;
398 
399  msg = AddHotkeyName( _( "Edit Schematic" ), kicad_Manager_Hokeys_Descr, HK_RUN_EESCHEMA );
400  AddMenuItem( toolsMenu, ID_TO_SCH, msg, KiBitmap( eeschema_xpm ) );
401 
402  msg = AddHotkeyName( _( "Edit Schematic Symbols" ),
403  kicad_Manager_Hokeys_Descr, HK_RUN_LIBEDIT );
404  AddMenuItem( toolsMenu, ID_TO_SCH_LIB_EDITOR, msg, KiBitmap( libedit_xpm ) );
405 
406  msg = AddHotkeyName( _( "Edit PCB Layout" ),
407  kicad_Manager_Hokeys_Descr, HK_RUN_PCBNEW );
408  AddMenuItem( toolsMenu, ID_TO_PCB, msg, KiBitmap( pcbnew_xpm ) );
409 
410  msg = AddHotkeyName( _( "Edit PCB Footprints" ),
411  kicad_Manager_Hokeys_Descr, HK_RUN_FPEDITOR );
412  AddMenuItem( toolsMenu, ID_TO_PCB_FP_EDITOR, msg, KiBitmap( module_editor_xpm ) );
413 
414  msg = AddHotkeyName( _( "View Gerber Files" ),
415  kicad_Manager_Hokeys_Descr, HK_RUN_GERBVIEW );
416  AddMenuItem( toolsMenu, ID_TO_GERBVIEW, msg, KiBitmap( icon_gerbview_small_xpm ) );
417 
418  msg = AddHotkeyName( _( "Convert Image" ),
419  kicad_Manager_Hokeys_Descr, HK_RUN_BM2COMPONENT );
420  AddMenuItem( toolsMenu, ID_TO_BITMAP_CONVERTER, msg,
421  _( "Bitmap2Component - Convert bitmap images to schematic\n"
422  "or PCB elements" ),
423  KiBitmap( bitmap2component_xpm ) );
424 
425  msg = AddHotkeyName( _( "Run PCB Calculator" ), kicad_Manager_Hokeys_Descr, HK_RUN_PCBCALCULATOR );
426  AddMenuItem( toolsMenu, ID_TO_PCB_CALCULATOR, msg,
427  _( "Pcb calculator - Calculator for components, track width, etc." ),
428  KiBitmap( calculator_xpm ) );
429 
430  msg = AddHotkeyName( _( "Edit Page Layout" ), kicad_Manager_Hokeys_Descr, HK_RUN_PLEDITOR );
431  AddMenuItem( toolsMenu, ID_TO_PL_EDITOR, msg,
432  _( "Pl editor - Worksheet layout editor" ),
433  KiBitmap( pagelayout_load_xpm ) );
434 
435  // Menu Help:
436  wxMenu* helpMenu = new wxMenu;
437 
438  // Contents
439  AddMenuItem( helpMenu, wxID_HELP,
440  _( "KiCad &Manual" ),
441  _( "Open KiCad user manual" ),
442  KiBitmap( online_help_xpm ) );
443 
444  AddMenuItem( helpMenu, wxID_INDEX,
445  _( "&Getting Started in KiCad" ),
446  _( "Open \"Getting Started in KiCad\" guide for beginners" ),
447  KiBitmap( help_xpm ) );
448 
449  AddMenuItem( helpMenu,
451  _( "&List Hotkeys" ),
452  _( "Displays the current hotkeys list and corresponding commands" ),
453  KiBitmap( hotkeys_xpm ) );
454 
455  // Separator
456  helpMenu->AppendSeparator();
457 
458  // Get involved with KiCad
460  _( "Get &Involved" ),
461  _( "Contribute to KiCad (opens a web browser)" ),
462  KiBitmap( info_xpm ) );
463 
464  helpMenu->AppendSeparator();
465 
466  // About
467  AddMenuItem( helpMenu, wxID_ABOUT,
468  _( "&About KiCad" ),
469  _( "About KiCad" ),
470  KiBitmap( about_xpm ) );
471 
472  // Create the menubar and append all submenus
473  menuBar->Append( fileMenu, _( "&File" ) );
474  menuBar->Append( viewMenu, _( "&View" ) );
475  menuBar->Append( toolsMenu, _( "&Tools" ) );
476  menuBar->Append( browseMenu, _( "&Browse" ) );
477  menuBar->Append( preferencesMenu, _( "&Preferences" ) );
478  menuBar->Append( helpMenu, _( "&Help" ) );
479 
480  SetMenuBar( menuBar );
481  delete oldMenuBar;
482 
483  // Add the hotkey to the "show hotkey list" menu, because we do not have
484  // a management of the keyboard keys in Kicad.
485  // So all hotheys should be added to the menubar
486  // Note Use wxMenuBar::SetLabel only after the menubar
487  // has been associated with a frame. (see wxWidgets doc)
488  msg = AddHotkeyName( menuBar->GetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST ),
490  menuBar->SetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg );
491 }
492 
493 
498 {
499  if( m_mainToolBar )
500  m_mainToolBar->Clear();
501  else
502  m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
503  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
504 
505  // New
506  m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
507  KiScaledBitmap( new_project_xpm, this ),
508  _( "Create new project" ) );
509 
510  m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
511  KiScaledBitmap( new_project_with_template_xpm, this ),
512  _( "Create new project from template" ) );
513 
514  // Load
515  m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
516  KiScaledBitmap( open_project_xpm, this ),
517  _( "Open existing project" ) );
518 
519  // Currently there is nothing to save
520  // (Kicad manager does not save any info in .pro file)
521 #if 0
522  // Save
523  m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
524  KiScaledBitmap( save_project_xpm, this ),
525  _( "Save current project" ) );
526 #endif
527 
529 
530  // Archive
531  m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
532  KiScaledBitmap( zip_xpm, this ),
533  _( "Archive all project files" ) );
534 
535  // Unarchive
536  m_mainToolBar->AddTool( ID_READ_ZIP_ARCHIVE, wxEmptyString,
537  KiScaledBitmap( unzip_xpm, this ),
538  _( "Unarchive project files from zip archive" ) );
539 
541 
542  // Refresh project tree
543  m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
544  KiScaledBitmap( reload_xpm, this ),
545  _( "Refresh project tree" ) );
546 
547  // Create m_mainToolBar
548  m_mainToolBar->Realize();
549 }
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:174
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
wxBitmap KiScaledBitmap(BITMAP_DEF aBitmap, EDA_BASE_FRAME *aWindow)
Function KiScaledBitmap Constructs a wxBitmap from a memory record, scaling it if device DPI demands ...
Definition: bitmap.cpp:114
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[]
EVT_TOOL(ID_MODVIEW_SELECT_LIB, FOOTPRINT_VIEWER_FRAME::SelectCurrentLibrary) EVT_TOOL(ID_MODVIEW_SELECT_PART
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
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
static EDA_HOTKEY HkHelp(_HKI("Help (this window)"), HK_HELP, GR_KB_CTRL+WXK_F1)
static EDA_HOTKEY HkRunPleditor(_HKI("Run PlEditor"), HK_RUN_PLEDITOR, 'Y'+GR_KB_CTRL, 0)
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
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...
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.
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_HIGH_CONTRAST_MODE
void KiScaledSeparator(wxAuiToolBar *aToolbar, EDA_BASE_FRAME *aWindow)
Function KiScaledSeparator Adds a separator to the given toolbar scaled the same way as KiScaledBitma...
Definition: bitmap.cpp:146
static constexpr int KICAD_AUI_TB_STYLE
Default style flags used for wxAUI toolbars
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:831
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')