KiCad PCB EDA Suite
id.h File Reference
#include <wx/defs.h>

Go to the source code of this file.

Macros

#define ROOM_FOR_KICADMANAGER   50
 Common command IDs shared by more than one of the KiCad applications. More...
 
#define ROOM_FOR_3D_VIEWER   100
 
#define ROOM_FOR_PANEL_PREV_MODEL   50
 
#define DEFAULT_FILE_HISTORY_SIZE   9
 IDs range for menuitems file history: The default range file history size is 9 (compatible with default wxWidget range). More...
 
#define MAX_FILE_HISTORY_SIZE   99
 

Enumerations

enum  main_id {
  ID_APPEND_PROJECT = wxID_HIGHEST , ID_LOAD_FILE , ID_NEW_BOARD , ID_SAVE_BOARD ,
  ID_SAVE_BOARD_AS , ID_AUTO_SAVE_TIMER , ID_FILE , ID_FILE1 ,
  ID_FILEMAX = ID_FILE + MAX_FILE_HISTORY_SIZE , ID_FILE_LIST_EMPTY , ID_FILE_LIST_CLEAR , ID_PREFERENCES_RESET_PANEL ,
  ID_GEN_PLOT , ID_GEN_PLOT_PS , ID_GEN_PLOT_HPGL , ID_GEN_PLOT_GERBER ,
  ID_GEN_PLOT_SVG , ID_GEN_PLOT_DXF , ID_GEN_PLOT_PDF , ID_H_TOOLBAR ,
  ID_V_TOOLBAR , ID_OPT_TOOLBAR , ID_AUX_TOOLBAR , ID_LANGUAGE_CHOICE ,
  ID_LANGUAGE_DANISH , ID_LANGUAGE_DEFAULT , ID_LANGUAGE_ENGLISH , ID_LANGUAGE_FRENCH ,
  ID_LANGUAGE_FINNISH , ID_LANGUAGE_SPANISH , ID_LANGUAGE_SPANISH_MEXICAN , ID_LANGUAGE_GERMAN ,
  ID_LANGUAGE_GREEK , ID_LANGUAGE_NORWEGIAN , ID_LANGUAGE_RUSSIAN , ID_LANGUAGE_PORTUGUESE ,
  ID_LANGUAGE_PORTUGUESE_BRAZILIAN , ID_LANGUAGE_TURKISH , ID_LANGUAGE_INDONESIAN , ID_LANGUAGE_ITALIAN ,
  ID_LANGUAGE_SLOVENIAN , ID_LANGUAGE_SLOVAK , ID_LANGUAGE_HUNGARIAN , ID_LANGUAGE_POLISH ,
  ID_LANGUAGE_CZECH , ID_LANGUAGE_KOREAN , ID_LANGUAGE_CATALAN , ID_LANGUAGE_CHINESE_SIMPLIFIED ,
  ID_LANGUAGE_CHINESE_TRADITIONAL , ID_LANGUAGE_DUTCH , ID_LANGUAGE_JAPANESE , ID_LANGUAGE_BULGARIAN ,
  ID_LANGUAGE_LATVIAN , ID_LANGUAGE_LITHUANIAN , ID_LANGUAGE_VIETNAMESE , ID_LANGUAGE_SERBIAN ,
  ID_LANGUAGE_THAI , ID_LANGUAGE_SWEDISH , ID_LANGUAGE_UKRANIAN , ID_LANGUAGE_CHOICE_END ,
  ID_ON_ZOOM_SELECT , ID_ON_GRID_SELECT , ID_GRID_SETTINGS , ID_POPUP_ZOOM_LEVEL_START ,
  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 , ID_EDA_SOCKET_EVENT_SERV ,
  ID_EDA_SOCKET_EVENT , ID_KICAD_MANAGER_START , ID_KICAD_MANAGER_END = ID_KICAD_MANAGER_START + ROOM_FOR_KICADMANAGER , ID_KICAD_3D_VIEWER_START ,
  ID_KICAD_3D_VIEWER_END = ID_KICAD_3D_VIEWER_START + ROOM_FOR_3D_VIEWER , ID_KICAD_PANEL_PREV_MODEL_START , ID_KICAD_PANEL_PREV_MODEL_END = ID_KICAD_PANEL_PREV_MODEL_START + ROOM_FOR_PANEL_PREV_MODEL , ID_POPUP_MENU_START ,
  ID_POPUP_MENU_END = ID_POPUP_MENU_START + 2048 , ID_END_LIST
}
 

