Appendix A: System Routines — Menus
871
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
DynMenuAdd
Declaration:
HANDLE
DynMenuAdd
(HANDLE
hMenu
, SWORD
ParentId
,
const void *
Name
, short
Id
, WORD
Flags
);
Category(ies):
Menus
Description:
Add a new entry to a dynamic menu.
Inputs:
hMenu
— Handle to a dynamic menu created with
MenuNew
or
MenuLoad
.
ParentId
— ID of parent if adding a child entry (0 if adding top-level
entry).
Name
— Pointer to string (if DMF_TEXT set in
Flags
) or ICON (if
DMF_ICON set in
Flags
)or BITMAP (if DMF_BITMAP set in
Flags
).
Id
— ID of new entry. If
Id
is 0 then use sequentially numbered
Ids. IDs are limited to the range 0x0001 . . . 0xFFF (12 bits).
NOTE:
If you are adding to a menu created with the resource compiler (using
MenuLoad
) do NOT use the range F00 . . . FFF.
Flags
— One of the following flags must be set:
DMF_TEXT —
Name
points to a text string.
DMF_ICON —
Name
points to an ICON.
DMF_BITMAP —
Name
points to a BITMAP.
Also, one of the following flags may be set:
DMF_TOP — New top-level entry that cannot be a
parent.
DMF_TOP_SUB — New top-level entry that can have
children.
DMF_CHILD — Child of Parent (as specified by
ParentId
).
DMF_CILD_SUB — Child of Parent (
ParentId
) that can
also have children.
Outputs:
hMenu
if successful, H_NULL if out of memory or error in parameters
(
ParentId
not found,
ParentId
found but it was not a possible parent or
max-items in a menu exceeded).
Note that if there is an error adding the new entry, the MF_ERROR bit in
MenuFlags
(
hMenu
) is set.
(continued)