2011-10-13 19:56:32 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2017-03-02 13:46:18 +00:00
|
|
|
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2016-04-18 15:03:59 +00:00
|
|
|
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
2017-03-02 13:46:18 +00:00
|
|
|
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-13 19:56:32 +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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file id.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
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
|
|
|
#ifndef ID_H_
|
|
|
|
#define ID_H_
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2019-05-14 12:39:34 +00:00
|
|
|
#include <wx/defs.h>
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
/**
|
2011-09-30 18:15:37 +00:00
|
|
|
* Common command IDs shared by more than one of the KiCad applications.
|
2009-09-22 12:27:57 +00:00
|
|
|
*
|
|
|
|
* Only place command IDs used in base window class event tables or shared
|
2021-06-09 19:32:58 +00:00
|
|
|
* across multiple applications such as the zoom, grid, and language IDs.
|
2009-09-22 12:27:57 +00:00
|
|
|
* Application specific IDs should be defined in the appropriate header
|
|
|
|
* file to prevent the entire project from being rebuilt.
|
2014-08-19 14:51:15 +00:00
|
|
|
*
|
|
|
|
* However, we must avoid duplicate IDs in menus and toolbar items, when wxUpdateUIEvent
|
|
|
|
* are associated to menuitems and/or toolbar items
|
|
|
|
* The reason is the fact wxWidgets try to send a wxUpdateUIEvent event to a given window and,
|
|
|
|
* if a wxUpdateUIEvent event function is not defined for a menuitem, wxWidgets
|
|
|
|
* propagates this event ID to parents of the given window.
|
|
|
|
* Therefore duplicate IDs could create strange behavior in menus and subtle bugs, depending
|
|
|
|
* on the code inside the wxUpdateUIEvent event functions called in parent frames.
|
|
|
|
* I did not seen this propagation to child frames, only to parent frames
|
|
|
|
*
|
|
|
|
* Issues exist only if 2 menus have the same ID, and only one menu is associated to
|
|
|
|
* a wxUpdateUIEvent event, and this one is defined in a parent Window.
|
|
|
|
* The probability it happens is low, but not null.
|
|
|
|
*
|
|
|
|
* Therefore we reserve room in ID list for each sub application.
|
|
|
|
* Please, change these values if needed
|
2009-09-22 12:27:57 +00:00
|
|
|
*/
|
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
// Define room for IDs, for each sub application
|
|
|
|
#define ROOM_FOR_KICADMANAGER 50
|
|
|
|
#define ROOM_FOR_3D_VIEWER 100
|
2016-07-19 17:35:25 +00:00
|
|
|
#define ROOM_FOR_PANEL_PREV_MODEL 50
|
2014-08-19 14:51:15 +00:00
|
|
|
|
2019-05-25 18:58:28 +00:00
|
|
|
|
|
|
|
/// IDs range for menuitems file history:
|
|
|
|
/// The default range file history size is 9 (compatible with default wxWidget range).
|
|
|
|
#define DEFAULT_FILE_HISTORY_SIZE 9
|
|
|
|
#define MAX_FILE_HISTORY_SIZE 99
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
enum main_id
|
|
|
|
{
|
2022-07-10 23:14:29 +00:00
|
|
|
ID_APPEND_PROJECT = wxID_HIGHEST,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LOAD_FILE,
|
|
|
|
ID_NEW_BOARD,
|
|
|
|
ID_SAVE_BOARD,
|
|
|
|
ID_SAVE_BOARD_AS,
|
2011-10-13 19:56:32 +00:00
|
|
|
ID_AUTO_SAVE_TIMER,
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2019-05-25 18:58:28 +00:00
|
|
|
// ID for menuitems used in our file history management,
|
|
|
|
// when we do not use wxFILE_ID (restricted to 9 items)
|
|
|
|
ID_FILE,
|
|
|
|
ID_FILE1,
|
|
|
|
ID_FILEMAX = ID_FILE + MAX_FILE_HISTORY_SIZE,
|
2020-02-25 15:46:56 +00:00
|
|
|
ID_FILE_LIST_EMPTY,
|
2019-11-23 16:54:48 +00:00
|
|
|
ID_FILE_LIST_CLEAR,
|
2019-05-25 18:58:28 +00:00
|
|
|
|
2021-11-01 11:20:13 +00:00
|
|
|
ID_PREFERENCES_RESET_PANEL,
|
2009-09-22 12:27:57 +00:00
|
|
|
|
|
|
|
ID_GEN_PLOT,
|
|
|
|
ID_GEN_PLOT_PS,
|
|
|
|
ID_GEN_PLOT_HPGL,
|
|
|
|
ID_GEN_PLOT_GERBER,
|
|
|
|
ID_GEN_PLOT_SVG,
|
|
|
|
ID_GEN_PLOT_DXF,
|
2012-05-03 18:37:56 +00:00
|
|
|
ID_GEN_PLOT_PDF,
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2014-10-15 11:40:38 +00:00
|
|
|
// id for toolbars
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_H_TOOLBAR,
|
|
|
|
ID_V_TOOLBAR,
|
|
|
|
ID_OPT_TOOLBAR,
|
|
|
|
ID_AUX_TOOLBAR,
|
|
|
|
|
|
|
|
ID_LANGUAGE_CHOICE,
|
2021-01-06 22:23:59 +00:00
|
|
|
ID_LANGUAGE_DANISH,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_DEFAULT,
|
|
|
|
ID_LANGUAGE_ENGLISH,
|
|
|
|
ID_LANGUAGE_FRENCH,
|
2010-02-07 16:32:51 +00:00
|
|
|
ID_LANGUAGE_FINNISH,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_SPANISH,
|
2021-09-10 19:43:12 +00:00
|
|
|
ID_LANGUAGE_SPANISH_MEXICAN,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_GERMAN,
|
2011-02-05 16:15:48 +00:00
|
|
|
ID_LANGUAGE_GREEK,
|
2021-01-06 22:23:59 +00:00
|
|
|
ID_LANGUAGE_NORWEGIAN,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_RUSSIAN,
|
|
|
|
ID_LANGUAGE_PORTUGUESE,
|
2021-09-09 18:18:32 +00:00
|
|
|
ID_LANGUAGE_PORTUGUESE_BRAZILIAN,
|
2021-01-06 22:23:59 +00:00
|
|
|
ID_LANGUAGE_TURKISH,
|
|
|
|
ID_LANGUAGE_INDONESIAN,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_ITALIAN,
|
|
|
|
ID_LANGUAGE_SLOVENIAN,
|
2016-02-11 19:12:37 +00:00
|
|
|
ID_LANGUAGE_SLOVAK,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_HUNGARIAN,
|
|
|
|
ID_LANGUAGE_POLISH,
|
|
|
|
ID_LANGUAGE_CZECH,
|
|
|
|
ID_LANGUAGE_KOREAN,
|
|
|
|
ID_LANGUAGE_CATALAN,
|
|
|
|
ID_LANGUAGE_CHINESE_SIMPLIFIED,
|
2018-08-27 15:20:28 +00:00
|
|
|
ID_LANGUAGE_CHINESE_TRADITIONAL,
|
2008-04-22 06:10:37 +00:00
|
|
|
ID_LANGUAGE_DUTCH,
|
2011-01-16 17:11:26 +00:00
|
|
|
ID_LANGUAGE_JAPANESE,
|
2011-11-30 11:45:49 +00:00
|
|
|
ID_LANGUAGE_BULGARIAN,
|
2021-01-06 22:23:59 +00:00
|
|
|
ID_LANGUAGE_LATVIAN,
|
2016-05-22 10:31:08 +00:00
|
|
|
ID_LANGUAGE_LITHUANIAN,
|
2020-12-21 18:54:24 +00:00
|
|
|
ID_LANGUAGE_VIETNAMESE,
|
2021-03-05 17:19:58 +00:00
|
|
|
ID_LANGUAGE_SERBIAN,
|
2021-09-30 15:38:41 +00:00
|
|
|
ID_LANGUAGE_THAI,
|
2021-11-08 19:41:14 +00:00
|
|
|
ID_LANGUAGE_SWEDISH,
|
2022-05-25 23:37:48 +00:00
|
|
|
ID_LANGUAGE_UKRANIAN,
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_LANGUAGE_CHOICE_END,
|
|
|
|
|
|
|
|
ID_ON_ZOOM_SELECT,
|
2022-07-10 23:14:29 +00:00
|
|
|
|
|
|
|
ID_ON_GRID_SELECT,
|
|
|
|
ID_GRID_SETTINGS,
|
|
|
|
|
|
|
|
// Popup Menu (mouse Right button) (id consecutifs)
|
2009-01-29 14:26:20 +00:00
|
|
|
|
2009-02-14 18:01:07 +00:00
|
|
|
/* Reserve IDs for popup menu zoom levels. If you need more
|
2009-01-29 14:26:20 +00:00
|
|
|
* levels of zoom, change ID_POPUP_ZOOM_LEVEL_END. Note that more
|
|
|
|
* than 15 entries in a context submenu may get too large to display
|
|
|
|
* cleanly. Add any additional popup zoom IDs above here or the
|
|
|
|
* zoom event handler will not work properly.
|
|
|
|
*/
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_POPUP_ZOOM_LEVEL_START,
|
2020-06-17 17:27:45 +00:00
|
|
|
ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 99,
|
|
|
|
|
|
|
|
ID_POPUP_GRID_START,
|
|
|
|
ID_POPUP_GRID_END = ID_POPUP_ZOOM_LEVEL_START + 99,
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2020-05-22 18:27:05 +00:00
|
|
|
// KiFace server for standalone operation
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_EDA_SOCKET_EVENT_SERV,
|
|
|
|
ID_EDA_SOCKET_EVENT,
|
|
|
|
|
2014-08-19 14:51:15 +00:00
|
|
|
// IDs specifics to a sub-application (Eeschema, Kicad manager....) start here
|
|
|
|
//
|
|
|
|
// We reserve here Ids for each sub-application, to avoid duplicate IDs
|
|
|
|
// between them.
|
|
|
|
// mainly we experienced issues related to wxUpdateUIEvent calls when 2 (or more) wxFrames
|
|
|
|
// share the same ID in menus, mainly in menubars/toolbars
|
|
|
|
// The reason is the fact wxWidgets propagates the wxUpdateUIEvent to all parent windows
|
2016-10-11 17:40:23 +00:00
|
|
|
// to find wxUpdateUIEvent event functions matching the menuitem IDs found when activate a
|
|
|
|
// menu in the first frame.
|
2014-08-19 14:51:15 +00:00
|
|
|
|
|
|
|
// Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
|
|
|
|
// Change it if this count is too small.
|
|
|
|
ID_KICAD_MANAGER_START,
|
|
|
|
ID_KICAD_MANAGER_END = ID_KICAD_MANAGER_START + ROOM_FOR_KICADMANAGER,
|
|
|
|
|
|
|
|
// Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
|
|
|
|
// Change it if this count is too small.
|
|
|
|
ID_KICAD_3D_VIEWER_START,
|
|
|
|
ID_KICAD_3D_VIEWER_END = ID_KICAD_3D_VIEWER_START + ROOM_FOR_3D_VIEWER,
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
ID_KICAD_PANEL_PREV_MODEL_START,
|
|
|
|
ID_KICAD_PANEL_PREV_MODEL_END = ID_KICAD_PANEL_PREV_MODEL_START + ROOM_FOR_PANEL_PREV_MODEL,
|
|
|
|
|
2019-05-21 10:48:37 +00:00
|
|
|
// Reseve ID for popup menus, when we need to know a menu item is inside a popup menu
|
|
|
|
ID_POPUP_MENU_START,
|
2022-03-03 00:32:04 +00:00
|
|
|
// The extra here need to minimum be larger than MAX_BUS_UNFOLD_MENU_ITEMS + MAX_UNIT_COUNT_PER_PACKAGE
|
|
|
|
// These values are stored in eeschema_id.h
|
|
|
|
ID_POPUP_MENU_END = ID_POPUP_MENU_START + 2048,
|
2019-05-21 10:48:37 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
ID_END_LIST
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
#endif // ID_H_
|