You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
5.5 KiB

  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-2016 Wayne Stambaugh <stambaughw@verizon.net>
  6. * Copyright The 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. /**
  26. * @brief Common command IDs shared by more than one of the KiCad applications.
  27. *
  28. * Only place command IDs used in base window class event tables or shared
  29. * across multiple applications such as the zoom, grid, and language IDs.
  30. *
  31. * Most things should use the new ACTION framwork instead.
  32. */
  33. #ifndef ID_H_
  34. #define ID_H_
  35. #include <wx/defs.h>
  36. // Define room for IDs, for each sub application
  37. #define ROOM_FOR_KICADMANAGER 50
  38. #define ROOM_FOR_3D_VIEWER 100
  39. #define ROOM_FOR_PANEL_PREV_MODEL 50
  40. /// IDs range for menuitems file history:
  41. /// The default range file history size is 9 (compatible with default wxWidget range).
  42. #define DEFAULT_FILE_HISTORY_SIZE 9
  43. #define MAX_FILE_HISTORY_SIZE 99
  44. enum main_id
  45. {
  46. ID_AUTO_SAVE_TIMER = wxID_HIGHEST,
  47. // ID for menuitems used in our file history management,
  48. // when we do not use wxFILE_ID (restricted to 9 items)
  49. ID_FILE,
  50. ID_FILE1,
  51. ID_FILEMAX = ID_FILE + MAX_FILE_HISTORY_SIZE,
  52. ID_FILE_LIST_EMPTY,
  53. ID_FILE_LIST_CLEAR,
  54. ID_PREFERENCES_RESET_PANEL,
  55. ID_LANGUAGE_CHOICE,
  56. ID_LANGUAGE_DANISH,
  57. ID_LANGUAGE_DEFAULT,
  58. ID_LANGUAGE_ENGLISH,
  59. ID_LANGUAGE_FRENCH,
  60. ID_LANGUAGE_FINNISH,
  61. ID_LANGUAGE_HEBREW,
  62. ID_LANGUAGE_SPANISH,
  63. ID_LANGUAGE_SPANISH_MEXICAN,
  64. ID_LANGUAGE_GERMAN,
  65. ID_LANGUAGE_GREEK,
  66. ID_LANGUAGE_NORWEGIAN,
  67. ID_LANGUAGE_RUSSIAN,
  68. ID_LANGUAGE_PORTUGUESE,
  69. ID_LANGUAGE_PORTUGUESE_BRAZILIAN,
  70. ID_LANGUAGE_TURKISH,
  71. ID_LANGUAGE_INDONESIAN,
  72. ID_LANGUAGE_ITALIAN,
  73. ID_LANGUAGE_SLOVENIAN,
  74. ID_LANGUAGE_SLOVAK,
  75. ID_LANGUAGE_HUNGARIAN,
  76. ID_LANGUAGE_POLISH,
  77. ID_LANGUAGE_CZECH,
  78. ID_LANGUAGE_KOREAN,
  79. ID_LANGUAGE_CATALAN,
  80. ID_LANGUAGE_CHINESE_SIMPLIFIED,
  81. ID_LANGUAGE_CHINESE_TRADITIONAL,
  82. ID_LANGUAGE_DUTCH,
  83. ID_LANGUAGE_JAPANESE,
  84. ID_LANGUAGE_BULGARIAN,
  85. ID_LANGUAGE_LATVIAN,
  86. ID_LANGUAGE_LITHUANIAN,
  87. ID_LANGUAGE_VIETNAMESE,
  88. ID_LANGUAGE_SERBIAN,
  89. ID_LANGUAGE_THAI,
  90. ID_LANGUAGE_SWEDISH,
  91. ID_LANGUAGE_UKRAINIAN,
  92. ID_LANGUAGE_ARABIC,
  93. ID_LANGUAGE_ESTONIAN,
  94. ID_LANGUAGE_FARSI,
  95. ID_LANGUAGE_CROATIAN,
  96. ID_LANGUAGE_ROMANIAN,
  97. ID_LANGUAGE_NORWEGIAN_BOKMAL,
  98. ID_LANGUAGE_TAMIL,
  99. ID_LANGUAGE_CHOICE_END,
  100. ID_ON_ZOOM_SELECT,
  101. ID_ON_GRID_SELECT,
  102. // Popup Menu (mouse Right button) (id consecutifs)
  103. /* Reserve IDs for popup menu zoom levels. If you need more
  104. * levels of zoom, change ID_POPUP_ZOOM_LEVEL_END. Note that more
  105. * than 15 entries in a context submenu may get too large to display
  106. * cleanly. Add any additional popup zoom IDs above here or the
  107. * zoom event handler will not work properly.
  108. */
  109. ID_POPUP_ZOOM_LEVEL_START,
  110. ID_POPUP_ZOOM_LEVEL_END = ID_POPUP_ZOOM_LEVEL_START + 99,
  111. ID_POPUP_GRID_START,
  112. ID_POPUP_GRID_END = ID_POPUP_ZOOM_LEVEL_START + 99,
  113. // KiFace server for standalone operation
  114. ID_EDA_SOCKET_EVENT_SERV,
  115. ID_EDA_SOCKET_EVENT,
  116. // IDs specifics to a sub-application (Eeschema, Kicad manager....) start here
  117. //
  118. // We reserve here Ids for each sub-application, to avoid duplicate IDs
  119. // between them.
  120. // mainly we experienced issues related to wxUpdateUIEvent calls when 2 (or more) wxFrames
  121. // share the same ID in menus, mainly in menubars/toolbars
  122. // The reason is the fact wxWidgets propagates the wxUpdateUIEvent to all parent windows
  123. // to find wxUpdateUIEvent event functions matching the menuitem IDs found when activate a
  124. // menu in the first frame.
  125. // Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
  126. // Change it if this count is too small.
  127. ID_KICAD_MANAGER_START,
  128. ID_KICAD_MANAGER_END = ID_KICAD_MANAGER_START + ROOM_FOR_KICADMANAGER,
  129. // Reserve ROOM_FOR_KICADMANAGER IDs, for Kicad manager
  130. // Change it if this count is too small.
  131. ID_KICAD_3D_VIEWER_START,
  132. ID_KICAD_3D_VIEWER_END = ID_KICAD_3D_VIEWER_START + ROOM_FOR_3D_VIEWER,
  133. ID_KICAD_PANEL_PREV_MODEL_START,
  134. ID_KICAD_PANEL_PREV_MODEL_END = ID_KICAD_PANEL_PREV_MODEL_START + ROOM_FOR_PANEL_PREV_MODEL,
  135. // Reserve ID for popup menus, when we need to know a menu item is inside a popup menu
  136. ID_POPUP_MENU_START,
  137. // The extra here need to minimum be larger than MAX_BUS_UNFOLD_MENU_ITEMS +
  138. // MAX_UNIT_COUNT_PER_PACKAGE.
  139. // These values are stored in eeschema_id.h
  140. ID_POPUP_MENU_END = ID_POPUP_MENU_START + 2048,
  141. ID_END_LIST
  142. };
  143. #endif // ID_H_