Dialog Call-Backs; Table 11.3: Call Back Function Return Values - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

114
11.4.4.

Dialog Call-Backs

The dialog code and the application can communicate changes to the status of a
dialog box as the dialog box is changed by the user. This is done through the
call-back function which is defined when the dialog box is created (either
statically or dynamically). Even if no call-back is needed, a routine MUST be
provided (the same do-nothing call-back can be provided for multiple dialogs). An
example of a do-nothing call-back is shown below.
DWORD NoCallBack( WORD DlgId, DWORD dValue ) {
return TRUE;
}
If the user provides a call-back function then it is called under the following
cases. The call-back is passed with two parameters: DlgId (WORD) and dValue
(DWORD). If DlgId is equal to DB_QACTIVE then the dialog code needs to know
if the field whose field index is in dValue is active. Indexes range from 0 for the
first item in the dialog box up to the number of fields in the dialog box less one.
The call-back should return TRUE if it is active (not grayed-out) or FALSE if it is
inactive (grayed-out). Inactive static fields (HEADER and TEXT) are not drawn
instead of being grayed-out.
If DlgId is in the range zero through the number of fields in the dialog box less
one, then it is the field index of a dialog item that has just been changed by the
user. The application can take any necessary action (including adjusting values
changed by the user). It must return one of the following values.
DB_REDRAW
DB_REDRAW_AND_CONTINUE
TRUE
dValue will vary depending on the type of the field changed:
POPUP
MENU
EDIT
TI-89 / TI-92 Plus Developer Guide

Table 11.3: Call Back Function Return Values

The value from the pop-up selected by the user (the identifier for the
pop-up).
The low WORD contains the key pressed by the user to activate the menu.
The high WORD contains the handle of the menu (the dialog box code
calls MenuBegin initially on the menu field). The call-back may activate
the menu if needed. See section 11.4.2.7. MENU for more details.
Address pointing to the data the user just entered.
Not for Distribution
Chapter 11: Creating the User Interface
Redraw the dialog box and ignore the key just
pressed by the user.
Redraw the dialog box and accept the key just
pressed by the user.
Do not redraw the dialog box and accept the key
just pressed by the user.
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents