904
Appendix A: System Routines — Menus
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
PopupDo
Declaration:
WORD
PopupDo
(HANDLE
pH
, short
x0
, short
y0
, short
Offset
)
Category(ies):
Menus
Description:
Execute a dynamic POPUP created by
PopupNew
.
Inputs:
pH
— HANDLE returned from
PopupNew
.
x0
,
y0
— Screen coordinates of the upper left corner of the menu.
If
x0
is equal to
L
1 then the pop-up is centered
horizontally, if
y0
is equal to
L
1 then the pop-up is
centered vertically.
Offset
— Menu ID of initially selected item (0 defaults to first
item).
Outputs:
0 — Nothing selected (
N
pressed) or not enough memory
to display pop-up.
1 . . . 0xFFF — Menu ID of item selected.
Assumptions:
Do NOT pass handles from
PopupBegin
!
Side Effects:
May cause heap compression.
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: PopupNew, MenuPopup (static POPUPs)
Example:
volatile HANDLE h = NULL;
volatile WORD opt = 0;
TRY
if (!(h = PopupNew( "TITLE", 0 )))
ER_throw(ER_MEMORY);
if (!PopupAddText( h, 0, "QUIT", 1 ) || !PopupAddText( h, 0, "SELECT TO CHANGE", 2 ))
ER_throw(ER_MEMORY);
if (2 == PopupDo( h, -1, -1, 0 )) {
if (!PopupChangeText( h, 2, "THIS WAS CHANGED" ))
ER_throw(ER_MEMORY);
opt = PopupDo( h, -1, -1, 2 );
}
PopupFree( h );
ONERR
if (h)
PopupFree( h );
ENDTRY
return opt;