1 #ifndef __DIALOGS 2 #define __DIALOGS 3 4 #include <default.h> 5 6 #define DialogAddScroll(h,x,y,w,g,f,t,p,u,m) DialogAdd(h,0,x,y,3,(short)w,(short)g,(short)f,(short)t,(short)p,(short)u,(short)m) 7 8 /* Begin Auto-Generated Part */ 9 #define CENTER (-1) 10 enum DialogMessages{DB_CONTINUE=1,DB_MEMFULL=-1,DB_QACTIVE=-2 11 #if MIN_AMS>=200 12 ,DB_REDRAW=-3 13 #endif 14 ,DB_REDRAW_AND_CONTINUE=-4,DB_UNKNOWN=-5,DB_GET_EDIT_HANDLE=-6,DB_GET_TITLE=-7,DB_EXIT=-8}; 15 #define H_NULL 0 16 #define NULL ((void*)0) 17 #ifndef __HAVE_Bool 18 #define __HAVE_Bool 19 enum Bool{FALSE,TRUE}; 20 #endif 21 #ifndef __HAVE_ESQ 22 #define __HAVE_ESQ 23 typedef unsigned char ESQ; 24 #endif 25 #ifndef __HAVE_HANDLE 26 #define __HAVE_HANDLE 27 typedef unsigned short HANDLE; 28 #endif 29 #ifndef __HAVE_HSym 30 #define __HAVE_HSym 31 typedef struct{HANDLE folder;unsigned short offset;}HSym; 32 #endif 33 #ifndef __HAVE_SCR_RECT 34 #define __HAVE_SCR_RECT 35 typedef union{struct{unsigned char x0,y0,x1,y1;}xy;unsigned long l;}SCR_RECT; 36 #endif 37 #ifndef __HAVE_SCR_STATE 38 #define __HAVE_SCR_STATE 39 typedef struct{void*ScrAddr;unsigned char XMax,YMax;short CurFont,CurAttr,CurX,CurY;SCR_RECT CurClip;}SCR_STATE; 40 #endif 41 #ifndef __HAVE_WINDOW 42 #define __HAVE_WINDOW 43 typedef struct WindowStruct{unsigned short Flags;unsigned char CurFont;unsigned char CurAttr;unsigned char Background;short TaskId;short CurX,CurY;short CursorX,CursorY;SCR_RECT Client;SCR_RECT Window;SCR_RECT Clip;SCR_RECT Port;unsigned short DupScr;struct WindowStruct*Next;char*Title;SCR_STATE savedScrState;unsigned char Reserved[16];}WINDOW; 44 #endif 45 #ifndef __HAVE_Buttons 46 #define __HAVE_Buttons 47 enum Buttons{BT_NONE=0,BT_OK=1,BT_SAVE=2,BT_YES=3,BT_CANCEL=4,BT_NO=5,BT_GOTO=6}; 48 #endif 49 typedef CALLBACK short(*Dialog_Callback_t)(short Message,long Value); 50 #define DialogNew_t Dialog_Callback_t 51 typedef CALLBACK HANDLE(*Dialog_GetHandle_t)(short ID); 52 typedef struct{unsigned char Type;unsigned char Flags;unsigned char x0,y0;union{struct{void*Menu;unsigned char MaxMenuWidth;}dMenu;struct{short oText;void*PopUp;unsigned short oIndex;}dPopUp;struct{short oText;HANDLE(*GetPopUp)(unsigned short);unsigned short oIndex;}dDynPopUp;struct{short oText;HANDLE hPopUp;unsigned short dummy;unsigned short oIndex;}dHPopUp;struct DEditType{short oText;unsigned short bOffset;unsigned short Flen;unsigned char Dlen;}dEdit;struct{short oText;}dText;struct{short oText;unsigned char lButton,rButton;}dHeader;struct{short oIcon;}dIcon;struct{unsigned char x1,y1;unsigned char Index0,Index1;unsigned char NumDspFields,TotNumFields;unsigned char FieldHeight;}dScrollR;struct{unsigned short xFlags[4];}dFlags;}f;}DIALOG_ITEM; 53 #define DIALOG_ITEMS DIALOG_ITEM 54 typedef struct{unsigned short TextOffset;unsigned short NumItems;unsigned char Width,Height;Dialog_Callback_t CallBack;DIALOG_ITEM Fields[];}DIALOG; 55 enum DialogFlags{DF_TAB_ELLIPSES=0x01 56 #if MIN_AMS>=200 57 ,DF_MAX_MENU_WIDTH=0x01 58 #endif 59 ,DF_SCROLLABLE=0x02,DF_CLR_ON_REDRAW=0x04 60 #if MIN_AMS>=200 61 ,DF_TAB_SPACES=0x04,DF_OWNER_DRAW=0x08,DF_POPUP_RADIO=0x20 62 #endif 63 ,DF_SCREEN_SAVE=0x40,DF_SKIP=0x80}; 64 enum DialogTypes{D_END=0,D_MENU=1,D_EDIT_FIELD=2,D_SCROLL_REGION=3,D_OPTION=4,D_RADIO=5,D_BUTTON=6,D_TEXT=7,D_HEADER=8,D_POPUP=10,D_DYNPOPUP=11,D_HEDIT=12,D_DYNHEADER=13,D_HPOPUP=14,D_XFLAGS=15}; 65 typedef struct{DIALOG_ITEM*Item;WINDOW*pW;}OWNER_DRAW_STRUCT; 66 #define Dialog ({__need_in_use_bit;_rom_call(short,(DIALOG*,short,short,char*,__pshort),30);}) 67 #define DialogAdd _rom_call(HANDLE,(HANDLE,short,short,short,short,...),33) 68 #define DialogAddDynamicRequest(h,f,x,y,l,w) DialogAdd(h,f,x,y,D_HEDIT,(char*)(l),(short)(w)) 69 #define DialogAddPulldown(h,x,y,t,p,i) DialogAdd(h,2,x,y,14,(const char*)(t),(short)(p),(short)(i)) 70 #define DialogAddPulldownEx(h,f,x,y,t,p,i) DialogAdd(h,f,x,y,D_HPOPUP,(char*)(t),(short)(p),(short)(i)) 71 #define DialogAddRequest(h,x,y,t,o,m,w) DialogAdd(h,0,x,y,2,(const char*)(t),(short)(o),(short)(m),(short)(w)) 72 #define DialogAddRequestEx(h,f,x,y,t,o,m,w) DialogAdd(h,f,x,y,D_EDIT_FIELD,(char*)(t),(short)(o),(short)(m),(short)(w)) 73 #define DialogAddScrollRegion(h,f,x,y,w,g,z,t,p,u,m) DialogAdd(h,f,x,y,D_SCROLL_REGION,(short)(w),(short)(g),(short)(z),(short)(t),(short)(p),(short)(u),(short)(m)) 74 #define DialogAddStaticPulldown(h,f,x,y,l,p,i) DialogAdd(h,f,x,y,D_POPUP,(char*)(l),(void*)(p),(unsigned short)(i)) 75 #define DialogAddText(h,x,y,t) DialogAdd(h,0,x,y,7,(const char*)(t)) 76 #define DialogAddTextEx(h,f,x,y,t) DialogAdd(h,f,x,y,D_TEXT,(char*)(t)) 77 #define DialogAddTitle(h,t,l,r) DialogAdd(h,0,0,0,8,(const char*)(t),(short)(l),(short)(r)) 78 #define DialogAddTitleEx(h,f,t,l,r) DialogAdd(h,f,0,0,D_HEADER,(char*)(t),(short)(l),(short)(r)) 79 #define DialogDo ({__need_in_use_bit;_rom_call(short,(HANDLE,short,short,char*,__pshort),32);}) 80 #define DialogNew _rom_call(HANDLE,(short,short,Dialog_Callback_t),34) 81 #define DialogNewSimple(w,h) DialogNew(w,h,NoCallBack) 82 #define DlgMessage ({__need_in_use_bit;_rom_call(short,(const char*,const char*,short,short),1B4);}) 83 #define HI_WORD(val) ((unsigned short)((val)>>16L)); 84 #define LO_WORD(val) ((unsigned short)(val)) 85 extern short NoCallBack(short,long)__ATTR_TIOS_CALLBACK__; 86 #define VarNew ({__need_in_use_bit;_rom_call(HSym,(const ESQ*,...),28E);}) 87 #define VarOpen ({__need_in_use_bit;_rom_call(HSym,(const ESQ*,...),28C);}) 88 #define VarSaveAs ({__need_in_use_bit;_rom_call(HSym,(const ESQ*,const char*,...),28D);}) 89 #define SIZED_DIALOG(NumbItems,StrLen) struct{unsigned short TextOffset;unsigned short NumItems;unsigned char Width,Height;Dialog_Callback_t Callback;DIALOG_ITEM Fields[(NumbItems)+1];char String[StrLen];} 90 #if MIN_AMS>=200 91 enum DialogXFlags{XF_ALLOW_VARLINK=0x0001,XF_TE_REPAINT=0x0002,XF_NO_ALPHA_LOCK=0x0004,XF_VARLINK_SELECT_ONLY=0x8001}; 92 #define DialogAddDynamicPulldown(h,f,x,y,l,g,i) DialogAdd((h),(f),(x),(y),D_DYNPOPUP,(const char*)(l),(short*)(g),(short)(i)) 93 #define DialogAddMenu(h,f,x,y,m,w) DialogAdd(h,f,x,y,D_MENU,(void*)(m),(unsigned short)(w)) 94 #define DialogAddXFlags(h,f,u,v,w,x) DialogAdd(h,f,0,0,D_XFLAGS,(unsigned short)(u),(unsigned short)(v),(unsigned short)(w),(unsigned short)(x)) 95 #endif 96 /* End Auto-Generated Part */ 97 98 #endif 99