Popup Menu Example.c 1015 B

1234567891011121314151617181920212223242526272829
  1. // A simple popup menu example
  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 RETURN_VALUE // Return a Value
  6. #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
  7. #define MIN_AMS 101 // Compile for AMS 1.01 or higher
  8. #include <tigcclib.h> // Include All Header Files
  9. // Main Function
  10. void _main(void)
  11. {
  12. HANDLE handle = PopupNew ("EXAMPLE", 40);
  13. PopupAddText (handle, -1, "Option 1", 1);
  14. PopupAddText (handle, -1, "Option 2", 2);
  15. PopupAddText (handle, 0, "Submenu 3", 3);
  16. PopupAddText (handle, 0, "Submenu 4", 4);
  17. PopupAddText (handle, -1, "Option 5", 5);
  18. PopupAddText (handle, 3, "Suboption 3.1", 6);
  19. PopupAddText (handle, 3, "Suboption 3.2", 7);
  20. PopupAddText (handle, 3, "Suboption 3.3", 8);
  21. PopupAddText (handle, 4, "Suboption 4.1", 9);
  22. short result = PopupDo (handle, CENTER, CENTER, 0);
  23. push_longint (result);
  24. HeapFree (handle);
  25. }