4 * [Generated from menuDefs, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
51 /*----- Constants for menus -----------------------------------------------*
53 * In the descriptions of flags below, the data required in the packed menu
54 * definition is shown in the comments. Insert items in the order of the
55 * bit precedences of the flags.
57 * Note -- a (*) following a description means the flag is only supported by
58 * tms (the tearoff system), and a (+) means that the flag is only supported
59 * by menu (the WIMP system).
62 /* --- Flags for menu titles and items --- */
64 #define mFlag_indirect ((1<<0))
66 #define mFlag_R12 ((1<<16))
68 #define mFlag_noTrans ((1<<19))
70 /* --- Menu title flags --- */
72 #define mFlag_tearoff ((1<<1))
74 #define mFlag_makeMe ((1<<2))
76 #define mFlag_maxHeight ((1<<3))
78 #define mFlag_global ((1<<4))
80 /* --- Menu item flags --- */
82 #define mFlag_shortCut ((1<<1))
84 #define mFlag_iShortCut ((1<<2))
86 #define mFlag_shade ((1<<3))
88 #define mFlag_invShade ((1<<4))
90 #define mFlag_switch ((1<<5))
92 #define mFlag_radio ((1<<6))
94 #define mFlag_sprite ((1<<7))
96 #define mFlag_halfSize ((1<<8))
98 #define mFlag_subWarn ((1<<9))
100 #define mFlag_subMenu ((1<<10))
102 #define mFlag_noWarn ((1<<17))
104 #define mFlag_ruleOff ((1<<18))
106 #define mFlag_end ((1<<31))
108 /* --- Event codes --- *
110 * Event codes are returned in R0, with R1 being the item number within
111 * the packed menu definition, indexed from 0.
113 * Note: mEvent_deleted is only sent to the topmost menu title by the
114 * standard menu system, but is sent to the titles of all menus being closed
115 * by TMS. If you are converting from one to the other, bear this in mind.
118 #define mEvent_select (0)
120 #define mEvent_subMenu (1)
122 #define mEvent_deleted (2)
124 #define mEvent_help (3)
126 /*----- Menu creation macros ----------------------------------------------*/
128 /* --- Note to reader --- *
130 * These macros make a lot of use of private constants and variables. Try to
131 * avoid examining these too closely, because you'll probably get lost.
134 /* --- Set up the variables --- */
136 /* --- Macro: BITSPEC --- *
138 * Arguments: offset == offset into workspace of target word
139 * bit == bitmask with a 1 in the position of the bit
141 * Use: Assembles a bit specification referencing the described bit.
142 * The bit is described by a mask word rather than a bit
143 * position, because it is expected that you will already have
144 * set up constants for bit masks.
147 /* --- Macro: SETBIT --- *
149 * Arguments: flag == which menu flag above to set
151 * Use: Sets a bit within the current item or menu title's flags
152 * word. It ensures that items are inserted in the correct
156 /* --- Macro: NEWITEM --- *
160 * Use: Starts a new menu item or menu title. It also inserts a new
161 * flags word in the current position.
164 /* --- Macro: MENU --- *
166 * Arguments: title == the menu's title string/message tag
168 * Use: Creates a nonindirected menu title and starts a new menu.
171 /* --- Macro: MENUI --- *
173 * Arguments: title == offset to title pointer in client's workspace
175 * Use: Creates an indirected menu title and starts a new menu.
178 /* --- Macro: TEAROFF --- *
180 * Arguments: title == menu's title string/message tag
182 * Use: Creates a nonindirected tearoff menu title and starts a new
186 /* --- Macro: TEARI --- *
188 * Arguments: title == offset to title pointer in client's workspace
190 * Use: Creates an indirected tearoff menu title and starts a new
194 /* --- Macro: R12DATA --- *
198 * Use: Sets the current menu item or menu title to use the client's
199 * R12 pointer rather than its R10 pointer for workspace.
202 /* --- Macro: NOTRANS --- *
206 * Use: Disables message translation of the current item or menu
207 * title. This is useful if you're building the item or title
211 /* --- Macro: MAKEME --- *
213 * Arguments: makeProc == pointer to procedure which will remake the menu
215 * Use: Sets the current menu to require being remade from scratch
216 * when being updated (e.g. after an item is selected).
219 /* --- Macro: MHEIGHT --- *
221 * Arguments: height == maximum permitted height for menu in OS units
223 * Use: Sets the menu's maximum allowable height.
226 /* --- Macro: GLOBALM --- *
230 * Use: Sets the menu's maximum allowable height.
233 /* --- Macro: ITEM --- *
235 * Arguments: text == item's text string/message tag
237 * Use: Creates a new nonindirected menu item.
240 /* --- Macro: ITEMI --- *
242 * Arguments: text == offset of pointer to menu text
244 * Use: Creates a new indirected menu item
247 /* --- Macro: SHADE --- *
249 * Arguments: $offset,$bit == bitspec of item's `shaded' bit
251 * Use: Sets the current item to be shadable.
254 /* --- Macro: ISHADE --- *
256 * Arguments: offset,$bit == bitspec of item's `unshaded' bit
258 * Use: Sets the current item to be inverse shadable.
261 /* --- Macro: SWITCH --- *
263 * Arguments: offset,$bit == bitspec of item's `ticked' bit
265 * Use: Sets the current item to be tickable.
268 /* --- Macro: RADIO --- *
270 * Arguments: group == offset of this item's radio group selector
271 * selector == value of selector to blob this item
273 * Use: Marks this item as a radio item, so that it is blobbed (or
274 * ticked under the WIMP menu system) when the selector in the
275 * client's workspace matches the item's selector.
278 /* --- Macro: SPRITE --- *
280 * Arguments: sprite == EITHER address of validation string, OR offset of
281 * sprite name pointer (if area argument given)
282 * area == (optional) sprite area, or -1 for resspr_area
284 * Use: Adds a sprite to the menu item definition.
287 /* --- Macro: HALFSZ --- *
291 * Use: Sets the item to display its sprite at half size
294 /* --- Macro: SUBWARN --- *
298 * Use: Sets the item to generate submenu warnings when its submenu
299 * arrow is pointed at.
302 /* --- Macro: SUBMENU --- *
304 * Arguments: subMenu == pointer to packed definition of the submenu
305 * handler == pointer to handler routine
307 * Use: Attaches the given menu as a submenu of this item.
310 /* --- Macro: NOWARN --- *
314 * Use: Prevents this item from returning submenu events if it is
318 /* --- Macro: RULEOFF --- *
322 * Use: Inserts a ruleoff after the current item, assuming there are
323 * some more items after it.
326 /* --- Macro: MENUEND --- *
330 * Use: Finishes off the current menu.
333 /*----- That's all, folks -------------------------------------------------*/