128 lines
4.7 KiB
C
128 lines
4.7 KiB
C
/* File info.c */
|
|
/* Opens a window with information about the program. */
|
|
|
|
/****************************************************************
|
|
Topograph - A function browser
|
|
Copyright (C) 1996 Marc Culler
|
|
|
|
culler@math.uic.edu
|
|
|
|
Department of Mathematics (M/C 249)
|
|
University of Illinois at Chicago
|
|
851 S. Morgan St.
|
|
Chicago, IL 60607-7045
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
******************************************************************/
|
|
|
|
#include "Topograph.h"
|
|
#include "info.h"
|
|
|
|
void info(void){
|
|
struct Screen *defaultScreen;
|
|
struct Window *infoWindow;
|
|
struct NewGadget ng;
|
|
struct Gadget *prevgadget;
|
|
struct Gadget *infoGadgets;
|
|
struct VisualInfo *infoVisualInfo;
|
|
struct IntuiMessage *infoMessage;
|
|
struct TextAttr helvetica = {"helvetica.font",11,0,FPF_DESIGNED};
|
|
struct TextFont *infoFont;
|
|
|
|
infoFont = OpenDiskFont(&helvetica);
|
|
defaultScreen = LockPubScreen(NULL);
|
|
infoVisualInfo = GetVisualInfo(defaultScreen, TAG_END);
|
|
if (infoVisualInfo != NULL){
|
|
|
|
infoGadgets = NULL;
|
|
prevgadget = CreateContext(&infoGadgets);
|
|
|
|
ng.ng_LeftEdge = 78;
|
|
ng.ng_TopEdge = 206;
|
|
ng.ng_Width = 112;
|
|
ng.ng_Height = 21;
|
|
ng.ng_GadgetText = NULL;
|
|
ng.ng_TextAttr = &helvetica;
|
|
ng.ng_GadgetID = 1;
|
|
ng.ng_Flags = NULL;
|
|
ng.ng_VisualInfo = infoVisualInfo;
|
|
ng.ng_UserData = 0;
|
|
prevgadget = CreateGadget(GENERIC_KIND, prevgadget, &ng,
|
|
TAG_END);
|
|
prevgadget->GadgetType |= GTYP_BOOLGADGET;
|
|
prevgadget->Activation = GACT_RELVERIFY;
|
|
prevgadget->Flags = GFLG_GADGIMAGE | GFLG_GADGHIMAGE;
|
|
prevgadget->GadgetRender = &continueImage;
|
|
prevgadget->SelectRender = &continueAlt;
|
|
|
|
|
|
if (prevgadget != NULL){
|
|
infoWindow = OpenWindowTags(NULL,
|
|
WA_Left, (defaultScreen->Width - 272)/2,
|
|
WA_Top, (defaultScreen->Height - 240)/2,
|
|
WA_Width, 272,
|
|
WA_Height, 240,
|
|
WA_AutoAdjust, TRUE,
|
|
WA_CloseGadget, FALSE,
|
|
WA_IDCMP, IDCMP_RAWKEY | IDCMP_GADGETUP | MXIDCMP,
|
|
WA_Gadgets, infoGadgets,
|
|
WA_SmartRefresh, TRUE,
|
|
WA_Activate, TRUE,
|
|
TAG_DONE);
|
|
|
|
if (infoWindow != NULL){
|
|
|
|
SetFont(infoWindow->RPort,infoFont);
|
|
SetDrMd(infoWindow->RPort, JAM1);
|
|
SetAPen(infoWindow->RPort, 1);
|
|
DrawImage(infoWindow->RPort,&logoImage,32,11);
|
|
Move(infoWindow->RPort, 55, 105);
|
|
Text(infoWindow->RPort, "v1.1 Copyright \2511996 Marc Culler",33);
|
|
Move(infoWindow->RPort, 61, 120);
|
|
Text(infoWindow->RPort, "Send questions or comments to:", 30);
|
|
Move(infoWindow->RPort, 61, 138);
|
|
Text(infoWindow->RPort, "Marc Culler (culler@math.uic.edu)", 33);
|
|
Move(infoWindow->RPort, 61, 151);
|
|
Text(infoWindow->RPort, "Department of Mathematics", 25);
|
|
Move(infoWindow->RPort, 61, 164);
|
|
Text(infoWindow->RPort, "University of Illinois at Chicago", 33);
|
|
Move(infoWindow->RPort, 61, 177);
|
|
Text(infoWindow->RPort, "851 S. Morgan St.", 17);
|
|
Move(infoWindow->RPort, 61, 190);
|
|
Text(infoWindow->RPort, "Chicago, IL 60607-7045", 22);
|
|
|
|
|
|
GT_RefreshWindow(infoWindow,NULL);
|
|
Wait( 1L << infoWindow->UserPort->mp_SigBit);
|
|
while(infoMessage = GT_GetIMsg(infoWindow->UserPort)){
|
|
GT_ReplyIMsg(infoMessage);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (infoWindow) CloseWindow(infoWindow);
|
|
if (infoGadgets) FreeGadgets(infoGadgets);
|
|
if (infoVisualInfo) FreeVisualInfo(infoVisualInfo);
|
|
if (infoFont) CloseFont(infoFont);
|
|
|
|
if (infoWindow == NULL) exit(RETURN_WARN);
|
|
else return;
|
|
}
|
|
|
|
|
|
|