home *** CD-ROM | disk | FTP | other *** search
- /* $Revision Header *** Header built automatically - do not edit! ***********
- *
- * (C) Copyright 1991 by Metalworx
- *
- * Name .....: prefs.c
- * Created ..: Mon 07-Oct-91 17:59
- * Revision .: 1
- *
- * Date Author Comment
- * ========= ======== ====================
- * 20-Oct-91 Mtwx Icon f. .CDM und Zeit-Info-Fenster
- * 02-Apr-91 Mtwx Created this file!
- *
- * $Revision Header ********************************************************/
- #define REVISION 1
-
- /***************************************************************************
- * prefs.c: Voreinstellungen des Programmes verΣndern *
- * - BildverhΣltnis *
- * - Icons fⁿr .CDM-Dateien ja/nein *
- * - Icons fuer IFF-Dateien ja/nein *
- * - Screen-Titel-Zeile ja/nein *
- * - Zeit-Info-Fenster ja/nein *
- ***************************************************************************/
-
- /* ------------------------------- Includes ----------------------------- */
-
- #include <math.h>
- #include <stdio.h>
- #include <libraries/arpbase.h>
- #include <proto/intuition.h>
- #include "chem_defs.h"
- #include "prefs.h"
-
- /* ------------------------------- Defines ------------------------------ */
-
- /* ------------------------------- external references ------------------ */
-
- extern USHORT GadgetID;
- extern struct Border StringGBorder2;
- extern struct Window *Window1;
- extern struct Screen *FirstScreen;
-
- extern void SimpleRequest(char*,...);
-
- /* ---------------------------------------------------------------------- */
-
- void prefs(struct ChemPrefs *ChemPrefs)
- {
- int ende=0;
- SHORT SGVec2[]={ 0,11,35,11,35,0 };
- SHORT SGVec1[]={ 0,10,0,0,34,0 };
- struct Border LocalSGBorder1;
- struct Border LocalSGBorder2;
- struct Window *PrefsWindow=NULL;
-
- LocalSGBorder1=StringGBorder1;
- LocalSGBorder2=StringGBorder2;
- LocalSGBorder1.NextBorder=&LocalSGBorder2;
- LocalSGBorder1.XY=SGVec1;
- LocalSGBorder2.XY=SGVec2;
- BVGadget.GadgetRender=(APTR)&LocalSGBorder1;
- PrefsFenster.Screen = FirstScreen;
- sprintf(BVBuffer,"%3.1f",ChemPrefs->bv);
-
- if (!(PrefsWindow = OpenWindow(&PrefsFenster)))
- {
- SimpleRequest(NO_PREFS_WIN);
- return;
- }
- Print(PrefsWindow,YXREL_TEXT,1,0,320,28);
- Print(PrefsWindow,ICONCREAIFF_TEXT,1,0,50,28);
- Print(PrefsWindow,ICONCREACDM_TEXT,1,0,50,43);
- Print(PrefsWindow,TITLE_TEXT,1,0,50,58);
- Print(PrefsWindow,TIME_WINDOW_TEXT,1,0,50,73);
- while(!ende)
- {
- switch(Nachricht(PrefsWindow))
- {
- case CLOSEWINDOW:
- CloseWindowSafely(PrefsWindow,TRUE);
- ende++;
- break;
- case GADGETUP:
- switch(GadgetID)
- {
- case BVERH:
- ChemPrefs->bv=atof(BVBuffer);
- break;
- case ICONCREACDM:
- if(IconCreaCDMGadget.Flags & SELECTED)
- ChemPrefs->IconCreaCDM=TRUE;
- else
- ChemPrefs->IconCreaCDM=FALSE;
- break;
- case ICONCREAIFF:
- if(IconCreaIFFGadget.Flags & SELECTED)
- ChemPrefs->IconCreaIFF=TRUE;
- else
- ChemPrefs->IconCreaIFF=FALSE;
- break;
- case TITEL:
- if(TitleGadget.Flags & SELECTED)
- ChemPrefs->Title=TRUE;
- else
- ChemPrefs->Title=FALSE;
- ShowTitle(FirstScreen,ChemPrefs->Title);
- break;
- case TIMEWINDOW:
- if(TimeWindowGadget.Flags & SELECTED)
- ChemPrefs->TimeWindow=TRUE;
- else
- ChemPrefs->TimeWindow=FALSE;
- break;
- }
- break;
- }
- }
- return;
- }
-