home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- * Copyright (c) 1986, 87, 88 Tim Mooney *
- * also Copyright 1989, 1990 Alan G Baxter *
- * *
- * Data input, screen & HPGL output- TM. Interface, Plt: support & con- *
- * version files- AGB. See docs for distribution restrictions. *
- ***************************************************************************/
-
- /***************************************************************************
- * mp.c - PLOT DATA EMBEDDED IN TEXT FILE *
- * *
- * Mp reads a text file and extracts data from it in a way defined by *
- * interactive gadget selection or by an automatic script. *
- * When the data are collected, mp opens a high-res screen, and plots some*
- * or all of the data . Some of the *
- * details of plotting specifications can be altered in the "Custom Plot" *
- * window callable from menu selection or double click in the main window.*
- ****************************************************************************
- ***************************************************************************/
-
- #include <graphics/display.h>
- #include <libraries/dosextens.h>
- #include <libraries/diskfont.h>
- #include <exec/exec.h>
- #include <exec/types.h>
- #include <intuition/intuitionbase.h>
- #include <graphics/regions.h>
- #include <devices/keymap.h>
- #include <stdio.h>
- #include <workbench/startup.h>
- #include <workbench/workbench.h>
- #include <workbench/icon.h>
- #include <graphics/gfxmacros.h>
- #include <graphics/gfxbase.h>
- #include <math.h>
-
- #define MAIN_MODULE 1
-
- #include "struct.h"
- #include "plotlim.h"
- #include "front.h"
-
- struct IntuitionBase *IntuitionBase; /* Pointer aus exec */
- struct GfxBase *GfxBase;
- struct DiskfontBase *DiskfontBase;
- long IconBase;
-
- struct PlotRegion *FullReg;
-
- int MAXVERT=512; /* Globally declared int allows screen size change */
- int MAXHORIZ=640;
- int CHARWIDTH=8;
- int CHARHEIGHT=8;
- int LMARGIN=57; /* CHARWIDTH x 7 */
- int RMARGIN=2;
- int TMARGIN=8;
- int BMARGIN=24; /* CHARHEIGHT x 3 */
- int XMINP=57; /* LMARGIN */
- int YMAXP=504; /* MAXVERT - TMARGIN */
- int YMINP=24; /* BMARGIN */
- int XMAXP=638; /* (MAXHORIZ-RMARGIN) */
-
- extern short SCRIPT_ON;
- extern short firstcall;
- extern struct Screen *screen;
- extern struct NewScreen newscreen;
- extern struct NewWindow newwindow;
- extern struct MenuItem ErrorBars;
- extern struct TextBox *ExtraText;
-
- #define QUIT 0
- #define GO 1
- #define OFF 0
- #define ON 1
-
- int QuitFrontFlag; /* Quit flag for Front Window requester */
- int KEEP_GOING=1; /* Quit flag for the whole program which all but */
- /* closes the screen when "New" is selected. */
-
- char filename[150], progname[150];
-
- struct RastPort *p;
- struct Pict *Pict;
- int xcol, ycol, ecol;
-
- extern struct ViewPort *vp;
- char StartDir[150];
-
- main(argc,argv)
- int argc;
- union {
- char **args;
- struct WBStartup *msg;
- } argv;
- {
- struct WBArg *arg;
- USHORT WindowOPEN=FALSE, AUTO=FALSE, Overscan=ON; /* Overscan flag can be turned off at start */
- FILE *fp;
- char **ToolArray;
- char *Value;
- struct IntuiMessage *p_message; /* pointer to message */
- struct DiskObject *diskobj;
- void ProcMes(), sexit(), OpenLibraries(), GetBestScreen(), BailOut(), ResetWindow();
- USHORT RunAutoScript();
-
- filename[0] = 0;
- OpenLibraries();
-
-
- /*** PARSE ARGS ***/
- if (argc != 0) { /* called from CLI */
- stcgfp(StartDir,argv.args[0]);
- if (argc>1) {
- if (argv.args[argc-1][0] == '?') {
- printf("usage: MultiPlot [-[O][B#]] [filename]\n");
- exit(0);
- }
- if (argv.args[argc-1][0] != '-') {
- strcpy(filename,argv.args[argc-1]);
- strcpy(Gadget4SIBuff,filename);
- AUTO=TRUE;
- }
- if (argv.args[1][0] == '-') {
- if ((argv.args[1][1] == 'O')||(argv.args[1][1]=='o')) { Overscan=OFF; }
- if ((argv.args[1][1] == 'B')||(argv.args[1][1]=='b')) {
- if (argv.args[1][2] =='1') {newscreen.Depth=1;}
- else if (argv.args[1][2] =='2') {newscreen.Depth=2;}
- else if (argv.args[1][2] =='3') {newscreen.Depth=3;}
- else {newscreen.Depth=4;}
- if ((argv.args[1][3] == 'O')||(argv.args[1][3]=='o')||(argv.args[1][2] == 'O')||(argv.args[1][2]=='o'))
- { Overscan=OFF; }
- }
- }
-
- }
- }
-
- else { /* called from workbench */
- arg = argv.msg->sm_ArgList; /* point to command - find where multiplot lives */
- if (arg->wa_Lock != NULL) {
- getpath(arg->wa_Lock,StartDir);
- if (isdev(StartDir)) strcat(StartDir,":");
- }
- else stcgfp(StartDir,arg->wa_Name);
- arg++;
- if (argv.msg->sm_NumArgs > 1) { /* find where data file lives */
- AUTO=TRUE;
- getpath(arg->wa_Lock,Gadget4SIBuff);
- if (isdev(Gadget4SIBuff)) strcat(Gadget4SIBuff,":");
- strmfp(Gadget4SIBuff,Gadget4SIBuff,arg->wa_Name);
- }
- strmfp(progname,StartDir,"multiplot");
- if (diskobj=GetDiskObject(progname))
- {
- ToolArray=diskobj->do_ToolTypes;
- Value=FindToolType(ToolArray,"OVERSCAN");
- if (MatchToolValue(Value,"OFF")) {Overscan=OFF;}
- Value=FindToolType(ToolArray,"BITPLANES");
- if (MatchToolValue(Value,"1")) {newscreen.Depth=1;}
- else if (MatchToolValue(Value,"2")) {newscreen.Depth=2;}
- else if (MatchToolValue(Value,"3")) {newscreen.Depth=3;}
- else {newscreen.Depth=4;}
- FreeDiskObject(diskobj);
- }
- }
- GetBestScreen(Overscan);
-
- while (KEEP_GOING)
- {
- ResetWindow();
- xcol=1; ycol=2; ecol=0;
-
-
- if (AUTO) AUTO=RunAutoScript();
- if (AUTO) {
- /*** OPEN FILE AND SET UP DUD WINDOW WHILE LOADING ***/
- fp = fopen(filename,"r");
- if (!fp) {
- Message(" Can't open file ");
- CloseScreen(screen);
- sexit(FALSE);
- }
- NewFrontWindow.Screen = screen;
- NewFrontWindow.Title =NULL;
- NewFrontWindow.FirstGadget =NULL;
- if (NewFrontWindow.Flags & BORDERLESS);
- else NewFrontWindow.Flags |= BORDERLESS;
- if (!(FrontWindow = (struct Window *)OpenWindow(&NewFrontWindow)))
- { ErrorAlert(0); CloseScreen(screen); sexit(FALSE); }
- WindowOPEN=TRUE;
- SetPointer(FrontWindow,WaitSprite,26,14,-4,-4);
- SetWindowTitles(FrontWindow,-1," Loading data from file... ");
- AUTO=FALSE; /* So we get the file selector if user wants to open new file */
- }
- else {
- do {
-
- /**** GET REQUESTER WINDOW TO ASK FOR FILE NAME ***/
- if (!WindowOPEN) {
- NewFrontWindow.Screen = screen;
- NewFrontWindow.Title =" Data Selection Window ";
- NewFrontWindow.FirstGadget = &Gadget6;
- if (!(FrontWindow = (struct Window *)OpenWindow(&NewFrontWindow))) {
- ErrorAlert(0);
- CloseScreen(screen);
- sexit(FALSE);
- }
- WindowOPEN=TRUE;
- ActivateGadget(&Gadget4,FrontWindow,0);
- p = FrontWindow->RPort;
- PrintIText(p,&IText2,0,0);
- }
- QuitFrontFlag=GO; /* Reset flag in case not first time ***/
- firstcall=TRUE;
-
- while (QuitFrontFlag !=QUIT) {
- Wait(1l<<FrontWindow->UserPort->mp_SigBit); /* wait for a message */
- while (p_message = (struct IntuiMessage *)GetMsg(FrontWindow->UserPort))
- ProcMes(p_message);
- }
-
- if (!KEEP_GOING) { /* STOP GADGET SELECTED FROM FRONT WINDOW */
- CloseWindow(FrontWindow);
- CloseScreen(screen);
- sexit(FALSE);
- }
-
- /*** GIVE USER SOMETHING TO LOOK AT ***/
- SetPointer(FrontWindow,WaitSprite,26,14,-4,-4);
-
- /*** SALVAGE USER REQUESTS FROM GADGET FIELDS ***/
- strcpy(filename,Gadget4SIBuff);
- xcol=Gadget1SInfo.LongInt;
- ycol=Gadget2SInfo.LongInt;
- ecol=Gadget3SInfo.LongInt;
-
- /*** OPEN FILE ***/
- if (strlen(filename)) {
- fp = fopen(filename,"r");
- if (!fp) {
- Message(" Can't open file");
- ClearPointer(FrontWindow);
- }
- else {
- SetWindowTitles(FrontWindow,-1," Checking data in file... ");
- if (!CheckDat(fp, xcol, ycol, ecol)) {
- SetWindowTitles(FrontWindow,-1,newscreen.DefaultTitle);
- ClearPointer(FrontWindow);
- Message(" Incorrect file format ");
- (void) fclose(fp);
- fp=NULL;
- }
- }
- }
- else fp=NULL;
- } while (strlen(filename)&&(!fp));
- }
- /*** ALLOCATE/INITIALIZE MEMORY FOR STRUCT PICT ***/
- if (!(Pict = (struct Pict *)AllocMem(sizeof(struct Pict),MEMF_CLEAR)))
- {ErrorAlert(0); CloseScreen(screen); sexit(FALSE);}
-
- if ((!(Pict->Tics = (struct Tics *)AllocMem(sizeof(struct Tics),MEMF_CLEAR)))||
- (!(Pict->Tics->xp = (short *)AllocMem(sizeof(short)*MAXTICS,MEMF_CLEAR)))||
- (!(Pict->Tics->x = (FFP *)AllocMem(sizeof(FFP)*MAXTICS,MEMF_CLEAR)))||
- (!(Pict->Tics->yp = (short *)AllocMem(sizeof(short)*MAXTICS,MEMF_CLEAR)))||
- (!(Pict->Tics->y = (FFP *)AllocMem(sizeof(FFP)*MAXTICS,MEMF_CLEAR)))||
- (!(Pict->CurrReg = (struct PlotRegion *)AllocMem(sizeof(struct PlotRegion),MEMF_CLEAR)))||
- (!(Pict->NewReg = (struct PlotRegion *)AllocMem(sizeof(struct PlotRegion),MEMF_CLEAR)))||
- (!(Pict->Title = (struct TextBox *)AllocMem(sizeof(struct TextBox),MEMF_CLEAR)))||
- (!(Pict->XLabel = (struct TextBox *)AllocMem(sizeof(struct TextBox),MEMF_CLEAR)))||
- (!(Pict->YLabel = (struct TextBox *)AllocMem(sizeof(struct TextBox),MEMF_CLEAR))))
- {(void) fclose(fp); BailOut(Pict);}
-
- Pict->XRegionLock = Pict->YRegionLock = FALSE;
- Pict->Axes = TRUE;
- Pict->RMargin=TRUE;
- Pict->Plot = NULL;
- Pict->ErrBar = (ecol != 0);
-
- /*** GET DATA FROM FILE ***/
- if (fp) {
- rewind(fp); /* Get back to beginning of file */
- SetWindowTitles(FrontWindow,-1," Loading data from file... ");
- GetDat(fp, xcol, ycol, ecol, Pict);
- (void) fclose(fp);
- }
-
- else SCRIPT_ON =FALSE;
-
- /*** SORT OUT PLOT SIZE FOR SCALING LATER ****/
- if (!(FullReg= (struct PlotRegion *)AllocMem(sizeof(struct PlotRegion),MEMF_CLEAR)))
- BailOut(Pict);
- GetPlotLimits(Pict,FullReg);
-
- /*** PREPARE MENU STRIP FOR PLOTTING WINDOW ***/
- if (Pict->ErrBar) {if (ErrorBars.Flags & ITEMENABLED); else ErrorBars.Flags |= ITEMENABLED;}
- else {if (ErrorBars.Flags & ITEMENABLED) ErrorBars.Flags &= ~ITEMENABLED;}
-
- /**** GET RID OF FRONT WINDOW ***/
- SetWindowTitles(FrontWindow,-1,newscreen.DefaultTitle);
- CloseWindow(FrontWindow);
- WindowOPEN=FALSE;
-
- if (NewFrontWindow.Flags & BORDERLESS) NewFrontWindow.Flags &= ~BORDERLESS;
-
- /*** PLOT DATA ***/
- plot(Pict);
-
- /*** DEALLOCATE MEMORY ***/
- FreeMemory(Pict);
- }
- /*** GO HOME ***/
- CloseScreen(screen);
- sexit(TRUE);
- }
-
- int isdev(string)
- char *string;
- {
- while ((*string!=':') && (*string!='\0')) string++;
- if (*string==':') return(FALSE);
- else return(TRUE);
- }
-
- void ProcMes(p_message)
- struct IntuiMessage *p_message;
- {
- ULONG MesClass; /* Fields for storing */
- USHORT MesCode; /* intuimessage data */
- APTR Pointer; /* */
- int HandleEvent();
-
- MesClass = p_message->Class; /* Store values */
- MesCode = p_message->Code;
- Pointer = p_message->IAddress;
- ReplyMsg(p_message); /* Reply to message */
- HandleEvent(MesClass,MesCode,Pointer);
- }
-
- int HandleEvent(MesClass,MesCode,Pointer)
- ULONG MesClass; /* Fields for storing */
- USHORT MesCode; /* intuimessage data */
- APTR Pointer; /* */
- {
- struct Process *OurTask;
- struct Window *old_pr_WindowPtr;
- static char drive[150], path[100], node[30], extn[20];
- short len;
-
- if ( MesClass == GADGETDOWN)
- {
- if (Pointer == (APTR)&Gadget6) QuitFrontFlag = QUIT;
- if (Pointer == (APTR)&XDown)
- {
- RemoveGadget(FrontWindow,&Gadget1);
- if (Gadget1SInfo.LongInt<1) {Message(" Column number must be +ve ");}
- else Gadget1SInfo.LongInt=Gadget1SInfo.LongInt-1;
- stci_d(Gadget1SIBuff,Gadget1SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget1,-1L);
- RefreshGadgets(&Gadget1,FrontWindow,NULL);
- }
- if (Pointer == (APTR)&XUp)
- {
- RemoveGadget(FrontWindow,&Gadget1);
- Gadget1SInfo.LongInt=Gadget1SInfo.LongInt+1;
- stci_d(Gadget1SIBuff,Gadget1SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget1,-1L);
- RefreshGadgets(&Gadget1,FrontWindow,NULL);
- }
- if (Pointer == (APTR)&YDown)
- {
- RemoveGadget(FrontWindow,&Gadget2);
- if (Gadget2SInfo.LongInt<2) {Message(" Y Column must exist ");}
- else Gadget2SInfo.LongInt=Gadget2SInfo.LongInt-1;
- stci_d(Gadget2SIBuff,Gadget2SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget2,-1L);
- RefreshGadgets(&Gadget2,FrontWindow,NULL);
- }
- if (Pointer == (APTR)&YUp)
- {
- RemoveGadget(FrontWindow,&Gadget2);
- Gadget2SInfo.LongInt=Gadget2SInfo.LongInt+1;
- stci_d(Gadget2SIBuff,Gadget2SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget2,-1L);
- RefreshGadgets(&Gadget2,FrontWindow,NULL);
- }
- if (Pointer == (APTR)&EDown)
- {
- RemoveGadget(FrontWindow,&Gadget3);
- if (Gadget3SInfo.LongInt<1) {Message(" Column number must be +ve ");}
- else Gadget3SInfo.LongInt=Gadget3SInfo.LongInt-1;
- stci_d(Gadget3SIBuff,Gadget3SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget3,-1L);
- RefreshGadgets(&Gadget3,FrontWindow,NULL);
- }
- if (Pointer == (APTR)&EUp)
- {
- RemoveGadget(FrontWindow,&Gadget3);
- Gadget3SInfo.LongInt=Gadget3SInfo.LongInt+1;
- stci_d(Gadget3SIBuff,Gadget3SInfo.LongInt);
- AddGadget(FrontWindow,&Gadget3,-1L);
- RefreshGadgets(&Gadget3,FrontWindow,NULL);
- }
-
- if (Pointer == (APTR)&Gadget5a)
- {
- KEEP_GOING=FALSE;
- QuitFrontFlag = QUIT;
- return(-1);
- }
- if (Pointer == (APTR)&Gadget5b)
- {
- RemoveGadget(FrontWindow,&Gadget4);
- strcpy(Gadget4SIBuff,"");
- AddGadget(FrontWindow,&Gadget4,-1L);
- RefreshGadgets(&Gadget4,FrontWindow,NULL);
- ActivateGadget(&Gadget4,FrontWindow,0);
- }
- if (Pointer == (APTR)&Gadget5)
- {
- strsfn(Gadget4SIBuff,drive,path,node,extn);
- strcat(drive,path);
- strmfe(node,node,extn);
-
- OurTask = (struct Process *)FindTask(0L);
- old_pr_WindowPtr = (struct Window *)OurTask->pr_WindowPtr;
- OurTask->pr_WindowPtr = (APTR)FrontWindow;
- if (get_fname(FrontWindow,screen,"Select File to Open...",node,drive)==NULL)
- {
- OurTask->pr_WindowPtr = (APTR)old_pr_WindowPtr;
- return(0);
- }
- OurTask->pr_WindowPtr = (APTR)old_pr_WindowPtr;
- RemoveGadget(FrontWindow,&Gadget4);
- strmfp(Gadget4SIBuff,drive,node);
- len =strlen(Gadget4SIBuff);
- Gadget4SInfo.BufferPos=len;
- Gadget4SInfo.DispPos=len-29;
- AddGadget(FrontWindow,&Gadget4,-1L);
- RefreshGadgets(&Gadget4,FrontWindow,NULL);
- ActivateGadget(&Gadget4,FrontWindow,0);
- }
- else ;
- }
- if ( MesClass == RAWKEY) {
- if (MesCode ==196) QuitFrontFlag = QUIT; /* RETURN key RELEASED */
- else if (MesCode ==69) { KEEP_GOING=FALSE; QuitFrontFlag = QUIT; return(-1); } /* ESCAPE key PRESSED */
- }
- return(1);
- }
-
- void OpenLibraries()
- {
- /*** OPEN LIBRARIES ***/
- if (!(IconBase = OpenLibrary("icon.library", 0)))
- { ErrorAlert(1); sexit(FALSE); }
- DiskfontBase = (struct DiskfontBase *) OpenLibrary("diskfont.library",0);
- if( DiskfontBase == NULL )
- { ErrorAlert(2); sexit(FALSE); }
- GfxBase=NULL;
- GfxBase = (struct GfxBase *) OpenLibrary("graphics.library",33);
- if(GfxBase == NULL)
- { ErrorAlert(3); sexit (FALSE); }
- }
-
- void ResetWindow()
- {
- TMARGIN=CHARHEIGHT;
- BMARGIN= (CHARHEIGHT * 3);
- YMINP= BMARGIN;
- YMAXP=MAXVERT - TMARGIN;
- XMAXP=MAXHORIZ-RMARGIN;
- LMARGIN=(7 * CHARWIDTH);
- XMINP=LMARGIN;
- }
-
- void sexit(Err)
- int Err;
- {
- if (IconBase) CloseLibrary(IconBase);
- if (IntuitionBase) CloseLibrary(IntuitionBase);
- if (GfxBase) CloseLibrary(GfxBase);
- if (DiskfontBase) CloseLibrary(DiskfontBase);
- exit(Err);
- }
-
-
- void BailOut(Pict)
- {
- ErrorAlert(0);
- FreeMemory(Pict);
- CloseScreen(screen);
- sexit(FALSE);
- }
-
-
- void GetBestScreen(Overscan)
- USHORT Overscan;
- {
- int x=0,y=0, OldLib=FALSE;
-
- /* SORT OUT SCREEN SIZING -- NOT ALL THAT SIMPLE!! */
- IntuitionBase=NULL;
- IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",33); /* PAL Revision */
- if (IntuitionBase == NULL) {
- OldLib=TRUE;
- IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0);
- if(IntuitionBase == NULL) {
- ErrorAlert(4);
- sexit(FALSE);
- }
- }
- if ( (OldLib==FALSE) && ((GfxBase->DisplayFlags) & PAL ) ) {
- if ( ScreenSize(&x,&y) && (Overscan==ON) && ( (x<=705) && ((y<=281)||((y>=512)&&(y<=562)))))
- {
- if (y<512) y*=2; /* if WB is not interlace, double resolution */
- MAXHORIZ=newscreen.Width=newwindow.Width=x;
- MAXVERT=newscreen.Height=newwindow.Height=y;
- }
- else
- {
- MAXHORIZ=newscreen.Width=newwindow.Width=640;
- MAXVERT=newscreen.Height=newwindow.Height=512;
- }
- }
- else { /* US or old libraries */
- if ( ScreenSize(&x,&y) && (Overscan==ON) && ( (x<=705) && ((y<=225)||((y>=400)&&(y<=450)))))
- {
- if (y<400) y*=2; /* if WB is not interlace, double resolution */
- MAXHORIZ=newscreen.Width=newwindow.Width=x;
- MAXVERT=newscreen.Height=newwindow.Height=y;
- }
- else
- {
- MAXHORIZ=newscreen.Width=newwindow.Width=640;
- MAXVERT=newscreen.Height=newwindow.Height=400;
- }
- }
-
- if (!(screen = (struct Screen *)OpenScreen(&newscreen)))
- {
- ErrorAlert(0);
- sexit(FALSE);
- }
- vp = &screen->ViewPort;
- InitColours();
- }
-
- USHORT RunAutoScript()
- {
- USHORT temp, AUTO=FALSE;
- FILE *fp;
- char cbuf[100], *cb;
-
- strcpy(filename,Gadget4SIBuff);
- if (fp = fopen(filename,"r")) {
-
- /*** CHECK FILE TO SEE IF MULTIPLOT WROTE IT ***/
- while ((AUTO==FALSE)&&(cb = fgets(cbuf,100,fp)))
- {
- if (same(cb,"*AUTOSCRIPT*",12))
- {
- AUTO=TRUE;
- sscanf(cb,"%*s %hd",&temp);
- if (temp) ecol=3;
- }
- }
- fclose(fp);
- }
- return(AUTO);
- }
-
- ScreenSize(x,y)
- int *x;
- int *y;
- {
- struct Screen *WBScreen;
- int result;
-
- WBScreen = (struct Screen *)AllocMem(sizeof(struct Screen),MEMF_CLEAR);
- result = GetScreenData(WBScreen,sizeof(struct Screen),WBENCHSCREEN,NULL);
- *x=WBScreen->Width;
- *y=WBScreen->Height;
- /* printf("%d %d\n",*x,*y); */
- FreeMem(WBScreen,sizeof(struct Screen));
- return(result);
- }
-
- FreeMemory(Pict)
- struct Pict *Pict;
- {
- if (Pict->NewReg) FreeMem(Pict->NewReg,sizeof(struct PlotRegion));
- if (Pict->CurrReg) FreeMem(Pict->CurrReg,sizeof(struct PlotRegion));
- if (Pict->Tics->xp) FreeMem(Pict->Tics->xp,sizeof(short)*MAXTICS);
- if (Pict->Tics->x) FreeMem(Pict->Tics->x,sizeof(FFP)*MAXTICS);
- if (Pict->Tics->yp) FreeMem(Pict->Tics->yp,sizeof(short)*MAXTICS);
- if (Pict->Tics->y) FreeMem(Pict->Tics->y,sizeof(FFP)*MAXTICS);
- if (Pict->Tics) FreeMem(Pict->Tics,sizeof(struct Tics));
- if (Pict->Title) FreeMem(Pict->Title,sizeof(struct TextBox));
- if (Pict->XLabel) FreeMem(Pict->XLabel,sizeof(struct TextBox));
- if (Pict->YLabel) FreeMem(Pict->YLabel,sizeof(struct TextBox));
- if (FullReg) FreeMem(FullReg,sizeof(struct PlotRegion));
- if (Pict) FreeMem(Pict,sizeof(struct Pict));
-
- FreeStructPlot();
- return(0);
- }
-
-
-
-
-