home *** CD-ROM | disk | FTP | other *** search
- #include "aib.h"
- #include "extern.h"
-
- /* prototypes */
-
- int request(char *,char *, char *);
- void FontChoice(int);
- void load_project(void);
- void save_project(void);
-
-
- /* globals */
-
- struct Window *reqwindow;
- struct EasyStruct mine= {
- sizeof(struct EasyStruct),0,
- 0,0,0};
-
-
- /**** request ******************************************************/
- int request(char *title, char *body, char *gads)
- {
- int retval=0;
- int args = 50;
- LONG savedstate;
- mine.es_Title=title;
- mine.es_TextFormat= body;
- mine.es_GadgetFormat = gads;
-
- savedstate = window->IDCMPFlags;
- ModifyIDCMP(window,0);
- retval = EasyRequestArgs( window, &mine, 0L, &args);
- ModifyIDCMP(window,savedstate);
- GT_RefreshWindow(window,NULL);
- return(retval);
- }
-
-
- /******************** FONT REQUEST ******************************************/
-
- void FontChoice (int type)
- {
- LONG savedstate;
- struct TextAttr *test;
- static char Menudeal[256];
-
- FontRequester = (struct FontRequester *)AllocAslRequest(ASL_FontRequest,FontTags);
- if (FontRequester != NULL)
- {
- savedstate = window->IDCMPFlags;
- ModifyIDCMP(window,0);
- if (AslRequest(FontRequester,NULL)) {
- switch (type){
-
- case 1: strcpy(MyFont, FontRequester->fo_Attr.ta_Name);
- GFontSize = FontRequester->fo_Attr.ta_YSize;
- /* topaz80.ta_Style= FontRequester->fo_Attr.ta_Style;
- topaz80.ta_Flags= FontRequester->fo_Attr.ta_Flags; */
-
- GT_SetGadgetAttrs(curr_font,window,NULL,
- GTTX_Text,MyFont,
- TAG_DONE);
- GT_SetGadgetAttrs(font_size,window,NULL,
- GTNM_Number,GFontSize,
- TAG_DONE);
-
- break;
-
- case 2: strcpy(Menudeal,FontRequester->fo_Attr.ta_Name);
- menucta.ta_Name= Menudeal;
- menucta.ta_YSize= FontRequester->fo_Attr.ta_YSize;
- menucta.ta_Style= FontRequester->fo_Attr.ta_Style;
- menucta.ta_Flags= FontRequester->fo_Attr.ta_Flags;
- test = &menucta;
- if (!(CustomMenuFont = OpenDiskFont(test)))
- abort_me("Could not locate font");
-
- GT_SetGadgetAttrs(menu_font,window,NULL,
- GTTX_Text,menucta.ta_Name,
- TAG_DONE);
- GT_SetGadgetAttrs(menu_size,window,NULL,
- GTNM_Number,menucta.ta_YSize,
- TAG_DONE);
-
- break;
- }
-
- }
-
- ModifyIDCMP(window,savedstate);
- FreeAslRequest(FontRequester);
- GT_RefreshWindow(window,NULL);
- }
-
- }
-
-
- /******************************* load request ******************************/
-
- void load_project(void)
- {
- LONG savedstate;
- ULONG dirtag = TAG_IGNORE;
-
- if (AslBase){
- savedstate = window->IDCMPFlags;
- ModifyIDCMP(window,0);
- if ( (FileRequester = AllocAslRequest(ASL_FileRequest,NULL)) )
- AslRequestTags( (APTR) FileRequester,
- ASL_Hail, "Select a .AIB File",
- ASL_OKText,"LOAD",
- ASL_Window,window,
- ASL_Pattern,(ULONG)"#?.AIB",
- TAG_DONE);
-
- ModifyIDCMP(window,savedstate);
- GT_RefreshWindow(window,NULL);
- }
-
-
- }
-
-
- /****************************** save **************************/
- void save_project(void)
- {
- LONG savedstate;
- ULONG dirtag = TAG_IGNORE;
-
- if (AslBase){
- savedstate = window->IDCMPFlags;
- ModifyIDCMP(window,0);
- if ( (FileRequester = AllocAslRequest(ASL_FileRequest,NULL)) )
- if (!(AslRequestTags( (APTR) FileRequester,
- ASL_Hail, "Save with .AIB extension",
- ASL_OKText,"SAVE",
- ASL_Pattern, (ULONG)"#?.AIB",
- ASL_Window,window,
- TAG_DONE)))
-
- abort_me("Could not open requester");
-
- }
-
- ModifyIDCMP(window,savedstate);
- GT_RefreshWindow(window,NULL);
- }
-