2011-10-18 19:59:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-03-02 17:29:18 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 2009-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-18 19:59:19 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-12-14 15:56:30 +00:00
|
|
|
* @file kicad/menubar.cpp
|
2011-04-06 13:52:47 +00:00
|
|
|
* @brief (Re)Create the project manager menubar for KiCad
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <pgm_kicad.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <kicad.h>
|
2012-04-09 09:16:47 +00:00
|
|
|
#include <menus_helpers.h>
|
2013-01-01 14:06:49 +00:00
|
|
|
#include <tree_project_frame.h>
|
2015-03-02 17:29:18 +00:00
|
|
|
#include <hotkeys_basic.h>
|
2011-09-01 12:54:34 +00:00
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
// Menubar and toolbar event table
|
2011-04-17 13:54:17 +00:00
|
|
|
BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
// Window events
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_SIZE( KICAD_MANAGER_FRAME::OnSize )
|
|
|
|
EVT_CLOSE( KICAD_MANAGER_FRAME::OnCloseWindow )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
// Toolbar events
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_TOOL( ID_NEW_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject )
|
2014-09-06 19:55:20 +00:00
|
|
|
EVT_TOOL( ID_NEW_PROJECT_FROM_TEMPLATE, KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_TOOL( ID_LOAD_PROJECT, KICAD_MANAGER_FRAME::OnLoadProject )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
// Menu events
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( ID_SAVE_PROJECT, KICAD_MANAGER_FRAME::OnSaveProject )
|
|
|
|
EVT_MENU( wxID_EXIT, KICAD_MANAGER_FRAME::OnExit )
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
EVT_MENU( ID_TO_TEXT_EDITOR, KICAD_MANAGER_FRAME::OnOpenTextEditor )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE, KICAD_MANAGER_FRAME::OnOpenFileInTextEditor )
|
2015-03-29 21:22:53 +00:00
|
|
|
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, KICAD_MANAGER_FRAME::OnConfigurePaths )
|
2011-04-13 19:30:27 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser )
|
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
|
2011-10-18 19:59:19 +00:00
|
|
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
|
|
|
KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( ID_SAVE_AND_ZIP_FILES, KICAD_MANAGER_FRAME::OnArchiveFiles )
|
|
|
|
EVT_MENU( ID_READ_ZIP_ARCHIVE, KICAD_MANAGER_FRAME::OnUnarchiveFiles )
|
|
|
|
EVT_MENU( ID_PROJECT_TREE_REFRESH, KICAD_MANAGER_FRAME::OnRefresh )
|
|
|
|
EVT_MENU( wxID_HELP, KICAD_MANAGER_FRAME::GetKicadHelp )
|
2011-08-04 18:03:26 +00:00
|
|
|
EVT_MENU( wxID_INDEX, KICAD_MANAGER_FRAME::GetKicadHelp )
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU( wxID_ABOUT, KICAD_MANAGER_FRAME::GetKicadAbout )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY. Now any major
frame with a "change language" menu can change the language for all KIWAY_PLAYERs
in the whole KIWAY. Multiple KIWAYs are not supported yet.
*) Simplify "modal wxFrame" support, and add that support exclusively to
KIWAY_PLAYER where it is inherited by all derivatives. The function
KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.
*) Remove the requirements and assumptions that the wxFrame hierarchy always
had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
and editors. This is no longer the case, nor required.
*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
quickly. It also gives control to the KIWAY as to frame hierarchical
relationships.
*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
the single KIWAY_PLAYER, see bullet immediately above.
*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
gives the KIFACEs a chance to save their final configuration dope to disk.
*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
these modal frames are distinctly different than their non-modal equivalents.
KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
so this is another important reason for having a dedicated FRAME_T for each
modal wxFrame.
On balance, more lines were deleted than were added to achieve all this.
2014-05-03 17:40:19 +00:00
|
|
|
// Range menu events
|
|
|
|
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, KICAD_MANAGER_FRAME::language_change )
|
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, KICAD_MANAGER_FRAME::OnFileHistory )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// Hotkey management (show list, edit ...) events
|
|
|
|
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END,
|
|
|
|
KICAD_MANAGER_FRAME::Process_Config )
|
|
|
|
|
|
|
|
|
2013-01-01 14:06:49 +00:00
|
|
|
// Special functions
|
|
|
|
EVT_MENU( ID_INIT_WATCHED_PATHS, KICAD_MANAGER_FRAME::OnChangeWatchedPaths )
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// Button events (in command frame), and menu events equivalent to buttons
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
EVT_BUTTON( ID_TO_SCH, KICAD_MANAGER_FRAME::OnRunEeschema )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_SCH, KICAD_MANAGER_FRAME::OnRunEeschema )
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
EVT_BUTTON( ID_TO_SCH_LIB_EDITOR, KICAD_MANAGER_FRAME::OnRunSchLibEditor )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_SCH_LIB_EDITOR, KICAD_MANAGER_FRAME::OnRunSchLibEditor )
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
|
|
|
EVT_BUTTON( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_PCB, KICAD_MANAGER_FRAME::OnRunPcbNew )
|
|
|
|
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
EVT_BUTTON( ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnRunPcbFpEditor )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnRunPcbFpEditor )
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_BUTTON( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_GERBVIEW, KICAD_MANAGER_FRAME::OnRunGerbview )
|
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_BUTTON( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_BITMAP_CONVERTER, KICAD_MANAGER_FRAME::OnRunBitmapConverter )
|
|
|
|
|
2011-08-05 19:53:42 +00:00
|
|
|
EVT_BUTTON( ID_TO_PCB_CALCULATOR, KICAD_MANAGER_FRAME::OnRunPcbCalculator )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_PCB_CALCULATOR, KICAD_MANAGER_FRAME::OnRunPcbCalculator )
|
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
EVT_BUTTON( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor )
|
2015-03-02 17:29:18 +00:00
|
|
|
EVT_MENU( ID_TO_PL_EDITOR, KICAD_MANAGER_FRAME::OnRunPageLayoutEditor )
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2011-04-17 13:54:17 +00:00
|
|
|
EVT_UPDATE_UI( ID_SELECT_DEFAULT_PDF_BROWSER, KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser )
|
2011-10-18 19:59:19 +00:00
|
|
|
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER,
|
|
|
|
KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser )
|
2015-08-03 20:56:37 +00:00
|
|
|
EVT_UPDATE_UI_RANGE( ID_TO_SCH, ID_TO_PCB_FP_EDITOR,
|
|
|
|
KICAD_MANAGER_FRAME::OnUpdateRequiresProject )
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
END_EVENT_TABLE()
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
enum hotkey_id_commnand
|
|
|
|
{
|
|
|
|
HK_RUN_EESCHEMA = HK_COMMON_END,
|
|
|
|
HK_LOAD_PROJECT,
|
|
|
|
HK_SAVE_PROJECT,
|
|
|
|
HK_NEW_PRJ,
|
|
|
|
HK_NEW_PRJ_TEMPLATE,
|
|
|
|
HK_RUN_LIBEDIT,
|
|
|
|
HK_RUN_PCBNEW,
|
|
|
|
HK_RUN_FPEDITOR,
|
|
|
|
HK_RUN_GERBVIEW,
|
|
|
|
HK_RUN_BM2COMPONENT,
|
|
|
|
HK_RUN_PCBCALCULATOR,
|
|
|
|
HK_RUN_PLEDITOR
|
|
|
|
};
|
|
|
|
|
|
|
|
///////////// Hotkeys management ///////////////////////////////////////
|
2015-03-22 14:04:09 +00:00
|
|
|
|
|
|
|
// Remark: the hotkey message info is used as keyword in hotkey config files and
|
|
|
|
// as comments in help windows, therefore translated only when displayed
|
|
|
|
// they are marked _HKI to be extracted by translation tools
|
|
|
|
// See hotkeys_basic.h for more info
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// hotkeys command:
|
2015-03-22 14:04:09 +00:00
|
|
|
static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
|
|
|
|
static EDA_HOTKEY HkLoadPrj( _HKI( "Load project" ), HK_LOAD_PROJECT, 'O' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkSavePrj( _HKI( "Save project" ), HK_SAVE_PROJECT, 'S' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkNewProject( _HKI( "New Project" ), HK_NEW_PRJ, 'N' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkNewPrjFromTemplate( _HKI( "New Prj From Template" ),
|
2015-03-02 17:29:18 +00:00
|
|
|
HK_NEW_PRJ_TEMPLATE, 'T' + GR_KB_CTRL );
|
|
|
|
|
2015-03-25 13:07:05 +00:00
|
|
|
static EDA_HOTKEY HkRunEeschema( _HKI( "Run Eeschema" ), HK_RUN_EESCHEMA, 'E' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunLibedit( _HKI( "Run LibEdit" ), HK_RUN_LIBEDIT, 'L' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunPcbnew( _HKI( "Run Pcbnew" ), HK_RUN_PCBNEW, 'P' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunModedit( _HKI( "Run FpEditor" ), HK_RUN_FPEDITOR, 'F' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunGerbview( _HKI( "Run Gerbview" ), HK_RUN_GERBVIEW, 'G' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunBm2Cmp( _HKI( "Run Bitmap2Component" ),
|
|
|
|
HK_RUN_BM2COMPONENT, 'B' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunPcbCalc( _HKI( "Run PcbCalculator" ),
|
|
|
|
HK_RUN_PCBCALCULATOR, 'C' + GR_KB_CTRL, 0 );
|
|
|
|
static EDA_HOTKEY HkRunPleditor( _HKI( "Run PlEditor" ), HK_RUN_PLEDITOR, 'Y' + GR_KB_CTRL, 0 );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
// List of hotkey descriptors
|
|
|
|
EDA_HOTKEY* common_Hotkey_List[] =
|
|
|
|
{
|
|
|
|
&HkHelp,
|
|
|
|
&HkLoadPrj, &HkSavePrj, &HkNewProject, &HkNewPrjFromTemplate,
|
|
|
|
&HkRunEeschema, &HkRunLibedit,
|
|
|
|
&HkRunPcbnew, &HkRunModedit, &HkRunGerbview,
|
|
|
|
&HkRunBm2Cmp, &HkRunPcbCalc, &HkRunPleditor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
// list of sections and corresponding hotkey list for Kicad
|
|
|
|
// (used to create an hotkey config file, and edit hotkeys )
|
|
|
|
// here we have only one section.
|
2015-04-16 15:26:51 +00:00
|
|
|
static wxString sectionTitle( _HKI( "Kicad Manager Hotkeys" ) );
|
2015-04-14 17:44:19 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG kicad_Manager_Hokeys_Descr[] = {
|
2015-04-14 17:44:19 +00:00
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, §ionTitle },
|
|
|
|
{ NULL, NULL, NULL }
|
2015-03-02 17:29:18 +00:00
|
|
|
};
|
|
|
|
///////////// End hotkeys management ///////////////////////////////////////
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-02-14 14:59:43 +00:00
|
|
|
* @brief (Re)Create the menubar
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
2008-11-02 22:53:38 +00:00
|
|
|
{
|
2015-03-02 17:29:18 +00:00
|
|
|
wxString msg;
|
2012-10-18 19:31:40 +00:00
|
|
|
static wxMenu* openRecentMenu; // Open Recent submenu,
|
|
|
|
// static to remember this menu
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
m_manager_Hokeys_Descr = kicad_Manager_Hokeys_Descr;
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Create and try to get the current menubar
|
2011-03-13 18:03:43 +00:00
|
|
|
wxMenuBar* menuBar = GetMenuBar();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-03-13 18:03:43 +00:00
|
|
|
if( !menuBar )
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar = new wxMenuBar();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
// Delete all existing menus so they can be rebuilt.
|
|
|
|
// This allows language changes of the menu text on the fly.
|
|
|
|
menuBar->Freeze();
|
2011-09-01 12:54:34 +00:00
|
|
|
|
2012-10-18 19:31:40 +00:00
|
|
|
// Before deleting, remove the menus managed by m_fileHistory
|
|
|
|
// (the file history will be updated when adding/removing files in history)
|
|
|
|
if( openRecentMenu )
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().GetFileHistory().RemoveMenu( openRecentMenu );
|
2012-10-18 19:31:40 +00:00
|
|
|
|
|
|
|
// Delete all existing menus
|
2010-12-17 20:34:29 +00:00
|
|
|
while( menuBar->GetMenuCount() )
|
2011-03-13 18:03:43 +00:00
|
|
|
delete menuBar->Remove( 0 );
|
2010-12-17 20:34:29 +00:00
|
|
|
|
|
|
|
// Recreate all menus:
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu File:
|
|
|
|
wxMenu* fileMenu = new wxMenu;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Open
|
2015-03-02 17:29:18 +00:00
|
|
|
msg = AddHotkeyName( _( "&Open Project" ), kicad_Manager_Hokeys_Descr, HK_LOAD_PROJECT );
|
|
|
|
AddMenuItem( fileMenu, ID_LOAD_PROJECT, msg,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open existing project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( open_project_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2012-10-18 19:31:40 +00:00
|
|
|
// File history
|
2011-04-17 13:54:17 +00:00
|
|
|
openRecentMenu = new wxMenu();
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().GetFileHistory().UseMenu( openRecentMenu );
|
|
|
|
Pgm().GetFileHistory().AddFilesToMenu( );
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu, openRecentMenu,
|
|
|
|
wxID_ANY,
|
|
|
|
_( "Open &Recent" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open recent schematic project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( open_project_xpm ) );
|
2010-02-14 14:59:43 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// New project creation
|
|
|
|
wxMenu* newprjSubMenu = new wxMenu();
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "&New Project" ), kicad_Manager_Hokeys_Descr, HK_NEW_PRJ );
|
|
|
|
AddMenuItem( newprjSubMenu, ID_NEW_PROJECT, msg,
|
|
|
|
_( "Create new blank project" ),
|
2012-10-14 16:57:11 +00:00
|
|
|
KiBitmap( new_project_xpm ) );
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
msg = AddHotkeyName( _( "New Project from &Template" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_NEW_PRJ_TEMPLATE );
|
|
|
|
AddMenuItem( newprjSubMenu, ID_NEW_PROJECT_FROM_TEMPLATE, msg,
|
|
|
|
_( "Create a new project from a template" ),
|
2012-10-14 16:57:11 +00:00
|
|
|
KiBitmap( new_project_with_template_xpm ) );
|
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
AddMenuItem( fileMenu, newprjSubMenu,
|
2012-10-18 19:31:40 +00:00
|
|
|
wxID_ANY,
|
2015-03-02 17:29:18 +00:00
|
|
|
_( "New Project" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Create new project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( new_project_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// Currently there is nothing to save
|
|
|
|
// (Kicad manager does not save any info in .pro file)
|
|
|
|
#if 0
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save
|
2015-03-02 17:29:18 +00:00
|
|
|
msg = AddHotkeyName( _( "&Save" ), kicad_Manager_Hokeys_Descr, HK_SAVE_PROJECT );
|
|
|
|
AddMenuItem( fileMenu, ID_SAVE_PROJECT, msg,
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Save current project" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( save_project_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
#endif
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Archive
|
2011-04-06 13:52:47 +00:00
|
|
|
fileMenu->AppendSeparator();
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_SAVE_AND_ZIP_FILES,
|
|
|
|
_( "&Archive" ),
|
|
|
|
_( "Archive project files in zip archive" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( zip_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Unarchive
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
ID_READ_ZIP_ARCHIVE,
|
|
|
|
_( "&Unarchive" ),
|
|
|
|
_( "Unarchive project files from zip file" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( unzip_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
|
|
|
fileMenu->AppendSeparator();
|
2011-04-04 18:05:55 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Quit
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( fileMenu,
|
|
|
|
wxID_EXIT,
|
2015-04-23 19:43:45 +00:00
|
|
|
_( "&Close" ),
|
|
|
|
_( "Close KiCad" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( exit_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Browse:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* browseMenu = new wxMenu();
|
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Text editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( browseMenu,
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
ID_TO_TEXT_EDITOR,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "Open Text E&ditor" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "Launch preferred text editor" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( editor_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// View file
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( browseMenu,
|
|
|
|
ID_BROWSE_AN_SELECT_FILE,
|
2014-02-28 17:31:00 +00:00
|
|
|
_( "&Open Local File" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Edit local file" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( browse_files_xpm ) );
|
2010-02-14 14:59:43 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Preferences:
|
|
|
|
wxMenu* preferencesMenu = new wxMenu;
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-03-29 21:22:53 +00:00
|
|
|
// Path configuration edit dialog.
|
|
|
|
AddMenuItem( preferencesMenu,
|
|
|
|
ID_PREFERENCES_CONFIGURE_PATHS,
|
|
|
|
_( "Configure Pa&ths" ),
|
|
|
|
_( "Edit path configuration environment variables" ),
|
|
|
|
KiBitmap( editor_xpm ) );
|
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Text editor
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( preferencesMenu,
|
|
|
|
ID_SELECT_PREFERED_EDITOR,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "&Set Text Editor" ),
|
|
|
|
_( "Set your preferred text editor" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( editor_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// PDF Viewer submenu:System browser or user defined checkbox
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Default
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "System &Default PDF Viewer" ),
|
|
|
|
_( "Use system default PDF viewer" ),
|
2014-02-07 16:09:15 +00:00
|
|
|
KiBitmap( datasheet_xpm ),
|
|
|
|
wxITEM_CHECK );
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().UseSystemPdfBrowser() );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// Favourite
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "&Favourite PDF Viewer" ),
|
|
|
|
_( "Use favourite PDF viewer" ),
|
2014-02-07 19:32:08 +00:00
|
|
|
KiBitmap( datasheet_xpm ),
|
2014-02-07 16:09:15 +00:00
|
|
|
wxITEM_CHECK );
|
2009-01-17 20:31:19 +00:00
|
|
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
!Pgm().UseSystemPdfBrowser() );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2014-02-07 16:09:15 +00:00
|
|
|
SubMenuPdfBrowserChoice->AppendSeparator();
|
2010-12-18 16:09:06 +00:00
|
|
|
// Append PDF Viewer submenu to preferences
|
2011-09-01 12:54:34 +00:00
|
|
|
AddMenuItem( SubMenuPdfBrowserChoice,
|
|
|
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Set &PDF Viewer" ),
|
|
|
|
_( "Set favourite PDF viewer" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( datasheet_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// PDF viewer submenu
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1,
|
2011-10-18 19:59:19 +00:00
|
|
|
_( "&PDF Viewer" ),
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "PDF viewer preferences" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( datasheet_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// Hotkey submenu
|
|
|
|
preferencesMenu->AppendSeparator();
|
|
|
|
AddHotkeyConfigMenu( preferencesMenu );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Language submenu
|
|
|
|
preferencesMenu->AppendSeparator();
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
Pgm().AddMenuLanguageList( preferencesMenu );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2015-03-02 17:29:18 +00:00
|
|
|
// Menu Tools:
|
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Eeschema" ), kicad_Manager_Hokeys_Descr, HK_RUN_EESCHEMA );
|
2015-08-03 20:56:37 +00:00
|
|
|
AddMenuItem( toolsMenu, ID_TO_SCH, msg, KiBitmap( eeschema_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Library Editor" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_RUN_LIBEDIT );
|
2015-08-03 20:56:37 +00:00
|
|
|
AddMenuItem( toolsMenu, ID_TO_SCH_LIB_EDITOR, msg, KiBitmap( libedit_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Pcbnew" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_RUN_PCBNEW );
|
2015-08-03 20:56:37 +00:00
|
|
|
AddMenuItem( toolsMenu, ID_TO_PCB, msg, KiBitmap( pcbnew_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Footprint Editor" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_RUN_FPEDITOR );
|
2015-08-03 20:56:37 +00:00
|
|
|
AddMenuItem( toolsMenu, ID_TO_PCB_FP_EDITOR, msg, KiBitmap( module_editor_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Gerbview" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_RUN_GERBVIEW );
|
2015-08-03 20:56:37 +00:00
|
|
|
AddMenuItem( toolsMenu, ID_TO_GERBVIEW, msg, KiBitmap( icon_gerbview_small_xpm ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Bitmap2Component" ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_RUN_BM2COMPONENT );
|
|
|
|
AddMenuItem( toolsMenu, ID_TO_BITMAP_CONVERTER, msg,
|
|
|
|
_( "Bitmap2Component - Convert bitmap images to Eeschema\n"
|
|
|
|
"or Pcbnew elements" ),
|
|
|
|
KiBitmap( image_xpm ) );
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Pcb Calculator" ), kicad_Manager_Hokeys_Descr, HK_RUN_PCBCALCULATOR );
|
|
|
|
AddMenuItem( toolsMenu, ID_TO_PCB_CALCULATOR, msg,
|
|
|
|
_( "Pcb calculator - Calculator for components, track width, etc." ),
|
|
|
|
KiBitmap( options_module_xpm ) );
|
|
|
|
|
|
|
|
msg = AddHotkeyName( _( "Run Page Layout Editor" ), kicad_Manager_Hokeys_Descr, HK_RUN_PLEDITOR );
|
|
|
|
AddMenuItem( toolsMenu, ID_TO_PL_EDITOR, msg,
|
|
|
|
_( "Pl editor - Worksheet layout editor" ),
|
|
|
|
KiBitmap( pagelayout_load_xpm ) );
|
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Menu Help:
|
2009-01-17 20:31:19 +00:00
|
|
|
wxMenu* helpMenu = new wxMenu;
|
2011-04-13 19:30:27 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Version info
|
2010-08-24 17:26:51 +00:00
|
|
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
|
|
|
|
2011-04-04 18:05:55 +00:00
|
|
|
// Contents
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( helpMenu, wxID_HELP,
|
2014-10-26 11:42:25 +00:00
|
|
|
_( "KiCad &Manual" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open KiCad user manual" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( online_help_xpm ) );
|
|
|
|
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( helpMenu, wxID_INDEX,
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "&Getting Started in KiCad" ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( help_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2010-01-18 19:33:45 +00:00
|
|
|
helpMenu->AppendSeparator();
|
2011-04-06 13:52:47 +00:00
|
|
|
|
|
|
|
// About
|
2014-02-07 16:09:15 +00:00
|
|
|
AddMenuItem( helpMenu, wxID_ABOUT,
|
2011-09-01 12:54:34 +00:00
|
|
|
_( "&About KiCad" ),
|
2015-10-08 13:52:03 +00:00
|
|
|
_( "About KiCad" ),
|
2011-09-08 05:58:45 +00:00
|
|
|
KiBitmap( info_xpm ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
|
2010-12-18 08:59:04 +00:00
|
|
|
// Create the menubar and append all submenus
|
2011-04-06 13:52:47 +00:00
|
|
|
menuBar->Append( fileMenu, _( "&File" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
menuBar->Append( browseMenu, _( "&Browse" ) );
|
2011-04-06 13:52:47 +00:00
|
|
|
menuBar->Append( preferencesMenu, _( "&Preferences" ) );
|
2015-03-02 17:29:18 +00:00
|
|
|
menuBar->Append( toolsMenu, _( "&Tools" ) );
|
2009-01-17 20:31:19 +00:00
|
|
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
|
|
|
|
2010-12-17 20:34:29 +00:00
|
|
|
menuBar->Thaw();
|
|
|
|
|
|
|
|
// Associate the menu bar with the frame, if no previous menubar
|
|
|
|
if( GetMenuBar() == NULL )
|
|
|
|
SetMenuBar( menuBar );
|
|
|
|
else
|
|
|
|
menuBar->Refresh();
|
2015-03-02 17:29:18 +00:00
|
|
|
|
|
|
|
// Add the hotkey to the "show hotkey list" menu, because we do not have
|
|
|
|
// a management of the keyboard keys in Kicad.
|
|
|
|
// So all hotheys should be added to the menubar
|
|
|
|
// Note Use wxMenuBar::SetLabel only after the menubar
|
|
|
|
// has been associated with a frame. (see wxWidgets doc)
|
|
|
|
msg = AddHotkeyName( menuBar->GetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST ),
|
|
|
|
kicad_Manager_Hokeys_Descr, HK_HELP );
|
|
|
|
menuBar->SetLabel( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, msg );
|
2007-05-28 18:09:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-11-02 22:53:38 +00:00
|
|
|
/**
|
2010-02-14 14:59:43 +00:00
|
|
|
* @brief (Re)Create the horizontal toolbar
|
2008-11-02 22:53:38 +00:00
|
|
|
*/
|
2011-04-17 13:54:17 +00:00
|
|
|
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
|
2007-05-28 18:09:49 +00:00
|
|
|
{
|
2011-04-06 13:52:47 +00:00
|
|
|
// Check if toolbar is not already created
|
2011-12-16 13:32:23 +00:00
|
|
|
if( m_mainToolBar != NULL )
|
2008-12-08 15:27:13 +00:00
|
|
|
return;
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
// Allocate memory for m_mainToolBar
|
|
|
|
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2010-02-08 18:15:42 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// New
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
|
|
|
|
KiBitmap( new_project_xpm ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Create new project" ) );
|
2007-05-28 18:09:49 +00:00
|
|
|
|
2012-10-14 16:57:11 +00:00
|
|
|
m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
|
|
|
|
KiBitmap( new_project_with_template_xpm ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Create new project from template" ) );
|
2012-10-14 16:57:11 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Load
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
|
|
|
|
KiBitmap( open_project_xpm ),
|
2014-02-21 07:54:13 +00:00
|
|
|
_( "Open existing project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Save
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
|
|
|
|
KiBitmap( save_project_xpm ),
|
|
|
|
_( "Save current project" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Archive
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
|
|
|
|
KiBitmap( zip_xpm ),
|
|
|
|
_( "Archive all project files" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Separator
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-04-06 13:52:47 +00:00
|
|
|
// Refresh project tree
|
2011-12-16 13:32:23 +00:00
|
|
|
m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
|
|
|
|
KiBitmap( reload_xpm ),
|
|
|
|
_( "Refresh project tree" ) );
|
2008-11-02 22:53:38 +00:00
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
// Create m_mainToolBar
|
|
|
|
m_mainToolBar->Realize();
|
2008-11-02 22:53:38 +00:00
|
|
|
}
|