/* RexxTest mit Menus&More                */
/* §VER: 2.00 (24.04.96)                   */
/* © 1995,96 by Axel Sodtalbers, Göttingen */

OPTIONS RESULTS                                     /* Init */
ADDRESS "MMPlayer"

'ALOHAPLAYER'
oldmsg = ''
'DrawColor 0'

'SwitchTitle 0'

/* -------------------------------------------------------- */
 
call MessageOut '"Query Function..."' 

msg = "'Query is giving the following results:||"
msg = msg || 'PlLeft      : '
'QUERY PLLEFT'
msg = msg || RESULT || '|PlTop       : '
'QUERY PLTOP'
msg = msg || RESULT || '|PlWidth     : '
'QUERY PLWIDTH'
msg = msg || RESULT || '|PlHeight    : '
'QUERY PLHEIGHT'
msg = msg || RESULT || '|PlPlanes    : '
'QUERY PLPLANES'
msg = msg || RESULT || '|PlColors    : '
'QUERY PLCOLORS'
msg = msg || RESULT || '||MMRexxDebug : '
'QUERY MMREXXDEBUG'
msg = msg || RESULT || '||IsGerman    : '
'QUERY ISGERMAN'
msg = msg || RESULT || "|'"

'Req' msg 'Understood'


/* -------------------------------------------------------- */

AX = 100
AY = 40
AW = 440
AH = 130

'DrawColor 1'
'DrawRectFill' AX AY AX + AW AY + AH

call MessageOut '"Testing: DrawLine Function..."'

'SetWaitPointer'                                        /* DrawLine   */
 col = 4
'DrawColor' col

do px=AX to AX + AW by 4
   'DrawLine' AX AY px AY + AH
   'DrawColor' col
   col = col + 1
   if col = 8 then col=4
end

col = 4
do px=AX + AW to AX by -4
   'DrawLine' AX + AW AY px AY + AH
   'DrawColor' col
   col = col + 1
   if col = 8 then col=4
end  

col = 4
do px=AX to AX + AW by 4
   'DrawLine' AX AY + AH px AY
   'DrawColor' col
   col = col + 1
   if col = 8 then col=4
end  

col = 4
do px=AX + AW to AX by -4
   'DrawLine' AX + AW AY + AH px AY
   'DrawColor' col
   col = col + 1
   if col = 8 then col=4
end  
'ResetPointer'
Call Wait


Call MessageOut "'DrawCircle Function...'"
do rad=20 to 60 BY 3
  'DrawColor' random(4,7) 
  'DrawCircle' (AX+(AX+AW))/2 (AY+(AY+AH))/2 rad
end
Call Wait

Call MessageOut "'DrawRectangle Function...'"           /* DrawRectangle */ 
x1 = ax
y1 = ay
x2 = ax+aw
y2 = ay+ah

do while y2>(AY+(AY+AH))/2
  x1 = x1+3
  y1 = y1+3
  x2 = x2-3
  y2 = y2-3
  'DrawColor' random(4,7)
  'DrawRectangle' x1 y1 x2 y2
end  
Call Wait

Call MessageOut "'DrawRectFill Function...'"           /* DrawRectFill */
x1 = ax
y1 = ay
x2 = ax+aw
y2 = ay+ah

do while y2>(AY+(AY+AH))/2
  x1 = x1+3
  y1 = y1+3
  x2 = x2-3
  y2 = y2-3
  'DrawColor' random(4,7)
  'DrawRectFill' x1 y1 x2 y2
end  
Call Wait 

Call MessageOut "'Some pixels now...'"                  /* DrawPixel */
do px=1 to 100
   'DrawColor' random(4,7)
   'DrawPixel' random(ax, ax+aw) random(ay,ay+ah)
end
Call Wait

Call MessageOut "'And now some other requesters...'"    /* Reqs */

"ReqFile 'Select a file!' S:Startup-Sequence"
Call MessageOut "'Your selection: " || RESULT || "'" 
Call Wait  

"ReqDir 'Select a drawer!' RAM:"
Call MessageOut "'Your selection: " || RESULT || "'" 
Call Wait

'ReqString "Please type in some text now!" YourText'
Call MessageOut "'Your selection: " || RESULT || "'"
Call Wait  

'Req "Now we are switching||to another screen..." "Do the switch!"'
'SwitchScreen "PROGDIR:Examples/Logo.pic"'

'Req "Okay, folks - that was the Menus&More ARexx Demo||For more information consult the M&M.guide...|" "Understood"'

/* -------------------------------------------------------------- */

exit



MessageOut:    /* Demo-Typ auf Bildschirm */
    procedure expose oldmsg
    parse arg msg

    'DrawColor 4'
    'DrawText 130, 223,' oldmsg
     oldmsg = msg
    'DrawColor 2'
    'DrawText 130, 223,' msg

return


Wait:           /* Auf Mausklick warten */

    'SwitchTitle 1'
    'SetTitle "Please press left mouse button or space-key!"'
    'WaitForLMB'
    'SwitchTitle 0'
    'DrawColor 1'
    'DrawRectFill' AX AY AX + AW AY + AH
return



