18
Chapter 4: User Interface Overview
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
4.2.2.2. Dynamic Pop-ups
 Dynamic pop-ups can be created using the following functions:
PopupNew
— Create an empty dynamic pop-up.
DynMenuAdd
,
DynMenuChange
— Add to or change a dynamic pop-up.
PopupAddText
,
PopupChangeText
— Basically do the same thing as 
DynMenuAdd
 and
DynMenuChange
 but for text only.
PopupClear
— Empty out a dynamic pop-up so the handle can at least be
reused in case there are other functions, like dialog boxes,
that need to keep the same handle.
PopupDo
— Execute a dynamic pop-up (do not use 
MenuPopup
),
returning the item selected by the user.
4.2.2.3.  Dynamic Pop-ups with Menu Features
 Static and dynamic pop-ups, as defined in the preceding two sections, do not
have menu features like checking (adding/removing checkmarks from individual
items) and the ability to gray-out individual items. In order to have those features,
there are two additional functions. 
PopupBegin
 creates a structure similar to
MenuBegin
 and returns an additional handle that can be passed to
MenuSubStat
 and 
MenuCheck
 functions. This new handle is then passed to
PopupBeginDo
 to actually execute the pop-up. If 
MenuEnd
 is called with this
new handle, both it and the handle returned from 
PopupNew
 are freed.
4.3. Dialog Boxes
 Dialog boxes provide a consistent method for inputting data from the user. A
dialog box may consist of headers with buttons, text fields, pop-ups or edit fields.
As with menus, dialog boxes can be built statically with the resource compiler or
dynamically. Unlike dynamic menus, dynamic dialog boxes cannot be modified
once they are created.
 The routine to execute a dialog box and get back input from the user is called
Dialog
. It is passed two arrays that contain the initial and final input for the dialog
box, one for the pop-ups and another for the edit fields. Dynamic dialogs are
created with the 
DialogNew
 function and executed with the 
DialogDo
 function.
The following example shows how a dialog is defined for the resource compiler.
DIALOG OverwriteDlg, 0, 0, OverwriteCallBack {
   TEXT,   {DF_OWNER_DRAW, 8, 15}
   POPUP,  {DF_TAB_ELLIPSES, DLG_DEF_X0, 28}, “Overwrite?”, OverwritePopup, 0
   EDIT,   {DF_TAB_ELLIPSES, DLG_DEF_X0, 41}, “New name”, 0, 17, 18
   HEADER, {0,0,0},  “Receive”, PDB_OK, PDB_CANCEL
}