Texas Instruments TI89 Developer Guide - Page 156
Dialog Call-Backs, DlgId, dValue
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 156 highlights
114 Chapter 11: Creating the User Interface 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 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. Table 11.3: Call Back Function Return Values dValue will vary depending on the type of the field changed: POPUP - The value from the pop-up selected by the user (the identifier for the pop-up). MENU - 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. EDIT - Address pointing to the data the user just entered. TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001