home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / graphics / fractals / cloudsaga / cloudsgui.mod < prev    next >
Text File  |  1995-02-27  |  16KB  |  480 lines

  1. MODULE CloudsGUI;
  2.  
  3. (*
  4.  *  Source generated with GadToolsBox V2.0b
  5.  *  which is (c) Copyright 1991-1993 Jaba Development
  6.  *  Oberon-Sourcecode-Generator by Kai Bolay (AMOK)
  7.  *
  8.  *  GUI Designed by : Danny Amor
  9.  *)
  10.  
  11. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- $TypeChk- *)
  12.  
  13. IMPORT
  14.  e: Exec, I: Intuition, gt: GadTools, g: Graphics, u: Utility, y: SYSTEM, a: ASL, req: Requests;
  15.  
  16. CONST
  17.   GDSize                            * = 0;
  18.   GDCreate                          * = 1;
  19.   GDAnimate                         * = 2;
  20.   GDSmooth                          * = 3;
  21.   GDSave                            * = 4;
  22.   GDScreen                          * = 5;
  23.   GDPARED                           * = 0;
  24.   GDPAGREEN                         * = 1;
  25.   GDPABLUE                          * = 2;
  26.   GDPAPALETTE                       * = 3;
  27.   GDPAOK                            * = 4;
  28.   GDPALOAD                          * = 5;
  29.   GDPASAVE                          * = 6;
  30.   GDPARESET                         * = 7;
  31.   GDPACANCEL                        * = 8;
  32.  
  33. CONST
  34.   CloudsCNT = 6;
  35.   CloudsLeft = 106;
  36.   CloudsTop = 20;
  37.   CloudsWidth = 106;
  38.   CloudsHeight = 103;
  39.   PaletteCNT = 9;
  40.   PaletteLeft = 10;
  41.   PaletteTop = 15;
  42.   PaletteWidth = 338;
  43.   PaletteHeight = 159;
  44. VAR
  45.   Scr*: I.ScreenPtr;
  46.   VisualInfo*: e.APTR;
  47.   CloudsWnd*: I.WindowPtr;
  48.   PaletteWnd*: I.WindowPtr;
  49.   CloudsGList*: I.GadgetPtr;
  50.   CloudsGadgets*: ARRAY CloudsCNT OF I.GadgetPtr;
  51.   PaletteGList*: I.GadgetPtr;
  52.   PaletteGadgets*: ARRAY PaletteCNT OF I.GadgetPtr;
  53.   Font*: g.TextAttrPtr;
  54.   Attr*: g.TextAttr;
  55.   FontX, FontY*: INTEGER;
  56.   OffX, OffY: INTEGER;
  57.   Menu*: I.MenuPtr;
  58.  
  59. TYPE
  60.   Size0LArray = ARRAY     5 OF e.STRPTR;
  61. CONST
  62.   Size0Labels = Size0LArray (
  63.     y.ADR ("25"),
  64.     y.ADR ("50"),
  65.     y.ADR ("75"),
  66.     y.ADR ("100"),
  67.     NIL );
  68.  
  69. TYPE
  70.   CloudsGTypesArray = ARRAY CloudsCNT OF INTEGER;
  71. CONST
  72.   CloudsGTypes = CloudsGTypesArray (
  73.     gt.cycleKind,
  74.     gt.buttonKind,
  75.     gt.buttonKind,
  76.     gt.buttonKind,
  77.     gt.buttonKind,
  78.     gt.buttonKind
  79.   );
  80.  
  81. TYPE
  82.   CloudsNGadArray = ARRAY CloudsCNT OF gt.NewGadget;
  83. CONST
  84.   CloudsNGad = CloudsNGadArray (
  85.     43, 2, 59, 15, y.ADR ("Si_ze"), NIL, GDSize, LONGSET {gt.placeTextLeft} ,NIL, NIL,
  86.     3, 19, 99, 15, y.ADR ("_Create"), NIL, GDCreate, LONGSET {gt.placeTextIn} ,NIL, NIL,
  87.     3, 35, 99, 15, y.ADR ("_Palette"), NIL, GDAnimate, LONGSET {gt.placeTextIn} ,NIL, NIL,
  88.     3, 51, 99, 15, y.ADR ("S_mooth"), NIL, GDSmooth, LONGSET {gt.placeTextIn} ,NIL, NIL,
  89.     3, 67, 99, 15, y.ADR ("_Save"), NIL, GDSave, LONGSET {gt.placeTextIn} ,NIL, NIL,
  90.     3, 83, 99, 15, y.ADR ("Sc_reen"), NIL, GDScreen, LONGSET {gt.placeTextIn} ,NIL, NIL
  91.   );
  92.  
  93. TYPE
  94.   CloudsGTagsArray = ARRAY    20 OF u.Tag;
  95. CONST
  96.   CloudsGTags * = CloudsGTagsArray (
  97.     gt.underscore, ORD ('_'), gt.cyLabels, y.ADR (Size0Labels[0]), u.done,
  98.     gt.underscore, ORD ('_'), u.done,
  99.     gt.underscore, ORD ('_'), u.done,
  100.     gt.underscore, ORD ('_'), u.done,
  101.     gt.underscore, ORD ('_'), u.done,
  102.     gt.underscore, ORD ('_'), u.done
  103.   );
  104. TYPE
  105.   PaletteGTypesArray = ARRAY PaletteCNT OF INTEGER;
  106. CONST
  107.   PaletteGTypes = PaletteGTypesArray (
  108.     gt.sliderKind,
  109.     gt.sliderKind,
  110.     gt.sliderKind,
  111.     gt.paletteKind,
  112.     gt.buttonKind,
  113.     gt.buttonKind,
  114.     gt.buttonKind,
  115.     gt.buttonKind,
  116.     gt.buttonKind
  117.   );
  118.  
  119. TYPE
  120.   PaletteNGadArray = ARRAY PaletteCNT OF gt.NewGadget;
  121. CONST
  122.   PaletteNGad = PaletteNGadArray (
  123.     83, 8, 242, 13, y.ADR ("Red:    "), NIL, GDPARED, LONGSET {gt.placeTextLeft,gt.highLabel} ,NIL, NIL,
  124.     83, 25, 242, 13, y.ADR ("Green:  "), NIL, GDPAGREEN, LONGSET {gt.placeTextLeft,gt.highLabel} ,NIL, NIL,
  125.     83, 42, 242, 13, y.ADR ("Blue:   "), NIL, GDPABLUE, LONGSET {gt.placeTextLeft,gt.highLabel} ,NIL, NIL,
  126.     11, 88, 314, 47, y.ADR ("_Palette"), NIL, GDPAPALETTE, LONGSET {gt.placeTextAbove} ,NIL, NIL,
  127.     4, 141, 91, 14, y.ADR ("_OK"), NIL, GDPAOK, LONGSET {gt.placeTextIn} ,NIL, NIL,
  128.     83, 58, 76, 14, y.ADR ("_Load..."), NIL, GDPALOAD, LONGSET {gt.placeTextIn} ,NIL, NIL,
  129.     166, 58, 76, 14, y.ADR ("_Save..."), NIL, GDPASAVE, LONGSET {gt.placeTextIn} ,NIL, NIL,
  130.     249, 58, 76, 14, y.ADR ("_Reset"), NIL, GDPARESET, LONGSET {gt.placeTextIn} ,NIL, NIL,
  131.     243, 142, 91, 14, y.ADR ("_Cancel"), NIL, GDPACANCEL, LONGSET {gt.placeTextIn} ,NIL, NIL
  132.   );
  133.  
  134. TYPE
  135.   PaletteGTagsArray = ARRAY    63 OF u.Tag;
  136. VAR PaletteGTags: PaletteGTagsArray;
  137.  
  138. TYPE
  139.   DriPenArray = ARRAY     1 OF INTEGER;
  140. CONST
  141.   DriPens = DriPenArray (-1);
  142.  
  143. TYPE
  144.   MenuArray = ARRAY     5 OF gt.NewMenu;
  145. CONST
  146.   NewMenu = MenuArray (
  147.     gt.title, y.ADR ("Project"), NIL, {}, y.VAL (LONGSET, 0), NIL,
  148.     gt.item, y.ADR ("About..."), y.ADR ("A"), {}, y.VAL (LONGSET, 0), NIL,
  149.     gt.item, gt.barLabel, NIL, {}, LONGSET {}, NIL,
  150.     gt.item, y.ADR ("Quit..."), y.ADR ("Q"), {}, y.VAL (LONGSET, 0), NIL,
  151.     gt.end, NIL, NIL, {}, LONGSET {}, NIL);
  152.  
  153.  
  154. PROCEDURE ComputeX (value: INTEGER): INTEGER;
  155. BEGIN
  156.   RETURN ((FontX * value) + 4 ) DIV 8;
  157. END ComputeX;
  158.  
  159. PROCEDURE ComputeY (value: INTEGER): INTEGER;
  160. BEGIN
  161.   RETURN ((FontY * value)  + 4 ) DIV 8;
  162. END ComputeY;
  163.  
  164. PROCEDURE ComputeFont (width, height: INTEGER; VAR Scr: I.ScreenPtr);
  165. BEGIN
  166.   Font := y. ADR (Attr);
  167.   Font^.name := Scr^.rastPort.font^.message.node.name;
  168.   FontY := Scr^.rastPort.font^.ySize;
  169.   Font^.ySize := FontY;
  170.   FontX := Scr^.rastPort.font^.xSize;
  171.  
  172.   OffX := Scr^.wBorLeft;
  173.   OffY := Scr^.rastPort.txHeight + Scr^.wBorTop + 1;
  174.  
  175.   IF (width # 0) AND (height # 0) AND
  176.      (ComputeX (width) + OffX + Scr^.wBorRight > Scr^.width) OR
  177.      (ComputeY (height) + OffY + Scr^.wBorBottom > Scr^.height) THEN
  178.     Font^.name := y.ADR ("topaz.font");
  179.     Font^.ySize := 8;
  180.     FontY := Font^.ySize;
  181.     FontX := Font^.ySize;
  182.   END;
  183. END ComputeFont;
  184.  
  185. PROCEDURE SetupScreen*(VAR depth,resx,resy: LONGINT): INTEGER;
  186.  
  187. VAR Req                : UNTRACED POINTER TO a.ScreenModeRequester;
  188.     DisplayID          : LONGINT;
  189.     Ok                 : BOOLEAN;
  190.  
  191. BEGIN
  192.   IF a.asl.version>37 THEN
  193.     IF a.asl#NIL THEN
  194.       Req := a.AllocAslRequestTags(a.screenModeRequest,
  195.                                    a.doOverscanType,1,
  196.                                    a.doAutoScroll,1,
  197.                                    a.doHeight,1,
  198.                                    a.doWidth,1,
  199.                                    a.doDepth,1,
  200.                                    a.initialDisplayID,g.euro72ProductKey,
  201.                                    a.initialDisplayWidth,656,
  202.                                    a.initialDisplayHeight,414,
  203.                                    a.initialDisplayDepth,depth,
  204.                                    a.smMinDepth,5,
  205.                                    a.smMaxDepth,7,
  206.                                    u.done);
  207.       IF Req#NIL THEN
  208.         Ok:=a.AslRequest(Req,NIL);
  209.         IF Ok THEN
  210.           DisplayID := Req^.displayID;
  211.           resx      := Req^.displayWidth;
  212.           resy      := Req^.displayHeight;
  213.           depth     := Req^.displayDepth;
  214.  
  215.           Scr := I.OpenScreenTagsA (NIL, I.saLeft,          0,
  216.                                          I.saTop,           0,
  217.                                          I.saWidth,         resx,
  218.                                          I.saHeight,        resy,
  219.                                          I.saDepth,         depth,
  220.                                          I.saType,          LONGSET{0..3},
  221.                                          I.saDisplayID,     DisplayID,
  222.                                          I.saAutoScroll,    I.LTRUE,
  223.                                          I.saOverscan,      I.oScanText,
  224.                                          I.saPens,          y.ADR (DriPens[0]),
  225.                                          I.saTitle,         y.ADR ("CloudsAGA 1.0 © Danny Amor in 1994"),
  226.                                     u.done);
  227.           IF Scr = NIL THEN RETURN 1 END;
  228.  
  229.           ComputeFont (0, 0, Scr);
  230.  
  231.           VisualInfo := gt.GetVisualInfo (Scr, u.done);
  232.           IF VisualInfo = NIL THEN RETURN 2 END;
  233.         ELSE RETURN 5 END;
  234.       END;
  235.     END;
  236.   ELSE
  237.     IF g.base.libNode.version>36 THEN
  238.       Ok:=req.Request("Clouds Request:","You only have Workbench 2.0!\nYou can only choose between high\nand low resolution!","High","Low");
  239.       depth:=5;
  240.       resx:=320;
  241.       resy:=256;
  242.       DisplayID:=g.loresKey+g.palMonitorID;
  243.       IF Ok THEN resy:=512; DisplayID:=g.loresLaceKey+g.palMonitorID; END;
  244.       Scr := I.OpenScreenTagsA (NIL, I.saLeft,          0,
  245.                                      I.saTop,           0,
  246.                                      I.saWidth,         resx,
  247.                                      I.saHeight,        resy,
  248.                                      I.saDepth,         depth,
  249.                                      I.saType,          LONGSET{0..3},
  250.                                      I.saDisplayID,     DisplayID,
  251.                                      I.saAutoScroll,    I.LTRUE,
  252.                                      I.saPens,          y.ADR (DriPens[0]),
  253.                                      I.saTitle,         y.ADR ("CloudsAGA 1.0 © Danny Amor in 1994"),
  254.                                      u.done);
  255.           IF Scr = NIL THEN RETURN 1 END;
  256.  
  257.           ComputeFont (0, 0, Scr);
  258.  
  259.           VisualInfo := gt.GetVisualInfo (Scr, u.done);
  260.           IF VisualInfo = NIL THEN RETURN 2 END;
  261.     ELSE
  262.       req.Fail("Sorry, you need Amiga-OS 2.0 or higher!");
  263.     END;
  264.   END;
  265.   RETURN 0;
  266. END SetupScreen;
  267.  
  268. PROCEDURE CloseDownScreen* (VAR scr : I.ScreenPtr);
  269. BEGIN
  270.   IF VisualInfo # NIL THEN
  271.     gt.FreeVisualInfo (VisualInfo);
  272.     VisualInfo := NIL;
  273.   END;
  274.   IF Scr # NIL THEN
  275.     IF I.CloseScreen (Scr) THEN END;
  276.     Scr := NIL;
  277.   END;
  278. END CloseDownScreen;
  279.  
  280. PROCEDURE OpenCloudsWindow* (VAR CloudsWnd: I.WindowPtr; VAR Scr: I.ScreenPtr): INTEGER;
  281.  
  282.  
  283. VAR
  284.   ng: gt.NewGadget;
  285.   gad: I.GadgetPtr;
  286.   help: u.TagListPtr;
  287.   lc, tc, lvc, offx, offy: INTEGER;
  288.   wleft, wtop: INTEGER;
  289.  
  290. BEGIN
  291.   wleft := CloudsLeft; wtop := CloudsTop;
  292.  
  293.   ComputeFont (CloudsWidth, CloudsHeight,Scr);
  294.  
  295.   wleft := Scr^.width - ComputeX(CloudsWidth);
  296.   wtop := OffY;
  297.  
  298.   Menu := gt.CreateMenus (NewMenu, gt.mnNewLookMenus, 1,u.done);
  299.   IF Menu = NIL THEN RETURN 3 END;
  300.  
  301.   IF NOT gt.LayoutMenus (Menu, VisualInfo, gt.mnTextAttr, Font, u.done) THEN RETURN 4 END;
  302.  
  303.   gad := gt.CreateContext (CloudsGList);
  304.   IF gad = NIL THEN RETURN 1 END;
  305.  
  306.   lc := 0; tc := 0; lvc := 0;
  307.  
  308.   WHILE lc < CloudsCNT DO
  309.     ng := CloudsNGad[lc];
  310.     ng.visualInfo := VisualInfo;
  311.     ng.textAttr   := Font;
  312.     ng.leftEdge   := OffX + ComputeX (ng.leftEdge);
  313.     ng.topEdge    := OffY + ComputeY (ng.topEdge);
  314.     ng.width      := ComputeX (ng.width);
  315.     ng.height     := ComputeY (ng.height);
  316.  
  317.     help := u.CloneTagItems (y.VAL (u.TagListPtr, y.ADR (CloudsGTags[tc])));
  318.     IF help = NIL THEN RETURN 8 END;
  319.     gad := gt.CreateGadgetA (CloudsGTypes[lc], gad, ng, help^ );
  320.     IF gad = NIL THEN RETURN 2 END;
  321.     u.FreeTagItems (help);
  322.     CloudsGadgets[lc] := gad;
  323.  
  324.     WHILE CloudsGTags[tc] # u.done DO INC (tc, 2) END;
  325.     INC (tc);
  326.  
  327.     lc:=lc+1; (* INC (lc); *)
  328.   END; (* WHILE *)
  329.  
  330.   CloudsWnd := I.OpenWindowTagsA ( NIL,
  331.                     I.waLeft,          wleft,
  332.                     I.waTop,           wtop,
  333.                     I.waWidth,         ComputeX(CloudsWidth) + OffX + Scr^.wBorRight,
  334.                     I.waHeight,        ComputeY(CloudsHeight) + OffY + Scr^.wBorBottom,
  335.                     I.waIDCMP,         gt.cycleIDCMP+gt.buttonIDCMP+LONGSET {I.closeWindow,I.refreshWindow,I.vanillaKey,I.menuPick},
  336.                     I.waFlags,         LONGSET {I.windowDrag,I.windowDepth,I.windowClose,I.windowActive,I.newLookMenus},
  337.                     I.waGadgets,       CloudsGList,
  338.                     I.waTitle,         y.ADR ("Clouds"),
  339.                     I.waScreenTitle,   y.ADR ("CloudsAGA 1.0 © Danny Amor in 1994"),
  340.                     I.waCustomScreen,  Scr,
  341.                     u.done);
  342.  
  343.   IF CloudsWnd = NIL THEN RETURN 20 END;
  344.  
  345.   IF NOT I.SetMenuStrip (CloudsWnd, Menu^) THEN RETURN 5 END;
  346.   gt.RefreshWindow (CloudsWnd, NIL);
  347.  
  348.   RETURN 0;
  349.  
  350. END OpenCloudsWindow;
  351.  
  352. PROCEDURE CloseCloudsWindow* (VAR CloudsWnd: I.WindowPtr);
  353. BEGIN
  354.   IF Menu # NIL THEN
  355.     IF CloudsWnd # NIL THEN
  356.       I.ClearMenuStrip (CloudsWnd);
  357.     END;
  358.     gt.FreeMenus(Menu);
  359.     Menu := NIL;
  360.   END;
  361.   IF CloudsWnd # NIL THEN
  362.     I.CloseWindow (CloudsWnd);
  363.     CloudsWnd := NIL;
  364.   END;
  365.   IF CloudsGList # NIL THEN
  366.     gt.FreeGadgets (CloudsGList);
  367.     CloudsGList := NIL;
  368.   END;
  369. END CloseCloudsWindow;
  370.  
  371.  
  372. PROCEDURE PaletteRender*;
  373. BEGIN
  374.   gt.DrawBevelBox(PaletteWnd^.rPort, OffX + ComputeX (4),
  375.                   OffY + ComputeY (4),
  376.                   ComputeX (329),
  377.                   ComputeY (134),
  378.                   gt.visualInfo, VisualInfo, gt.bbRecessed, I.LTRUE, u.done);
  379. END PaletteRender;
  380.  
  381. PROCEDURE OpenPaletteWindow* (depth: LONGINT): INTEGER;
  382.  
  383. VAR
  384.   ng: gt.NewGadget;
  385.   gad: I.GadgetPtr;
  386.   help: u.TagListPtr;
  387.   lc, tc, lvc, offx, offy: INTEGER;
  388.   wleft, wtop, ww, wh: INTEGER;
  389. BEGIN
  390.  PaletteGTags := PaletteGTagsArray (
  391.     gt.slMax, 255, gt.slMaxLevelLen, 4, gt.slLevelFormat, y.ADR ("%2ld"), I.pgaFreedom, I.lorientHoriz, I.gaRelVerify, I.LTRUE, u.done,
  392.     gt.slMax, 255, gt.slMaxLevelLen, 4, gt.slLevelFormat, y.ADR ("%2ld"), I.pgaFreedom, I.lorientHoriz, I.gaRelVerify, I.LTRUE, u.done,
  393.     gt.slMax, 255, gt.slMaxLevelLen, 4, gt.slLevelFormat, y.ADR ("%2ld"), I.pgaFreedom, I.lorientHoriz, I.gaRelVerify, I.LTRUE, u.done,
  394.     gt.paDepth, 5, gt.paIndicatorWidth, 50, gt.paColor, 3, gt.paColorOffset, 0, gt.underscore, ORD ('_'), u.done,
  395.     gt.underscore, ORD ('_'), u.done,
  396.     gt.underscore, ORD ('_'), I.gaDisabled, I.LTRUE, u.done,
  397.     gt.underscore, ORD ('_'), I.gaDisabled, I.LTRUE, u.done,
  398.     gt.underscore, ORD ('_'), u.done,
  399.     gt.underscore, ORD ('_'), u.done
  400.   );
  401.   IF depth#5 THEN PaletteGTags[34]:=depth; END;
  402.   IF g.base.libNode.version<39 THEN
  403.     PaletteGTags[1] :=15;
  404.     PaletteGTags[12]:=15;
  405.     PaletteGTags[23]:=15;
  406.   END;
  407.  
  408.   wleft := PaletteLeft; wtop := PaletteTop;
  409.  
  410.   ComputeFont (PaletteWidth, PaletteHeight, Scr);
  411.  
  412.   ww := ComputeX (PaletteWidth);
  413.   wh := ComputeY (PaletteHeight);
  414.  
  415.   IF wleft + ww + OffX + Scr^.wBorRight > Scr^.width THEN
  416.     wleft := Scr^.width - ww;
  417.   END;
  418.   IF wtop + wh + OffY + Scr^.wBorBottom > Scr^.height THEN
  419.     wtop := Scr^.height - wh;
  420.   END;
  421.   gad := gt.CreateContext (PaletteGList);
  422.   IF gad = NIL THEN RETURN 1 END;
  423.  
  424.   lc := 0; tc := 0; lvc := 0;
  425.   WHILE lc < PaletteCNT DO
  426.     ng := PaletteNGad[lc];
  427.     ng.visualInfo := VisualInfo;
  428.     ng.textAttr   := Font;
  429.     ng.leftEdge   := OffX + ComputeX (ng.leftEdge);
  430.     ng.topEdge    := OffY + ComputeY (ng.topEdge);
  431.     ng.width      := ComputeX (ng.width);
  432.     ng.height     := ComputeY (ng.height);
  433.  
  434.     help := u.CloneTagItems (y.VAL (u.TagListPtr, y.ADR (PaletteGTags[tc])));
  435.     IF help = NIL THEN RETURN 8 END;
  436.     gad := gt.CreateGadgetA (PaletteGTypes[lc], gad, ng, help^ );
  437.     u.FreeTagItems (help);
  438.     IF gad = NIL THEN RETURN 2 END;
  439.     PaletteGadgets[lc] := gad;
  440.  
  441.     WHILE PaletteGTags[tc] # u.done DO INC (tc, 2) END;
  442.     INC (tc);
  443.  
  444.     INC (lc);
  445.   END; (* WHILE *)
  446.   PaletteWnd := I.OpenWindowTagsA ( NIL,
  447.                     I.waLeft,          wleft,
  448.                     I.waTop,           wtop,
  449.                     I.waWidth,         ww + OffX + Scr^.wBorRight,
  450.                     I.waHeight,        wh + OffY + Scr^.wBorBottom,
  451.                     I.waIDCMP,         gt.sliderIDCMP+gt.paletteIDCMP+gt.buttonIDCMP+LONGSET {I.vanillaKey,I.refreshWindow},
  452.                     I.waFlags,         LONGSET {I.windowDrag,I.windowDepth,I.activate,I.rmbTrap},
  453.                     I.waGadgets,       PaletteGList,
  454.                     I.waTitle,         y.ADR ("Edit Screen Palette"),
  455.                     I.waCustomScreen,  Scr,
  456.                     I.waAutoAdjust,    I.LTRUE,
  457.                     u.done);
  458.   IF PaletteWnd = NIL THEN RETURN 20 END;
  459.  
  460.   gt.RefreshWindow (PaletteWnd, NIL);
  461.  
  462.   PaletteRender;
  463.  
  464.   RETURN 0;
  465. END OpenPaletteWindow;
  466.  
  467. PROCEDURE ClosePaletteWindow*;
  468. BEGIN
  469.   IF PaletteWnd # NIL THEN
  470.     I.CloseWindow (PaletteWnd);
  471.     PaletteWnd := NIL;
  472.   END;
  473.   IF PaletteGList # NIL THEN
  474.     gt.FreeGadgets (PaletteGList);
  475.     PaletteGList := NIL;
  476.   END;
  477. END ClosePaletteWindow;
  478.  
  479. END CloudsGUI.
  480.