AMOS Pro101v      R'J F **************************    **************************************   'J F * Requester For GUIAmos  *   **                                    *   *J L *  copyRight L9 Soft   *  **   *****************************     *         *J L *\\\\\\\\\\\/\///////////*  **  **                           **    *         +J N *////////////\\\\\\\\\\\\*  **   *****************************     *           *J L *\\\\\\\\\///\\\/////////*   **                                    *         'J F *////////////\\\\\\\\\\\\*    ************************************ *   'J F *\\\\\\\/////\\\\\///////*                                       * *   'J F *////////////\\\\\\\\\\\\*                                       * *   'J F *\\\\\///////\\\\\\\/////*                                       * *   'J F *////////////\\\\\\\\\\\\*                                       * *   'J F *\\\/////////\\\\\\\\\///* *****  **     **  *****  ***          * *   'J F *///\\\\\\\\\/////////\\\* * ***  **     **  * ***  * *          * *   'J F *\\\\\\\\\\\\////////////* * *     **   **   * *    * *          * *   'J F */////\\\\\\\///////\\\\\* * ***   **   **   * ***  * *          * *   'J F *\\\\\\\\\\\\////////////* * ***    ** **    * ***  * *          * *   'J F *///////\\\\\/////\\\\\\\* * *      ** **    * *    * *          * *   'J F *\\\\\\\\\\\\////////////* * ***     ***     * ***  * *****      * *   'J F */////////\\\///\\\\\\\\\* *****     ***     *****  *******      ***   J  *\\\\\\\\\\\\////////////*   *J L *///////////\/\\\\\\\\\\\*******************************************         'J F *                                                                  *   'J F * You may use this procedure in any amos program you create accept *   'J F * in any program that will directly give the code to an            *   )J J * unregistard person/persons, i.e Nobody but you the sole register *       'J F * can use this code....... ENJOY                                   *   'J F *                                                                  *   'J F ********************************************************************   J 0 Just to show you how it replaces the background  !J : open a random sized screen, draw random coloured polygons  J  ******       demo      scmd t >    |  ) N    scmd >     T	 >     \ >  @ \ >    \ >    \ T4 T >     T  + R    scmd >    T	 >     \ >  @ \ >    \ >    \%  T4 T >     T  ) N    scmd >    T	 >     \ >   \ >    \ >    \ T4 T >     T  + R    scmd >    T	 >     \ >  @ \ >    \ >    \%  T4 T >     T  7J f set a palette in order Background (grey),dark border (Black), light border (white), Bar Colour (Blue)   6  
 \ 6     \ 6   \ 6    %   x2 tX >   
 | >    T   y2 tt >   
 | >     <>   i  >     >   d  9   px   x2 T   py   y2 T  $ x  tX >   
 | >    T  * y  tt >   
 | >     %   x2 tX >   
 | >    T   y2 tt >   
 | >     ,D t >    | >    T   px \   py   $ x  \  * y     x2 \   y2  F   i   J  ******      req   & Hello GUIAmos users  \ >   2 \ >    \ >    \ >   H \ & This procedure is  \ & quite impressive \ & 	even if I  \ & 	do say so  \ & myself (L9 Soft) \ & Cancel \ & Retry  \ & Ok \ >    \ >    \ >    \ >     \ >    \ >    \ >     \ >     \ >    \ >     \ >    \ >    \ >      v  B2     req     tit  \   x  \   y  \   xsz  \   ysz  \  txt1 \  $txt2 \  *txt3 \  0txt4 \  6txt5 \  <butt1  \  Bbutt2  \  Hbutt3  \  N patt \  T drag \  Z
 _lnesoftxt \  ` _fnt \  f _fntx  \  l _fnty  \  r scr  \  x dia  \  ~ cen  \   back \   dark \   light  \   _bar   J  The Procedure................    J  The Syntax...................  1J Z TIT$-------This is the text that will appear on the title bar (used to drag the window)    $J @ X----------This is the X position of the top left hand corner    $J @ Y----------This is the Y position of the top left hand corner    J . XSZ--------This is the Width of the requester  J 0 YSZ--------This is the Height of the requester   .J T TXT1$------This is the 1st of 5 pieces of text that can be placed in the requester   -J R            this number can be increased if you add the extra number required into  )J J            the Proc , and change the syntax _LNESOFTXT (Explained later)   $J @ BUTT1$-----This is the Left hand buttons text on the requester   BJ | BUTT2$-----This is the Middle buttons text on the requester (if you leave the other two blank you can have this on its own)  %J B BUTT3$-----This is the right hand buttons text on the requester    (J H PATT-------This defines if the Pattern behind the text is (0=off/1=on)   *J L DRAG-------This defines if the Requester can be (1=dragged/0 not dragged)    4J ` _LNESOFTXT-This defines the amount of space needed for the information text (explained TXT1$)    2J \ _FNT-------This defines the number of the font (read from a disk or rom) to use default 0.   ;J n _FNTX------This defines the x width of that font (Amos's default font x size is 8)(GUIAmos font x size is 5)   ;J n _FNTY------This defines the y height of that font(Amos's default font y size is 8)(GUIAmos font y size is 7)   $J @ SCR--------This defines the screen on which the req will appear  /J V DIA--------This tells the procedure if you are using the dialog commands (1=yes/0=no)  ,J P CEN--------This defines wether the information text is centred (1) or not (0)    +J N Back-------The number of the colour register to use for the background colour  ,J P Dark-------The number of the colour register to use for the Dark border colour   ,J P Light------The number of the colour register to use for the light border colour  *J L _Bar-------The number of the colour register to use for the Drag Bar colour  (J H You may wish to cut down on the number of variables, it's up to you!!!   J 6 Dim some variables to store the coords of the buttons  	J 
 i.e......  J    J       Butty()     J  Buttx()************  J         *          *  J         *          *  J         ************Buttx2()    J                Butty2()   J     I@  @buttx  t >    | \  @butty  t >    | \  @buttx2 t >    | \  @butty2 t >    | \  Btxt  t t >    \  Z
 _lnesoftxt | |  	    _drawreq  )J J If you signify that you are using Diallog comands within the Amos program  J * freeze them until the dialog is closed.     $  x dia  >    T( >    T  (J H Store the information Text into a dim variable for easier screen print   V  Btxt  t >    |  txt1 T  Btxt  t >    |  $txt2 T  Btxt  t >    |  *txt3 T  Btxt  t >    |  0txt4 T  Btxt  t >    |  6txt5  J . Store the graphics under the requester window  6 N   r scr   >    \   x  \   y  \   x    xsz  >    \   y    ysz  >     J  set some variables    J 8 _BARYSZ=The bar with which to drag the req window with   J  _TEXTYSZ=The ysize of text   J  _TEXTXSZ=The xsize of text   J 4 _TEXTBLKYSZ=The ysize of the information text block  J 4 _TEXTBLKxSZ=The xsize of the information text block  k   _barysz  >   
 T   _textysz  l _fnty  T   _textxsz  f _fntx  T   _textblkysz    _barysz  t   _textysz  Z
 _lnesoftxt | >    T  
 txtblkszx    xsz  >    >     J 2 Draw the necessary Lines to create the 3d window   4D   light  T   x  \   y    ysz     x  \   y     x    xsz  \   y   GD   dark T   x    xsz  \   y  >       x    xsz  \   y    ysz     x  >    \   y    ysz   ?P   _bar \   back T   x  >    \   y  >       x    xsz  >    \   y    ysz  >     KD   dark T   x  >    \   y    ysz     x  >    \   y    _barysz     x    xsz  \   y    _barysz      tit2( t   tit  \ t   xsz  >    | >    |  J 2 Print the Title text to the window & select font   Q  ` _fnt TP   dark \   _bar TJ   x  >    \   y    _barysz  >    >    \( t  tit2 \ t   xsz  >    |   _textxsz |  J  if the pattern is on draw it   J  N patt >    TP   light  \   back T   x  >    \   y    _barysz  >       x    xsz  >    \   y    ysz  >    TP   light  \   back T" >    T   x  >    \   y    _barysz  >       x    xsz  >    \   y    ysz  >    T" >     T  J 4 Draw more necessary Lines to create the 3d window    [D   dark T   x  >    \   y    _textblkysz     x  >    \   y    _barysz  >       x    xsz  >    \   y    _barysz  >     `D   light  T   x  >    \   y    _textblkysz     x    xsz  >    \   y    _textblkysz     x    xsz  >    \   y    _barysz  >     X   x  >    \   y    ysz  >       x    xsz  >    \   y    ysz  >       x    xsz  >    \   y    _barysz  >     ED   back T   x  >    \   y    _barysz  >       x    xsz  >    \   y    _textblkysz  >     J & Print text in the information window   <   i  >     >    TP   dark \   back  a   offsett  >     T   ~ cen  >   X t  
 txtblkszx  >    | t  Btxt  t   i  | | T   offsett  t  
 txtblkszx  t t  Btxt  t   i  | | | | >    T  ]J   x  >   	   offsett  \   y    _barysz  >      i    _textysz \( t  Btxt  t   i  | \ t  
 txtblkszx  >    |   _textxsz | TF   i   $J @ if the Left hand button is available, draw the necessary lines     <butt1 f &    zD   light  T   x  >    \   y    ysz  >       x  >    \   y    ysz  >      _textysz    x  >    t t  <butt1  |   _textxsz | >    \   y    ysz  >      _textysz  D   dark T   x  >    \   y    ysz  >       x  t t  <butt1  |   _textxsz | >   	 \   y    ysz  >       x  t t  <butt1  |   _textxsz | >   	 \   y    ysz  >      _textysz  YD   back T   x  >    \   y    ysz  >      _textysz >       x  t t  <butt1  |   _textxsz | >    \   y    ysz  >     J  Place text inside button   @P   dark \   back TJ   x  >   	 \   y    ysz  >    t   _textysz >    | >    \  <butt1   J  Store the buttons coords      butt1  >    T  @buttx  t >    |   x  >    T  @butty  t >    |   y    ysz  >      _textysz T  @buttx2 t >    |   x  t t  <butt1  |   _textxsz | >   	 T  @butty2 t >    |   y    ysz  >      "     butt1  >        %J B if the right hand button is available, draw the necessary lines    6  Hbutt3 f &      D   light  T   x    xsz  >    t   _textxsz t  Hbutt3  | | \   y    ysz  >       x    xsz  >    t   _textxsz t  Hbutt3  | | \   y    ysz  >      _textysz    x    xsz  >    \   y    ysz  >      _textysz  D   dark T   x    xsz  >    \   y    ysz  >      _textysz    x    xsz  >    \   y    ysz  >       x    xsz  >    t   _textxsz t  Hbutt3  | | \   y    ysz  >     aD   back T   x    xsz  >    t   _textxsz t  Hbutt3  | | \   y    ysz  >      _textysz    x    xsz  >    \   y    ysz  >     J  Place text inside button   ZP   dark \   back TJ   x    xsz  >    t   _textxsz t  Hbutt3  | | \   y    ysz  >    t   _textysz >    | >    \  Hbutt3   J  Store the buttons coords      butt3  >    T  @buttx  t >    |   x    xsz  >    t   _textxsz t  Hbutt3  | | T  @buttx2 t >    |   x    xsz  >    T  @butty  t >    |   y    ysz  >      _textysz T  @butty2 t >    |   y    ysz  >      "     butt3  >        #J > if the middle button is available, draw the necessary lines    !  Bbutt2 f &  X  <butt1  &  X  Hbutt3  &    !   _length  t   _textxsz t  Bbutt2  | | >     D   light  T   x    xsz  >    t   _length  >    | \   y    ysz  >       x    xsz  >    t   _length  >    | \   y    ysz  >      _textysz    x    xsz  >    t   _length  >    | \   y    ysz  >      _textysz  D   dark T   x    xsz  >    t   _length  >    | >    \   y    ysz  >       x    xsz  >    t   _length  >    | >    \   y    ysz  >       x    xsz  >    t   _length  >    | >    \   y    ysz  >      _textysz  qD   back T t   x  t   xsz  >    | | t   _length  >    | >    \   y    ysz  >      _textysz    x    xsz  >    t   _length  >    | \   y    ysz  >     J  Place text inside button   XP   dark \   back TJ   x    xsz  >    t   _length  >    | >    \   y    ysz  >    t   _textysz >    | >    \  Bbutt2   J  Store the buttons coords      butt2  >    T  @buttx  t >    |   x    xsz  >    t   _length  >    | T  @buttx2 t >    |   x    xsz  >    t   _length  >    | >    T  @butty  t >    |   y    ysz  >      _textysz T  @butty2 t >    |   y    ysz  >      "     butt2  >        &J D if the all buttons are available, draw the necessary lines, centre   J 6 the middle button between the left & right buttons     !  Bbutt2 f &  X  <butt1 f &  X  Hbutt3 f &    !   _length  t   _textxsz t  Bbutt2  | | >     O  dist t   x    xsz  >    t   _textxsz t  Hbutt3  | | | t   x  >    t t  <butt1  |   _textxsz | >    |  D   light  T   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >       x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >      _textysz    x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >      _textysz  D   dark T   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | >    \   y    ysz  >       x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >       x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >      _textysz  D   back T   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | >    \   y    ysz  >      _textysz    x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >     nP   dark \   back TJ   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | \   y    ysz  >    t   _textysz >    | >    \  Bbutt2   "   butt2  >    T   butt1  >    T   butt3  >       @buttx  t >    |   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | T  @buttx2 t >    |   x  >    t  <butt1  |   _textxsz >     dist >    t   _length  >    | T  @butty  t >    |   y    ysz  >      _textysz T  @butty2 t >    |   y    ysz  >       ~	    mk2 T  xpos t | T  ypos8 t$ |  J  Check for mouse key  (  mk >     
J ( check if mouse pos is over the drag bar  G
  xpos   x X  xpos   x    xsz X  ypos   y X  ypos   y    _barysz X  T drag >     f >     P  J $ drag a box where the mouse is moved  A ~ t | t  xpos   x  | >    X t | t  xpos   x  |   xsz X T  xpos2  t | T  A ~8 t$ | t  ypos   y  | >    X8 t$ | t  ypos   y  |   ysz t T   ypos2 8 t$ | T  ^  xpos2  t  xpos   x  | \   ypos2  t  ypos   y  |    xsz   xpos2  t  xpos   x  | \   ysz    ypos2  t  ypos   y  |    ^  xpos2  t  xpos   x  | \   ypos2  t  ypos   y  |    xsz   xpos2  t  xpos   x  | \   ysz    ypos2  t  ypos   y  |  \2 >      J  check if requester has moved   5  xpos2  t  xpos   x  |f   x L   ypos2  t  ypos   y  |f   y   J , copy back the previously stored background   If >    T N ` >    \   x  \   y  T   x   xpos2  t  xpos   x  | T   y    ypos2  t  ypos   y  |  J 2 Go back and redraw the requester in new position   
  _drawreq    
  )
J J check mouse position over each button and close the requester if required  j
    butt1  >   X  xpos  @buttx  t >    |X  xpos  @buttx2 t >    |X  ypos  @butty  t >    |X  ypos  @butty2 t >    | T & butt >    T  rebutt T  j
    butt2  >   X  xpos  @buttx  t >    |X  xpos  @buttx2 t >    |X  ypos  @butty  t >    |X  ypos  @butty2 t >    | T & butt >    T  rebutt T  j
    butt3  >   X  xpos  @buttx  t >    |X  xpos  @buttx2 t >    |X  ypos  @butty  t >    |X  ypos  @butty2 t >    | T & butt >    T  rebutt T    !J : check for keyboard equivilant of mouse press over button   J  Escape   ) N t >   E |X   butt1  >    T & butt >    T  rebutt T  J  Space  ) N t >   @ |X   butt2  >    T & butt >    T  rebutt T  J  Enter  ) N t >   D |X   butt3  >    T & butt >    T  rebutt T          rebutt  J $ draw the 3d effect onto the button   ]D   dark T  @buttx  t & butt | \  @butty2 t & butt |   @buttx  t & butt | \  @butty  t & butt |   @buttx2 t & butt | \  @butty  t & butt |  ^D   light  T  @buttx2 t & butt | \  @butty  t & butt |   @buttx2 t & butt | \  @butty2 t & butt |   @buttx  t & butt | \  @butty2 t & butt |    h 2 >    Tt  ^D   light  T  @buttx  t & butt | \  @butty2 t & butt |   @buttx  t & butt | \  @butty  t & butt |   @buttx2 t & butt | \  @butty  t & butt |  ]D   dark T  @buttx2 t & butt | \  @butty  t & butt |   @buttx2 t & butt | \  @butty2 t & butt |   @buttx  t & butt | \  @butty2 t & butt |    J * redraw the background over the requester    N ` >    \   x  \   y   J * if dialog commands are used, restart them    <  x dia  >    T , b 'l t >    | Tf >    T   J 8 Send out the number of the button that has been pressed  
  & butt   .J T You can find out which of the three buttons are clicked by using the param command    J 8 it will return (1) for Left (2) for middle & (3) Right.  J  i.e BUTT=Param        J 8 Pressing Escape is the same as clicking the left button  !J : Pressing Space is the same as clicking the middle button    J 8 Pressing Enter is the same as clicking the right button    demo  AmBs AmBk   XPac.Pic.c    I                  ?  ?                    ?  @   `   $   &                   ?       ?     ???     ?    ? ? ? ~?  ?  ~            ?            p  x ? |  >                  ?   ?        @   `   `   `       0   0    ?              _   G            ? _               ?             ?  ?   ?  ?               ? ? ?   @          >     ?            p  x ? |  >     <8 xp l,a` 26fo3xncw6~1lG=q|x0 8 8 q l ` ? ^`    0 @` 0   `  p 0  <?x~,?a~6d?1~cc8?11~cC0G?`30f6͆l03ၟ`gg` 00` ` 0` & l0a    