// C Source File
// Created 12/09/2003; 15:55:08
#define USE_TI89 // Compile for TI-89
#define USE_TI92PLUS // Compile for TI-92 Plus
#define USE_V200 // Compile for V200
// #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
#define MIN_AMS 100 // Compile for AMS 1.00 or higher
#define SAVE_SCREEN // Save/Restore LCD Contents
#include <tigcclib.h> // Include All Header Files
// Main Function
void _main(void)
{
HANDLE dialoghd = DialogNewSimple(CALCULATOR?200:140,CALCULATOR?80:70);
HANDLE popuphd_list[3] = {PopupNew(NULL,0),PopupNew(NULL,0),PopupNew(NULL,0)}; // creates 3 popups
short i,index;
char * ptr = NULL;
const char s1[] = "1 Player";
const char s2[] = "2 Players";
const char s3[] = "Low";
const char s4[] = "Medium";
const char s5[] = "High";
const char s6[] = "Little";
const char s7[] = "Great";
const char * menu_str[3][4] = {{s3,s4,s5,NULL},{s6,s4,s7,NULL},{s1,s2,NULL,NULL}};
const char menu_txt_92[3][18] = {{"Fragmentation....\0"},{"Size.............\0"},{"Game type........\0"}};
const char menu_txt_89[3][28] = {{"Fragmentation ...\0"},{"Size ....................\0"},{"Game type .........\0"}};
static short menu_defaults[3] = {2,2,1}; // medium, medium, 1 player
DialogAddTitle(dialoghd,"Mosaic",BT_OK,BT_CANCEL);
DialogAddText(dialoghd,6,12,"Mosaic: enter settings");
for(index=3;index--; )
{
i=0;
while((ptr=(char*)menu_str[index][i++])) PopupAddText(popuphd_list[index],-1,ptr,i); // while the string's not null, add it to the current popup
DialogAddPulldown(dialoghd,21,40+8*(-index)+1,CALCULATOR?menu_txt_92[index]:menu_txt_89[index],popuphd_list[index],index); // add a pulldown
}
index=DialogDo(dialoghd,CENTER,CENTER,NULL,menu_defaults); // display the dialog
HeapFree(dialoghd); // free the dialog's handle
for(i=3;i--;HeapFree(popuphd_list[i])); // free the popups' handles
}