Source code of Windows XP (NT5)
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.

360 lines
9.7 KiB

  1. /*** menu.h - macros and constants for menu.c
  2. *
  3. * Copyright <C> 1988, Microsoft Corporation
  4. *
  5. * Revision History:
  6. * 26-Nov-1991 mz Strip off near/far
  7. *
  8. *************************************************************************/
  9. #if !defined(CW)
  10. # error This module must be compiled with /DCW
  11. #else
  12. #define DLG_CONST
  13. /****************************************************************************
  14. * *
  15. * Editor constants *
  16. * *
  17. * C_MENUSTRINGS_MAX *
  18. * C_CITEM_MAX *
  19. * *
  20. ****************************************************************************/
  21. #define C_MENUSTRINGS_MAX 128
  22. #define C_ITEM_MAX 21
  23. /****************************************************************************
  24. * *
  25. * Actions associated with menu items *
  26. * *
  27. * Each menu item keeps a value in bParamUser that tells wich kind of action*
  28. * it is associated with (dialog box, command, macro or "other") and gives *
  29. * an index to the associated table (DialogData, CommandData or MacroData). *
  30. * *
  31. ****************************************************************************/
  32. /*
  33. * COMDATA structure used for menu items directly relating to editor commands
  34. */
  35. typedef struct comData {
  36. PCMD pCmd; /* pointer to command */
  37. flagType fKeepArg; /* arg to be used or not */
  38. };
  39. /*
  40. * Mask to get the menu item type
  41. */
  42. #define iXXXMENU 0xC0
  43. /*
  44. * Menu item action types
  45. */
  46. #define iDLGMENU 0x00
  47. #define iCOMMENU 0x40
  48. #define iMACMENU 0x80
  49. #define iOTHMENU 0xC0
  50. /*
  51. * CommandData indices for menu items directly relating to editor commands
  52. */
  53. #define iCOMNEXT iCOMMENU /* 0 */
  54. #define iCOMSAVEALL (1 + iCOMNEXT) /* 1 */
  55. #define iCOMSHELL (1 + iCOMSAVEALL) /* 2 */
  56. #define iCOMUNDO (1 + iCOMSHELL) /* 3 */
  57. #define iCOMREPEAT (1 + iCOMUNDO) /* 0 */
  58. #define iCOMCUT (1 + iCOMREPEAT) /* 0 */
  59. #define iCOMCOPY (1 + iCOMCUT) /* 4 */
  60. #define iCOMPASTE (1 + iCOMCOPY) /* 0 */
  61. #define iCOMDROPANCHOR (1 + iCOMPASTE) /* 5 */
  62. #define iCOMANCHOR (1 + iCOMDROPANCHOR) /* 0 */
  63. #define iCOMBOXMODE (1 + iCOMANCHOR) /* 0 */
  64. #define iCOMREADONLY (1 + iCOMBOXMODE) /* 6 */
  65. #define iCOMFINDSEL (1 + iCOMREADONLY) /* 0 */
  66. #define iCOMFINDLAST (1 + iCOMFINDSEL) /* 7 */
  67. #define iCOMNEXTERR (1 + iCOMFINDLAST) /* 8 */
  68. #define iCOMDEBUGBLD (1 + iCOMNEXTERR) /* 9 */
  69. #define iCOMRECORD (1 + iCOMDEBUGBLD) /* 10 */
  70. #define iCOMRESIZE (1 + iCOMRECORD) /* 11 */
  71. #define iCOMMAXIMIZE (1 + iCOMRESIZE) /* 12 */
  72. /*
  73. * MacroData indices for menu items directly relating to pre-defined macros
  74. */
  75. #define iMACSAVE iMACMENU /* 0 */
  76. #define iMACQUIT (1 + iMACSAVE) /* 1 */
  77. #define iMACREDO (1 + iMACQUIT) /* 2 */
  78. #define iMACCLEAR (1 + iMACREDO) /* 3 */
  79. #define iMACPREVERR (1 + iMACCLEAR) /* 4 */
  80. #define iMACSETERR (1 + iMACPREVERR) /* 5 */
  81. #define iMACCLEARLIST (1 + iMACSETERR) /* 6 */
  82. #define iMACERRWIN (1 + iMACCLEARLIST) /* 7 */
  83. #define iMACHSPLIT (1 + iMACERRWIN) /* 8 */
  84. #define iMACVSPLIT (1 + iMACHSPLIT) /* 9 */
  85. #define iMACCLOSE (1 + iMACVSPLIT) /* 10 */
  86. #define iMACASSIGNKEY (1 + iMACCLOSE) /* 11 */
  87. #define iMACRESTORE (1 + iMACASSIGNKEY) /* 12 */
  88. /****************************************************************************
  89. * *
  90. * Menu items with variable content and/or meaning: We store their set of *
  91. * data in an ITEMDATA structure and do the update with the UPDITEM macro *
  92. * *
  93. ****************************************************************************/
  94. /*
  95. * ITEMDATA structure used for menu items with variable content and/or meaning
  96. */
  97. typedef struct {
  98. BYTE ichHilite;
  99. BYTE bParamUser;
  100. WORD wParamUser;
  101. } ITEMDATA, *PITEMDATA;
  102. /*
  103. * UPDITEM (pItem, pItemData)
  104. *
  105. * Where:
  106. * pItem is an object of type PMENUITEM
  107. * pItemData is an object of type PITEMDATA
  108. *
  109. * Will update Item with ItemData data:
  110. *
  111. * pItem->ichHilite with pItemData->ichHilite
  112. * pItem->bParamUser with pItemData->bParamUser
  113. * pItem->wParamUser with pItemData->wParamUser
  114. */
  115. #define UPDITEM(pItem, pItemData) \
  116. (pItem)->ichHilite = (pItemData)->ichHilite, \
  117. (pItem)->bParamUser = (pItemData)->bParamUser,\
  118. (pItem)->wParamUser = (pItemData)->wParamUser
  119. /****************************************************************************
  120. * *
  121. * Prdefined Menus and Menuitems data *
  122. * *
  123. * Note: *
  124. * *
  125. * MENU ID's are comprised of two parts: *
  126. * *
  127. * . The high byte identifies the parent menu *
  128. * . The low byte identifies the actual menu item. *
  129. * *
  130. * The low byte - 1 can be used as an index into the respective menu *
  131. * tables providing that the item is in the STATIC part of the menu *
  132. * *
  133. * For the 'dynamic' part of certain predefined menus, we use id's with *
  134. * low byte values with high bit set. This allow us to still use the low *
  135. * byte as an index for any extension-supplied items we might insert *
  136. * between the static part and the dynamic part. *
  137. * *
  138. * Menus with dynamic parts are the File and Run menus (for now..) *
  139. * *
  140. ****************************************************************************/
  141. /*
  142. * File Menu
  143. *
  144. * Note: Alternate files items are dynamic
  145. *
  146. */
  147. #define MID_FILE 0x0000
  148. #define RX_FILE 2
  149. #define ICH_FILE 0
  150. #define CCH_FILE 4
  151. #define CCIT_FILE 12
  152. #define WP_FILE ((12<<9)|(21<<4)|0)
  153. #define MID_NEW (MID_FILE + 1)
  154. #define MID_OPEN (MID_FILE + 2)
  155. #define MID_MERGE (MID_FILE + 3)
  156. #define MID_NEXT (MID_FILE + 4)
  157. #define MID_SAVE (MID_FILE + 5)
  158. #define MID_SAVEAS (MID_FILE + 6)
  159. #define MID_SAVEALL (MID_FILE + 7)
  160. #define MID_PRINT (MID_FILE + 9)
  161. #define MID_SHELL (MID_FILE + 10)
  162. #define MID_EXIT (MID_FILE + 12)
  163. #define MID_FILE1 (MID_FILE + 0x80 + 0)
  164. #define MID_FILE2 (MID_FILE + 0x80 + 1)
  165. #define MID_FILE3 (MID_FILE + 0x80 + 2)
  166. #define MID_FILE4 (MID_FILE + 0x80 + 3)
  167. #define MID_FILE5 (MID_FILE + 0x80 + 4)
  168. #define MID_FILE6 (MID_FILE + 0x80 + 5)
  169. #define MID_FILE7 (MID_FILE + 0x80 + 6)
  170. #define MID_MORE (MID_FILE + 0x80 + 7)
  171. /*
  172. * Edit Menu
  173. */
  174. #define MID_EDIT 0x0100
  175. #define RX_EDIT 8
  176. #define ICH_EDIT 0
  177. #define CCH_EDIT 4
  178. #define CCIT_EDIT 18
  179. #define WP_EDIT ((18<<9)|(18<<4)|1)
  180. #define MID_UNDO (MID_EDIT + 1)
  181. #define MID_REDO (MID_EDIT + 2)
  182. #define MID_REPEAT (MID_EDIT + 3)
  183. #define MID_CUT (MID_EDIT + 5)
  184. #define MID_COPY (MID_EDIT + 6)
  185. #define MID_PASTE (MID_EDIT + 7)
  186. #define MID_CLEAR (MID_EDIT + 8)
  187. #define MID_DROPANCHOR (MID_EDIT + 10)
  188. #define MID_ANCHOR (MID_EDIT + 11)
  189. #define MID_BOXMODE (MID_EDIT + 13)
  190. #define MID_READONLY (MID_EDIT + 14)
  191. #define MID_SETREC (MID_EDIT + 16)
  192. #define MID_RECORD (MID_EDIT + 17)
  193. #define MID_EDITMACROS (MID_EDIT + 18)
  194. /*
  195. * Search Menu
  196. */
  197. #define MID_SEARCH 0x0200
  198. #define RX_SEARCH 14
  199. #define ICH_SEARCH 0
  200. #define CCH_SEARCH 6
  201. #define CCIT_SEARCH 14
  202. #define WP_SEARCH ((14<<9)|(14<<4)|2)
  203. #define MID_FIND (MID_SEARCH + 1)
  204. #define MID_FINDSEL (MID_SEARCH + 2)
  205. #define MID_FINDLAST (MID_SEARCH + 3)
  206. #define MID_REPLACE (MID_SEARCH + 4)
  207. #define MID_FINDFILE (MID_SEARCH + 5)
  208. #define MID_NEXTERR (MID_SEARCH + 7)
  209. #define MID_PREVERR (MID_SEARCH + 8)
  210. #define MID_SETERR (MID_SEARCH + 9)
  211. #define MID_ERRWIN (MID_SEARCH + 10)
  212. #define MID_GOTOMARK (MID_SEARCH + 12)
  213. #define MID_DEFMARK (MID_SEARCH + 13)
  214. #define MID_SETMARK (MID_SEARCH + 14)
  215. /*
  216. * Make Menu
  217. */
  218. #define MID_MAKE 0x0300
  219. #define RX_MAKE 22
  220. #define ICH_MAKE 0
  221. #define CCH_MAKE 4
  222. #define CCIT_MAKE 8
  223. #define WP_MAKE ((8<<9)|(8<<4)|3)
  224. #define MID_COMPILE (MID_MAKE + 1)
  225. #define MID_BUILD (MID_MAKE + 2)
  226. #define MID_REBUILD (MID_MAKE + 3)
  227. #define MID_TARGET (MID_MAKE + 4)
  228. #define MID_SETLIST (MID_MAKE + 6)
  229. #define MID_EDITLIST (MID_MAKE + 7)
  230. #define MID_CLEARLIST (MID_MAKE + 8)
  231. /*
  232. * Run Menu
  233. *
  234. * Note: User menu items are dynamic
  235. *
  236. */
  237. #define MID_RUN 0x0400
  238. #define RX_RUN 28
  239. #define ICH_RUN 0
  240. #define CCH_RUN 3
  241. #define CCIT_RUN 5
  242. #define WP_RUN ((5<<9)|(12<<4)|4)
  243. #define MID_EXECUTE (MID_RUN + 1)
  244. #define MID_DEBUG (MID_RUN + 2)
  245. #define MID_RUNAPP (MID_RUN + 4)
  246. #define MID_CUSTOM (MID_RUN + 5)
  247. #define MID_USER1 (MID_RUN + 0x80 + 0)
  248. #define MID_USER2 (MID_RUN + 0x80 + 1)
  249. #define MID_USER3 (MID_RUN + 0x80 + 2)
  250. #define MID_USER4 (MID_RUN + 0x80 + 3)
  251. #define MID_USER5 (MID_RUN + 0x80 + 4)
  252. #define MID_USER6 (MID_RUN + 0x80 + 5)
  253. /*
  254. * Window Menu
  255. */
  256. #define MID_WINDOW 0x0500
  257. #define RX_WINDOW 33
  258. #define ICH_WINDOW 0
  259. #define CCH_WINDOW 6
  260. #define CCIT_WINDOW 5
  261. #define WP_WINDOW ((5<<9)|(5<<4)|5)
  262. #define MID_SPLITH (MID_WINDOW + 1)
  263. #define MID_SPLITV (MID_WINDOW + 2)
  264. #define MID_SIZE (MID_WINDOW + 3)
  265. #define MID_MAXIMIZE (MID_WINDOW + 4)
  266. #define MID_CLOSE (MID_WINDOW + 5)
  267. /*
  268. * Options Menu
  269. */
  270. #define MID_OPTIONS 0x0600
  271. #define RX_OPTIONS 41
  272. #define ICH_OPTIONS 0
  273. #define CCH_OPTIONS 7
  274. #define CCIT_OPTIONS 4
  275. #define WP_OPTIONS ((4<<9)|(4<<4)|6)
  276. #define MID_DEBUGBLD (MID_OPTIONS + 1)
  277. #define MID_ENVIRONMENT (MID_OPTIONS + 2)
  278. #define MID_ASSIGNKEY (MID_OPTIONS + 3)
  279. #define MID_SETSWITCH (MID_OPTIONS + 4)
  280. /*
  281. * Extension Menus are last+1 through last+n
  282. */
  283. #define MID_EXTENSION 0x700
  284. #if !defined(EXTINT)
  285. /****************************************************************************
  286. * *
  287. * FARDATA.C global variables *
  288. * *
  289. ****************************************************************************/
  290. int cMenuStrings;
  291. char * MenuTitles [];
  292. char * HelpStrings [];
  293. char * HelpContexts [];
  294. char * MacroData [];
  295. struct comData CommandData [];
  296. ITEMDATA InitItemData [];
  297. ITEMDATA SelModeItemData [];
  298. ITEMDATA MaximizeItemData [];
  299. #endif
  300. #endif /* if defined(CW) */