Macro Definition Documentation

◆ DEFAULT_FILE_HISTORY_SIZE

#define DEFAULT_FILE_HISTORY_SIZE   9

IDs range for menuitems file history: The default range file history size is 9 (compatible with default wxWidget range).

Definition at line 69 of file id.h.

◆ MAX_FILE_HISTORY_SIZE

#define MAX_FILE_HISTORY_SIZE   99

Definition at line 70 of file id.h.

◆ ROOM_FOR_3D_VIEWER

#define ROOM_FOR_3D_VIEWER   100

Definition at line 63 of file id.h.

◆ ROOM_FOR_KICADMANAGER

#define ROOM_FOR_KICADMANAGER   50

Common command IDs shared by more than one of the KiCad applications.

Only place command IDs used in base window class event tables or shared across multiple applications such as the zoom, grid, and language IDs. Application specific IDs should be defined in the appropriate header file to prevent the entire project from being rebuilt.

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

Definition at line 62 of file id.h.

◆ ROOM_FOR_PANEL_PREV_MODEL

#define ROOM_FOR_PANEL_PREV_MODEL   50

Definition at line 64 of file id.h.

Enumeration Type Documentation

◆ main_id

enum main_id
Enumerator
ID_APPEND_PROJECT 
ID_LOAD_FILE 
ID_NEW_BOARD 
ID_SAVE_BOARD 
ID_SAVE_BOARD_AS 
ID_AUTO_SAVE_TIMER 
ID_FILE 
ID_FILE1 
ID_FILEMAX 
ID_FILE_LIST_EMPTY 
ID_FILE_LIST_CLEAR 
ID_PREFERENCES_RESET_PANEL 
ID_GEN_PLOT 
ID_GEN_PLOT_PS 
ID_GEN_PLOT_HPGL 
ID_GEN_PLOT_GERBER 
ID_GEN_PLOT_SVG 
ID_GEN_PLOT_DXF 
ID_GEN_PLOT_PDF 
ID_H_TOOLBAR 
ID_V_TOOLBAR 
ID_OPT_TOOLBAR 
ID_AUX_TOOLBAR 
ID_LANGUAGE_CHOICE 
ID_LANGUAGE_DANISH 
ID_LANGUAGE_DEFAULT 
ID_LANGUAGE_ENGLISH 
ID_LANGUAGE_FRENCH 
ID_LANGUAGE_FINNISH 
ID_LANGUAGE_SPANISH 
ID_LANGUAGE_SPANISH_MEXICAN 
ID_LANGUAGE_GERMAN 
ID_LANGUAGE_GREEK 
ID_LANGUAGE_NORWEGIAN 
ID_LANGUAGE_RUSSIAN 
ID_LANGUAGE_PORTUGUESE 
ID_LANGUAGE_PORTUGUESE_BRAZILIAN 
ID_LANGUAGE_TURKISH 
ID_LANGUAGE_INDONESIAN 
ID_LANGUAGE_ITALIAN 
ID_LANGUAGE_SLOVENIAN 
ID_LANGUAGE_SLOVAK 
ID_LANGUAGE_HUNGARIAN 
ID_LANGUAGE_POLISH 
ID_LANGUAGE_CZECH 
ID_LANGUAGE_KOREAN 
ID_LANGUAGE_CATALAN 
ID_LANGUAGE_CHINESE_SIMPLIFIED 
ID_LANGUAGE_CHINESE_TRADITIONAL 
ID_LANGUAGE_DUTCH 
ID_LANGUAGE_JAPANESE 
ID_LANGUAGE_BULGARIAN 
ID_LANGUAGE_LATVIAN 
ID_LANGUAGE_LITHUANIAN 
ID_LANGUAGE_VIETNAMESE 
ID_LANGUAGE_SERBIAN 
ID_LANGUAGE_THAI 
ID_LANGUAGE_SWEDISH 
ID_LANGUAGE_UKRANIAN 
ID_LANGUAGE_CHOICE_END 
ID_ON_ZOOM_SELECT 
ID_ON_GRID_SELECT 
ID_GRID_SETTINGS 
ID_POPUP_ZOOM_LEVEL_START 
ID_POPUP_ZOOM_LEVEL_END 
ID_POPUP_GRID_START 
ID_POPUP_GRID_END 
ID_EDA_SOCKET_EVENT_SERV 
ID_EDA_SOCKET_EVENT 
ID_KICAD_MANAGER_START 
ID_KICAD_MANAGER_END 
ID_KICAD_3D_VIEWER_START 
ID_KICAD_3D_VIEWER_END 
ID_KICAD_PANEL_PREV_MODEL_START 
ID_KICAD_PANEL_PREV_MODEL_END 
ID_POPUP_MENU_START 
ID_POPUP_MENU_END 
ID_END_LIST 

