Appendix A: System Routines — Dialog
DrawStaticButton
Example:
/* The MEM screen is not a dialog box, even though it looks like one. It uses
MenuBegin to draw its menu and GKeyIn to get keys (it is not part of the
event loop). It uses DrawStaticButton to draw the ENTER button. It also uses
DlgMessage to prompt the user.
*/
if (WinOpen( &w, MakeWinRect(13,8,227,120), WF_ROUNDEDBORDER |
WF_SAVE_SCR | WF_TITLE | WF_SYS_ALLOC, XR_stringPtr(XR_MEMORY))) {
.
.
.
DrawStaticButton( &w, PDB_OK, 5 );
if (h = MenuBegin(&ResetMenu, 15,12, MBF_SYS_ALLOC)) {
DrawWinBorder( &w, &w.Window );
do {
Key = GKeyIn( 0l, GKF_MODAL );
if (Key == KB_F1) {
if ((Key = MenuKey( h, KB_F1 )) == KB_ESC)
Key = 0;
if (Key >= MR_RAM_ALL && Key <= MR_ALL_MEMORY) {
i = (short) DlgMessage( XR_stringPtr(XR_RESET),
XR_stringPtr(ResetTitles[Key-1]), PDB_YES, PDB_NO );
if ((WORD) i != KB_ENTER)
continue;
MenuEnd( h );
WinClose( &w );
.
.
.
TI-89 / TI-92 Plus Developer Guide
(continued)
/* fixup title line */
Not for Distribution
355
Beta Version January 26, 2001