Dialog Test.c 895 B

123456789101112131415161718192021222324
  1. // Display a simple dialog box and let the user enter a name
  2. #define USE_TI89 // Compile for TI-89
  3. #define USE_TI92PLUS // Compile for TI-92 Plus
  4. #define USE_V200 // Compile for V200
  5. #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
  6. #define MIN_AMS 100 // Compile for AMS 1.00 or higher
  7. #include <tigcclib.h> // Include All Header Files
  8. // Main Function
  9. void _main(void)
  10. {
  11. char buffer[27] = "Hello ";
  12. // 6 bytes "Hello ", max. 20 bytes name, 1 zero byte
  13. HANDLE handle = DialogNewSimple (140, 55);
  14. DialogAddTitle (handle, "EXAMPLE", BT_OK, BT_CANCEL);
  15. DialogAddText (handle, 3, 20, "Enter name (max. 20 chars)");
  16. DialogAddRequest (handle, 3, 30, "Your name", 6, 20, 14);
  17. if (DialogDo (handle, CENTER, CENTER, buffer, NULL) == KEY_ENTER)
  18. DlgMessage ("GREETINGS", buffer, BT_OK, BT_NONE);
  19. HeapFree (handle);
  20. }