Definition at line 72 of file id.h.

73{
74 ID_APPEND_PROJECT = wxID_HIGHEST,
80
81 // ID for menuitems used in our file history management,
82 // when we do not use wxFILE_ID (restricted to 9 items)
83 ID_FILE,
88
90
98
99 // id for toolbars
104
142
144
147
148 // Popup Menu (mouse Right button) (id consecutifs)
149
150 /* Reserve IDs for popup menu zoom levels. If you need more
151 * levels of zoom, change ID_POPUP_ZOOM_LEVEL_END. Note that more
152 * than 15 entries in a context submenu may get too large to display
153 * cleanly. Add any additional popup zoom IDs above here or the
154 * zoom event handler will not work properly.
155 */
158
161
162 // KiFace server for standalone operation
165
166 // IDs specifics to a sub-application (Eeschema, Kicad manager....) start here
167 //
168 // We reserve here Ids for each sub-application, to avoid duplicate IDs
169 // between them.
170 // mainly we experienced issues related to wxUpdateUIEvent calls when 2 (or more) wxFrames
171 // share the same ID in menus, mainly in menubars/toolbars
172 // The reason is the fact wxWidgets propagates the wxUpdateUIEvent to all parent windows
173 // to find wxUpdateUIEvent event functions matching the menuitem IDs found when activate a
174 // menu in the first frame.
175
176 // Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
177 // Change it if this count is too small.
180
181 // Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
182 // Change it if this count is too small.
185
188
189 // Reseve ID for popup menus, when we need to know a menu item is inside a popup menu
191 // The extra here need to minimum be larger than MAX_BUS_UNFOLD_MENU_ITEMS + MAX_UNIT_COUNT_PER_PACKAGE
192 // These values are stored in eeschema_id.h
194
196};
#define ROOM_FOR_3D_VIEWER
Definition: id.h:63
#define MAX_FILE_HISTORY_SIZE
Definition: id.h:70
@ ID_KICAD_PANEL_PREV_MODEL_START
Definition: id.h:186
@ ID_LANGUAGE_NORWEGIAN
Definition: id.h:115
@ ID_LANGUAGE_SWEDISH
Definition: id.h:139
@ ID_LANGUAGE_CATALAN
Definition: id.h:128
@ ID_POPUP_GRID_START
Definition: id.h:159
@ ID_LANGUAGE_CHINESE_SIMPLIFIED
Definition: id.h:129
@ ID_LANGUAGE_GERMAN
Definition: id.h:113
@ ID_NEW_BOARD
Definition: id.h:76
@ ID_KICAD_3D_VIEWER_START
Definition: id.h:183
@ ID_LANGUAGE_DUTCH
Definition: id.h:131
@ ID_POPUP_MENU_START
Definition: id.h:190
@ ID_KICAD_MANAGER_END
Definition: id.h:179
@ ID_SAVE_BOARD
Definition: id.h:77
@ ID_LANGUAGE_GREEK
Definition: id.h:114
@ ID_LANGUAGE_HUNGARIAN
Definition: id.h:124
@ ID_LANGUAGE_LITHUANIAN
Definition: id.h:135
@ ID_ON_GRID_SELECT
Definition: id.h:145
@ ID_LANGUAGE_PORTUGUESE_BRAZILIAN
Definition: id.h:118
@ ID_LANGUAGE_DEFAULT
Definition: id.h:107
@ ID_LANGUAGE_POLISH
Definition: id.h:125
@ ID_GEN_PLOT_DXF
Definition: id.h:96
@ ID_LANGUAGE_THAI
Definition: id.h:138
@ ID_FILE_LIST_CLEAR
Definition: id.h:87
@ ID_LANGUAGE_CHOICE
Definition: id.h:105
@ ID_POPUP_GRID_END
Definition: id.h:160
@ ID_LANGUAGE_JAPANESE
Definition: id.h:132
@ ID_LANGUAGE_VIETNAMESE
Definition: id.h:136
@ ID_LANGUAGE_ITALIAN
Definition: id.h:121
@ ID_POPUP_ZOOM_LEVEL_END
Definition: id.h:157
@ ID_LANGUAGE_KOREAN
Definition: id.h:127
@ ID_LANGUAGE_SERBIAN
Definition: id.h:137
@ ID_EDA_SOCKET_EVENT
Definition: id.h:164
@ ID_LANGUAGE_RUSSIAN
Definition: id.h:116
@ ID_GEN_PLOT_PS
Definition: id.h:92
@ ID_POPUP_ZOOM_LEVEL_START
Definition: id.h:156
@ ID_LANGUAGE_CZECH
Definition: id.h:126
@ ID_LOAD_FILE
Definition: id.h:75
@ ID_OPT_TOOLBAR
Definition: id.h:102
@ ID_V_TOOLBAR
Definition: id.h:101
@ ID_EDA_SOCKET_EVENT_SERV
Definition: id.h:163
@ ID_FILE
Definition: id.h:83
@ ID_GEN_PLOT_GERBER
Definition: id.h:94
@ ID_FILE_LIST_EMPTY
Definition: id.h:86
@ ID_POPUP_MENU_END
Definition: id.h:193
@ ID_ON_ZOOM_SELECT
Definition: id.h:143
@ ID_LANGUAGE_UKRANIAN
Definition: id.h:140
@ ID_LANGUAGE_LATVIAN
Definition: id.h:134
@ ID_GEN_PLOT
Definition: id.h:91
@ ID_KICAD_3D_VIEWER_END
Definition: id.h:184
@ ID_LANGUAGE_SLOVENIAN
Definition: id.h:122
@ ID_SAVE_BOARD_AS
Definition: id.h:78
@ ID_LANGUAGE_SPANISH
Definition: id.h:111
@ ID_GEN_PLOT_SVG
Definition: id.h:95
@ ID_GEN_PLOT_HPGL
Definition: id.h:93
@ ID_LANGUAGE_PORTUGUESE
Definition: id.h:117
@ ID_FILEMAX
Definition: id.h:85
@ ID_LANGUAGE_CHOICE_END
Definition: id.h:141
@ ID_AUX_TOOLBAR
Definition: id.h:103
@ ID_LANGUAGE_ENGLISH
Definition: id.h:108
@ ID_LANGUAGE_SPANISH_MEXICAN
Definition: id.h:112
@ ID_FILE1
Definition: id.h:84
@ ID_LANGUAGE_SLOVAK
Definition: id.h:123
@ ID_H_TOOLBAR
Definition: id.h:100
@ ID_GRID_SETTINGS
Definition: id.h:146
@ ID_LANGUAGE_CHINESE_TRADITIONAL
Definition: id.h:130
@ ID_LANGUAGE_FINNISH
Definition: id.h:110
@ ID_LANGUAGE_BULGARIAN
Definition: id.h:133
@ ID_APPEND_PROJECT
Definition: id.h:74
@ ID_GEN_PLOT_PDF
Definition: id.h:97
@ ID_KICAD_PANEL_PREV_MODEL_END
Definition: id.h:187
@ ID_LANGUAGE_TURKISH
Definition: id.h:119
@ ID_LANGUAGE_DANISH
Definition: id.h:106
@ ID_END_LIST
Definition: id.h:195
@ ID_LANGUAGE_FRENCH
Definition: id.h:109
@ ID_PREFERENCES_RESET_PANEL
Definition: id.h:89
@ ID_AUTO_SAVE_TIMER
Definition: id.h:79
@ ID_LANGUAGE_INDONESIAN
Definition: id.h:120
@ ID_KICAD_MANAGER_START
Definition: id.h:178
#define ROOM_FOR_KICADMANAGER
Common command IDs shared by more than one of the KiCad applications.
Definition: id.h:62
#define ROOM_FOR_PANEL_PREV_MODEL
Definition: id.h:64