home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 5 / Amoszine 5.adf / LHA_ARCHIVES / COVERSOURCE / image_compressor.lha / IC_Demo.AMOS / IC_Demo.amosSourceCode
Encoding:
AMOS Source Code  |  1995-01-03  |  15.7 KB  |  548 lines

  1. ' ************************************************************************** 
  2. ' *                                                                        * 
  3. ' *                           Image Compressor v1.0                        * 
  4. ' *                                                                        * 
  5. ' *                                                                        * 
  6. ' *                       Copyright ï¿½ 1994 Sixth Sense                     * 
  7. ' *                                                                        * 
  8. ' *                                                                        * 
  9. ' *                          Written by Andrew Smith                       * 
  10. ' *                                                                        * 
  11. ' *                           Exclusive to Amoszine                        * 
  12. ' *                                                                        * 
  13. ' * This program was written to replace the IFF Compactor that is supplied * 
  14. ' * with Easy AMOS and AMOS Professional.  This package was written mainly * 
  15. ' * due to the fact that the one supplied didn't do what I wanted it to do.* 
  16. ' *                                                                        * 
  17. ' ************************************************************************** 
  18.  
  19. ' Set Accessory  
  20.  
  21. PICINMEM=False : PCKED=False
  22. Global PICINMEM,PCKED
  23.  
  24. _INIT
  25. Repeat 
  26.    D=Dialog(1)
  27.    If D=2 Then _LOAD_IFF
  28.    If D=3 Then _LOAD_ABK
  29.    If D=4 Then _LOAD_SABK
  30.    If D=5 Then _LOAD_PPABK
  31.    If D=6 and PICINMEM=False
  32.       _ERROR["You must load an image first"]
  33.    Else If D=6 and PICINMEM
  34.       _PACK_SCREEN[1]
  35.    End If 
  36.    If D=7 and PICINMEM=False
  37.       _ERROR["You must load an image first"]
  38.    Else If D=7 and PICINMEM
  39.       _PACK_SCREEN[2]
  40.    End If 
  41.    If D=8 and PICINMEM=False
  42.       _ERROR["You must load an image first"]
  43.    Else If D=8 and PICINMEM
  44.       _SAVE_IFF
  45.    End If 
  46.    If D=9 and PICINMEM=False
  47.       _ERROR["You must load an image first"]
  48.    Else If D=9 and PCKED=False
  49.       _ERROR["You must pack the image before saving!"]
  50.    Else If D=9 and PICINMEM
  51.       _SAVE_ABK
  52.    End If 
  53.    If D=10 and PICINMEM=False
  54.       _ERROR["You must load an image first"]
  55.    Else If D=10 and PCKED=False
  56.       _ERROR["You must pack the image before saving!"]
  57.    Else If D=10 and PICINMEM
  58.       _SAVE_SABK
  59.    End If 
  60.    If D=11 and PICINMEM=False
  61.       _ERROR["You must load an image first"]
  62.    Else If D=11 and PCKED=False
  63.       _ERROR["You must pack the image before saving!"]
  64.    Else If D=11 and PICINMEM
  65.       _SAVE_PPABK
  66.    End If 
  67.    If D=12 Then _ABOUT
  68.    Multi Wait 
  69. Until D=1 or D=13
  70. Dialog Close 
  71. Erase All 
  72. End 
  73.  
  74. Procedure _INIT
  75.    Resource Screen Open 0,640,190,0
  76.    Cls 0
  77.    A$="BAse 200,0;"
  78.    A$=A$+"BOx 0,0,1,260,190;"
  79.    A$=A$+"BU 1,0,0,24,10,0,0,1;[UNpack 0,0,22;][UNpack 0,0,23; BR 0;]"
  80.    A$=A$+"KY 197,0;"
  81.    A$=A$+"LIne 24,0,28,260; PR 30,1,'Image Compressor v1.0b',7;"
  82.    A$=A$+"BU 2,10,14,240,16,0,0,1;[LIne 0,0,88,240; PR 50,4,'Load an IFF image',2;][LIne 10,14,91,250; PR 60,19,'Load an IFF image',2; BR 0;]"
  83.    A$=A$+"KY 208,0;"
  84.    A$=A$+"BU 3,10,29,240,16,0,0,1;[LIne 0,0,88,240; PR 50,4,'Load an ABK image',2;][LIne 10,29,91,250; PR 60,34,'Load an ABK image',2; BR 0;]"
  85.    A$=A$+"KY 209,0;"
  86.    A$=A$+"BU 4,10,44,240,16,0,0,1;[LIne 0,0,88,240; PR 20,4,'Load a squashed ABK image',2;][LIne 10,44,91,250; PR 30,49,'Load a squashed ABK image',2; BR 0;]"
  87.    A$=A$+"KY 210,0;"
  88.    A$=A$+"BU 5,10,59,240,16,0,0,1;[LIne 0,0,88,240; PR 16,4,'Load PowerPacked ABK image',2;][LIne 10,59,91,250; PR 26,64,'Load PowerPacked ABK image',2; BR 0;]"
  89.    A$=A$+"KY 211,0;"
  90.    A$=A$+"BU 6,10,74,240,16,0,0,1;[LIne 0,0,88,240; PR 65,4,'Pack as screen',2;][LIne 10,74,91,250; PR 75,79,'Pack as screen',2; BR 0;]"
  91.    A$=A$+"KY 212,0;"
  92.    A$=A$+"BU 7,10,89,240,16,0,0,1;[LIne 0,0,88,240; PR 65,4,'Pack as bitmap',2;][LIne 10,89,91,250; PR 75,94,'Pack as bitmap',2; BR 0;]"
  93.    A$=A$+"KY 213,0;"
  94.    A$=A$+"BU 8,10,104,240,16,0,0,1;[LIne 0,0,88,240; PR 65,4,'Save IFF image',2;][LIne 10,104,91,250; PR 75,109,'Save IFF image',2; BR 0;]"
  95.    A$=A$+"KY 214,0;"
  96.    A$=A$+"BU 9,10,119,240,16,0,0,1;[LIne 0,0,88,240; PR 65,4,'Save ABK image',2;][LIne 10,119,91,250; PR 75,124,'Save ABK image',2; BR 0;]"
  97.    A$=A$+"KY 215,0;"
  98.    A$=A$+"BU 10,10,134,240,16,0,0,1;[LIne 0,0,88,240; PR 30,4,'Save squashed ABK image',2;][LIne 10,134,91,250; PR 40,139,'Save squashed ABK image',2; BR 0;]"
  99.    A$=A$+"KY 216,0;"
  100.    A$=A$+"BU 11,10,149,240,16,0,0,1;[LIne 0,0,88,240; PR 15,4,'Save Powerpacked ABK image',2;][LIne 10,149,91,250; PR 25,154,'Save Powerpacked ABK image',2; BR 0;]"
  101.    A$=A$+"KY 217,0;"
  102.    A$=A$+"BOx 8,166,79,250,187;"
  103.    A$=A$+"BU 12,16,168,64,16,0,0,1;[UNpack 0,0,13; PR 10,4,'About',2;][UNpack 16,168,14; PR 26,173,'About',2; BR 0;]"
  104.    A$=A$+"BU 13,180,168,64,16,0,0,1;[UNpack 0,0,13; PR 12,4,'Quit',2;][UNpack 180,168,14; PR 192,173,'Quit',2; BR 0;]"
  105.    A$=A$+"BU 14,24,0,260,10,0,0,1;[][SM;]"
  106.    A$=A$+"EXit;"
  107.    Dialog Open 1,A$
  108.    R=Dialog Run(1)
  109.    _WB_POINTER
  110. End Proc
  111. Procedure _LOAD_IFF
  112.    F$=Fsel$("","","Load an IFF image","")
  113.    If F$="" Then Pop Proc
  114.    If Not Exist(F$)
  115.       _ERROR["File does not exist!"]
  116.       Pop Proc
  117.    End If 
  118.    Trap Load Iff F$,1
  119.    If Errtrap<>0
  120.       _ERROR["File is not an IFF image!"]
  121.       Pop Proc
  122.    End If 
  123.    _INFO[SW,SH,SC,F$]
  124.    Screen To Back 1
  125. End Proc
  126. Procedure _LOAD_ABK
  127.    F$=Fsel$("","","Load an ABK image","")
  128.    If F$="" Then Pop Proc
  129.    If Not Exist(F$)
  130.       _ERROR["File does not exist!"]
  131.       Pop Proc
  132.    End If 
  133.    Trap Load F$,15
  134.    If Errtrap<>0
  135.       _ERROR["File is not a packed picture!"]
  136.       Pop Proc
  137.    End If 
  138.    Trap Unpack 15 To 1
  139.    If Errtrap<>0
  140.       _ERROR["Not a packed bitmap!"]
  141.       Pop Proc
  142.    End If 
  143.    _INFO[SW,SH,SC,F$]
  144.    Screen To Back 1
  145. End Proc
  146. Procedure _LOAD_SABK
  147.    F$=Fsel$("","","Load a Squashed ABK image","")
  148.    If F$="" Then Pop Proc
  149.    If Not Exist(F$)
  150.       _ERROR["File does not exist!"]
  151.       Pop Proc
  152.    End If 
  153.    Open In 1,F$
  154.    SIZEOFFILE=Lof(1)
  155.    Close 1
  156.    Reserve As Work 15,SIZEOFFILE*3
  157.    Bload F$,Start(15)
  158.    HEADER=Leek(Start(15))
  159.    If HEADER<>$48C09809
  160.       _ERROR["File is not a squashed bank!"]
  161.       Pop Proc
  162.    End If 
  163.    L= Extension_5_00E4(Start(15),SIZEOFFILE)
  164.    Bank Shrink 15 To L
  165.    Trap Unpack 15 To 1
  166.    If Errtrap<>0
  167.       _ERROR["Not a squashed bitmap!"]
  168.       Pop Proc
  169.    End If 
  170.    _INFO[SW,SH,SC,F$]
  171.    Screen To Back 1
  172. End Proc
  173. Procedure _LOAD_PPABK
  174.    F$=Fsel$("","","Load a PowerPacked ABK image","")
  175.    If F$="" Then Pop Proc
  176.    If Not Exist(F$)
  177.       _ERROR["File does not exist!"]
  178.       Pop Proc
  179.    End If 
  180.    Trap Extension_5_0120 F$,15
  181.    If Errtrap<>0
  182.       _ERROR["File is not a PowerPacked picture bank!"]
  183.       Pop Proc
  184.    End If 
  185.    Trap Unpack 15 To 1
  186.    If Errtrap<>0
  187.       _ERROR["Error unpacking! File is possibly corrupt"]
  188.       Pop Proc
  189.    End If 
  190.    _INFO[SW,SH,SC,F$]
  191.    Screen To Back 1
  192. End Proc
  193. Procedure _INFO[SW,SH,SC,F$]
  194.    PICINMEM=True : PCKED=False
  195.    Dialog Freeze 1
  196.    Resource Screen Open 2,640,45,0
  197.    A$=A$+"BOx 0,0,1,640,45; SIze 640,45; SAve 1;"
  198.    A$=A$+"LIne 0,0,28,640; PR 10,1,'Image Statistics',2;"
  199.    A$=A$+"BU 1,0,0,640,10,0,0,1;[][SM;]"
  200.    A$=A$+"PR 10,16,'Filename',2; LIne 80,15,44,630;"
  201.    A$=A$+"PR 10,28,'Size',2; LIne 80,27,44,160;"
  202.    A$=A$+"PR 170,28,'Colours',2; LIne 250,27,44,290;"
  203.    A$=A$+"BU 2,560,26,64,16,0,0,1;[UNpack 0,0,13; PR 7,4,'Cancel',2;][UNpack 560,26,14; PR 567,31,'Cancel',2; BR 0;]"
  204.    A$=A$+"KY 196,0;"
  205.    A$=A$+"EXit;"
  206.    Dialog Open 2,A$
  207.    R=Dialog Run(2)
  208.    Screen 1
  209.    SW=Screen Width
  210.    SH=Screen Height
  211.    SC=Screen Colour
  212.    Screen 2
  213.    SW$=Str$(SW) : SH$=Mid$(Str$(SH),2,5) : SC$=Str$(SC)
  214.    RES$=SW$+"x"+SH$
  215.    Ink 7
  216.    Text 84,22,F$
  217.    Text 76,34,RES$
  218.    Text 246,34,SC$
  219.    X=0 : Y=0
  220.    Repeat 
  221.       X$=Inkey$
  222.       S=Scancode
  223.       If S=76
  224.          Add Y,-2
  225.          If Y<0 : Y=0 : End If 
  226.       End If 
  227.       If S=77
  228.          Add Y,2
  229.          If Y>(Screen Height/2)-1 : Y=(Screen Height/2)-1 : End If 
  230.       End If 
  231.       If S=79
  232.          Add X,-2
  233.          If X<0 : X=0 : End If 
  234.       End If 
  235.       If Screen Width>320
  236.          If S=78
  237.             Add X,2
  238.             If X>(Screen Width/2)-1 : X=(Screen Width/2)-1 : End If 
  239.          End If 
  240.       End If 
  241.       Screen Offset 1,X,Y
  242.       Wait Vbl 
  243.       D=Dialog(2)
  244.    Until D=2
  245.    Dialog Close 2
  246.    Screen Close 2
  247.    Dialog Unfreeze 1
  248. End Proc
  249. Procedure _PACK_SCREEN[TYPE]
  250.    Dialog Freeze 1
  251.    Screen To Front 1
  252.    _ABOUT_SCREEN
  253.    Screen 1
  254.    Gr Writing 3
  255.    SX=0 : SY=0 : EX=Screen Width-1 : EY=Screen Height-1
  256.    _UPDATE_GROWBOX[EX-SX,EY-SY]
  257.    Limit Mouse 
  258.    X=0 : Y=0
  259.    Repeat 
  260.       D=Dialog(2)
  261.       X$=Inkey$
  262.       S=Scancode
  263.       If S=76
  264.          Add Y,-2
  265.          If Y<0 : Y=0 : End If 
  266.       End If 
  267.       If Screen Height>256
  268.          If S=77
  269.             Add Y,2
  270.             If Y>(Screen Height/2)-1 : Y=(Screen Height/2)-1 : End If 
  271.          End If 
  272.       End If 
  273.       If S=79
  274.          Add X,-2
  275.          If X<0 : X=0 : End If 
  276.       End If 
  277.       If Screen Width>320
  278.          If S=78
  279.             Add X,2
  280.             If X>(Screen Width/2)-1 : X=(Screen Width/2)-1 : End If 
  281.          End If 
  282.       End If 
  283.       Screen Offset 1,X,Y
  284.       Wait Vbl 
  285.       If Mouse Key=1
  286.          SX=X Screen(X Mouse)
  287.          SY=Y Screen(Y Mouse)
  288.          If SX>EX : SX=EX : End If 
  289.          If SY>EY : SY=EY : End If 
  290.          _UPDATE_GROWBOX[EX-SX,EY-SY]
  291.       End If 
  292.       If Mouse Key=2
  293.          EX=X Screen(X Mouse)
  294.          EY=Y Screen(Y Mouse)
  295.          If EX>Screen Width
  296.             EX=Screen Width
  297.          End If 
  298.          If EY>Screen Height
  299.             EY=Screen Height
  300.          End If 
  301.          If EX<SX : EX=SX : End If 
  302.          If EY<SY : EY=SY : End If 
  303.          _UPDATE_GROWBOX[EX-SX,EY-SY]
  304.       End If 
  305.       Box SX,SY To EX,EY
  306.       Wait Vbl 
  307.       Box SX,SY To EX,EY
  308.    Until D>1
  309.    Dialog Close 2
  310.    Screen Close 2
  311.    If D=2
  312.       Screen Display 1,,,EX+1,EY-SY+1
  313.       Wait Vbl 
  314.       _WAIT["Packing image into memory bank"]
  315.       If TYPE=1
  316.          Spack 1 To 15,SX,SY,EX+1,EY+1
  317.       Else If TYPE=2
  318.          Pack 1 To 15,SX,SY,EX+1,EY+1
  319.       End If 
  320.       Dialog Close 2
  321.       Dialog Unfreeze 1
  322.       Screen Close 2
  323.       PCKED=True
  324.    Else 
  325.       PCKED=False
  326.    End If 
  327.    Screen To Back 1
  328.    Dialog Unfreeze 1
  329.    Screen 0
  330. End Proc
  331. Procedure _ERROR[MESSAGE$]
  332.    Screen 0
  333.    Dialog Freeze 1
  334.    A$=A$+"BAse 130,60; SIze 390,57; SAve 1;"
  335.    A$=A$+"BOx 0,0,1,390,57;"
  336.    A$=A$+"LIne 0,0,28,390; PR 10,1,'Image Request',0;"
  337.    A$=A$+"BOx 8,15,79,380,31;"
  338.    A$=A$+"PR 0VA CentreX,19,0VA,7;"
  339.    A$=A$+"BU 1,165,36,64,16,0,0,1;[UNpack 0,0,13; PR 3,4,'Cancel',2;][UNpack 165,36,14; PR 168,41,'Cancel',2; BR 0;]"
  340.    A$=A$+"KY 68 128 +,0;"
  341.    A$=A$+"EXit;"
  342.    Dialog Open 2,A$
  343.    Vdialog$(2,0)=MESSAGE$
  344.    R=Dialog Run(2)
  345.    Repeat 
  346.       D=Dialog(2)
  347.    Until D=1
  348.    Dialog Close 2
  349.    Dialog Unfreeze 1
  350. End Proc
  351. Procedure _WAIT[MESSAGE$]
  352.    Dialog Freeze 1
  353.    Resource Screen Open 2,640,40,0
  354.    Cls 0
  355.    A$=A$+"BAse 130,0; SIze 390,40;"
  356.    A$=A$+"BOx 0,0,1,390,40;"
  357.    A$=A$+"LIne 0,0,28,390; PR 10,1,'IC Message',0;"
  358.    A$=A$+"BOx 8,15,79,380,31;"
  359.    A$=A$+"PR 0VA CentreX,19,0VA,7;"
  360.    A$=A$+"EXit;"
  361.    Dialog Open 2,A$
  362.    Vdialog$(2,0)=MESSAGE$
  363.    R=Dialog Run(2)
  364.    Wait Vbl 
  365. End Proc
  366. Procedure _CHOICE[MESSAGE$]
  367.    Screen To Front 0
  368.    Screen 0
  369.    A$=A$+"BAse 130,60; SIze 390,57; SAve 1;"
  370.    A$=A$+"BOx 0,0,1,390,57;"
  371.    A$=A$+"LIne 0,0,28,390; PR 10,1,'Image Request',0;"
  372.    A$=A$+"BOx 8,15,79,380,31;"
  373.    A$=A$+"PR 0VA CentreX,19,0VA,7;"
  374.    A$=A$+"BU 1,10,36,64,16,0,0,1;[UNpack 0,0,13; PR 8,4,'Okay',2;][UNpack 10,36,14; PR 18,41,'Okay',2; BR 0;]"
  375.    A$=A$+"KY 128 24+,0;"
  376.    A$=A$+"BU 2,316,36,64,16,0,0,1;[UNpack 0,0,13; PR 5,4,'Cancel',2;][UNpack 316,36,14; PR 321,41,'Cancel',2; BR 0;]"
  377.    A$=A$+"KY 128 51+,0;"
  378.    A$=A$+"EXit;"
  379.    Dialog Open 2,A$
  380.    Vdialog$(2,0)=MESSAGE$
  381.    R=Dialog Run(2)
  382.    Repeat 
  383.       D=Dialog(2)
  384.    Until D<>0
  385.    Dialog Close 2
  386.    Screen To Back 0
  387. End Proc[D]
  388. Procedure _SAVE_IFF
  389.    Dialog Freeze 1
  390.    Screen To Front 1
  391.    F$=Fsel$("","","Save Image","Enter name for IFF image")
  392.    If F$=""
  393.       Screen To Back 1
  394.       Dialog Unfreeze 1
  395.       Pop Proc
  396.    End If 
  397.    If Exist(F$)
  398.       _CHOICE["File already exists, Overwrite?"]
  399.       D=Param
  400.       If D=2
  401.          Screen To Back 1
  402.          Dialog Unfreeze 1
  403.          Pop Proc
  404.       End If 
  405.    End If 
  406.    Screen 1
  407.    Save Iff F$
  408.    Screen To Back 1
  409.    Dialog Unfreeze 1
  410. End Proc
  411. Procedure _SAVE_ABK
  412.    Dialog Freeze 1
  413.    Screen To Front 1
  414.    F$=Fsel$("","","Save image","Enter name for ABK image")
  415.    If F$=""
  416.       Screen To Back 1
  417.       Dialog Unfreeze 1
  418.       Pop Proc
  419.    End If 
  420.    If Exist(F$)
  421.       _CHOICE["File already exists, Overwrite?"]
  422.       D=Param
  423.       If D=2
  424.          Screen To Back 1
  425.          Dialog Unfreeze 1
  426.          Pop Proc
  427.       End If 
  428.    End If 
  429.    Save F$,15
  430.    Screen To Back 1
  431.    Dialog Unfreeze 1
  432. End Proc
  433. Procedure _SAVE_SABK
  434.    Dialog Freeze 1
  435.    Screen To Front 1
  436.    F$=Fsel$("","","Save image","Enter name for ABK image")
  437.    If F$=""
  438.       Screen To Back 1
  439.       Dialog Unfreeze 1
  440.       Pop Proc
  441.    End If 
  442.    If Exist(F$)
  443.       _CHOICE["File already exists, Overwrite?"]
  444.       D=Param
  445.       If D=2
  446.          Screen To Back 1
  447.          Dialog Unfreeze 1
  448.          Pop Proc
  449.       End If 
  450.    End If 
  451.    _WAIT["Please wait, squashing image..."]
  452.    L= Extension_5_00CE(Start(15),Length(15),1,4095,18)
  453.    Bsave F$,Start(15) To Start(15)+L
  454.    Screen To Back 1
  455.    Dialog Unfreeze 1
  456.    Dialog Close 2
  457.    Screen Close 2
  458. End Proc
  459. Procedure _SAVE_PPABK
  460.    Dialog Freeze 1
  461.    Screen To Front 1
  462.    F$=Fsel$("","","Save image","Enter name for Powerpacked ABK image")
  463.    If F$=""
  464.       Screen To Back 1
  465.       Dialog Unfreeze 1
  466.       Pop Proc
  467.    End If 
  468.    If Exist(F$)
  469.       _CHOICE["File already exists, Overwrite?"]
  470.       D=Param
  471.       If D=2
  472.          Screen To Back 1
  473.          Dialog Unfreeze 1
  474.          Pop Proc
  475.       End If 
  476.    End If 
  477.    _WAIT["Please wait, Powerpacking image..."]
  478.     Extension_5_0106 F$,15,4
  479.    Dialog Close 2
  480.    Dialog Unfreeze 1
  481.    Screen Close 2
  482.    Screen To Back 1
  483. End Proc
  484. Procedure _ABOUT
  485.    Screen 0
  486.    Dialog Freeze 1
  487.    A$=A$+"BAse 70,20; SIze 500,130; SAve 1;"
  488.    A$=A$+"BOx 0,0,1,500,130;"
  489.    A$=A$+"PO 95,20,'Image Compressor v1.0b ï¿½ 1994 Sixth Sense',0,3;"
  490.    A$=A$+"LIne 0,10,10,503;"
  491.    A$=A$+"LIne 0,30,10,503;"
  492.    A$=A$+"PRint 150,50,'Programmed by A. N. Smith',2;"
  493.    A$=A$+"PR 130,65,'This version is Public Domain',7;"
  494.    A$=A$+"BU 1,220,110,64,16,0,0,1;"
  495.    A$=A$+"[UN 0,0,13; PR 5,4,'Cancel',2;][UN 220,110,14; PR 225,115,'Cancel',2; BR 0;]"
  496.    A$=A$+"EXit;"
  497.    Dialog Open 2,A$
  498.    R=Dialog Run(2)
  499.    F$=Str$(Fast Free) : C$=Str$(Chip Free)
  500.    Text 220,107,'Chip Memory : '+C$
  501.    Text 220,117,'Fast Memory : '+F$
  502.    Repeat 
  503.       BUTTON=Dialog(2)
  504.    Until BUTTON=1
  505.    Dialog Close 2
  506.    Dialog Unfreeze 1
  507. End Proc
  508. Procedure _ABOUT_SCREEN
  509.    Resource Screen Open 2,640,35,0
  510.    A$=A$+"BOx 0,0,1,640,35; SIze 640,35; SAve 1;"
  511.    A$=A$+"LIne 0,0,28,640; PR 10,1,'Pack Image',2;"
  512.    A$=A$+"BU 1,0,0,640,10,0,0,1;[][SM;]"
  513.    A$=A$+"PR 10,15,'Size',2; LIne 80,14,44,160;"
  514.    A$=A$+"PR 170,15,'Box size',2; LIne 250,14,44,330;"
  515.    A$=A$+"PR 350,15,'Colours',2; LIne 430,14,44,480;"
  516.    A$=A$+"BU 2,488,14,64,16,0,0,1;[UNpack 0,0,13; PR 9,4,'Pack',2;][UNpack 488,14,14; PR 491,19,'Pack',2; BR 0;]"
  517.    A$=A$+"BU 3,560,14,64,16,0,0,1;[UNpack 0,0,13; PR 7,4,'Cancel',2;][UNpack 560,14,14; PR 567,19,'Cancel',2; BR 0;]"
  518.    A$=A$+"KY 196,0;"
  519.    A$=A$+"EXit;"
  520.    Dialog Open 2,A$
  521.    R=Dialog Run(2)
  522.    Screen 1
  523.    SW=Screen Width
  524.    SH=Screen Height
  525.    SC=Screen Colour
  526.    Screen 2
  527.    SW$=Str$(SW) : SH$=Mid$(Str$(SH),2,5) : SC$=Str$(SC)
  528.    RES$=SW$+"x"+SH$
  529.    Ink 7
  530.    Text 76,21,RES$
  531.    Text 420,21,SC$
  532.    X=0 : Y=0
  533. End Proc
  534. Procedure _UPDATE_GROWBOX[EX,EY]
  535.    Screen 2
  536.    Gr Writing 1
  537.    Ink 7,2
  538.    EX$=Str$(EX) : EY$=Mid$(Str$(EY),2,5)
  539.    SIZE$=EX$+"x"+EY$
  540.    SIZE$=Mid$(SIZE$,2,8)
  541.    Text 250,21,"        "
  542.    Text 250,21,SIZE$
  543.    Gr Writing 0
  544.    Screen 1
  545. End Proc
  546. Procedure _WB_POINTER
  547.    Colour 17,$FFF : Colour 18,$F40 : Colour 19,$0
  548. End Proc