/* WinAbout.c ** ** SCRAMmer V37.3 - 27th Aug 1992 ** ------------------------------ ** ** Copyright (c) Giuliano C. Peritore ** Via Amaseno, 6 ** 04100 Latina ** ITALY ** ** Phone: (+39) 773 491692 Voice Only ** EMAIL mc6040@mclink.it */ #include #include #include #include #include #include #include #include #include #include #include "SCRAMmer.h" VOID ShadowText(UWORD ,UWORD, struct RastPort *,char *msg); VOID NormalText(UWORD ,UWORD, struct RastPort *,char *msg); LONG request_user(struct Window *,char *, char *, char *); VOID CloseWindowSafely(struct Window *); IMPORT struct IntuitionBase *IntuitionBase; IMPORT struct GfxBase *GfxBase; IMPORT struct Window *main_window; IMPORT struct Screen *def_pub_scr; IMPORT struct MsgPort *userport; IMPORT struct TextFont *tf; IMPORT struct TextAttr ta; IMPORT UWORD xfnt,yfnt,bfnt; IMPORT APTR vi; struct Window *about_win=0; static struct RastPort *rport; VOID refresh_about(VOID) { struct RastPort *rport; rport=about_win->RPort; ShadowText(X_SEP,Y_SEP+bfnt, rport,GetString(MSG_ABOUT1)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*2, rport,GetString(MSG_ABOUT2)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*3, rport,GetString(MSG_ABOUT3)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*4, rport,GetString(MSG_ABOUT4)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*5, rport,GetString(MSG_ABOUT5)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*6, rport,GetString(MSG_ABOUT6)); ShadowText(X_SEP,Y_SEP+bfnt+yfnt*8, rport,GetString(MSG_ABOUT7)); } VOID open_about(VOID) { UWORD w,h; w=(X_SEP*2) + 30*xfnt + (def_pub_scr->WBorLeft) + (def_pub_scr->WBorRight); h=(Y_SEP*2) + 9*yfnt + (def_pub_scr->WBorBottom) + (def_pub_scr->WBorTop) + (def_pub_scr->Font->ta_YSize) + 1; if(about_win=OpenWindowTags(NULL, WA_Left, (def_pub_scr->Width-w)>>1, WA_Top, (def_pub_scr->Height-h)>>1, WA_Width, w, WA_Height, h, WA_Flags, WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_CLOSEGADGET|WFLG_ACTIVATE|WFLG_RMBTRAP|WFLG_GIMMEZEROZERO|WFLG_SIMPLE_REFRESH, WA_AutoAdjust, FALSE, WA_IDCMP, NULL, WA_Title, GetString(MSG_ABOUTWIN), WA_PubScreen, def_pub_scr,TAG_END)) { SetFont(about_win->RPort,tf); about_win->UserPort=userport; ModifyIDCMP(about_win,IDCMP_CLOSEWINDOW|IDCMP_REFRESHWINDOW); refresh_about(); } else request_user(main_window,GetString(MSG_SCRAMMER),GetString(MSG_NOWINDOW),GetString(MSG_CANCEL)); } VOID close_about(VOID) { if(about_win) { CloseWindowSafely(about_win); about_win=0; } }