Appendix A: System Routines — Dialog
351
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
DialogNew
(continued)
Example:
static WORD Opts[3];
static char Buf[11];
static HANDLE hP1, hP2;
HANDLE CallBackH( WORD dlgId ) { return hP1; }
DWORD CallBackD3( WORD dlgId, DWORD Value ) {
WORD Key;
switch( dlgId ) {
case 0: /* Owner draw */
Key = DlgMessage("TITLE", "Owner draw popup\nPress ESC to exit
dialog\nENTER to continue",
PDB_OK, PDB_CANCEL );
if (KB_ESC == Key)
return DB_EXIT;
break;
case 1: /* Exit if #20 selected in Opts[1] */
if (Opts[1] == 20)
return DB_EXIT;
break;
case 2: /* Exit if "EXIT" entered */
if (0 == strcmp("EXIT", Buf))
return DB_EXIT;
break;
case 3: /* Exit if #20 selected in Opts[2] */
if (Opts[2] == 20)
return DB_EXIT;
break;
case 4: /* Exit if F3 pressed */
Key = 0xFFFF & Value;
switch( Key ) {
case KB_F1: DlgMessage("MENU","F1 Pressed,going to entry 0",PDB_OK, 0 );
return 0;
case KB_F2: DlgMessage("MENU","F2 Pressed,going to entry 1",PDB_CANCEL,0 );
return 1;
case KB_F3: return DB_EXIT;
}
break;
case DB_QACTIVE:
return TRUE;
}
return TRUE;
}
(continued)