View.Set ("graphics:400;400")
setscreen ("offscreenonly")
var x, y, button : int
loop
% Background
Draw.FillBox (maxx - 400, maxy - 400, maxx, maxy, blue)
% Color settings
colorback (blue)
color (white)
% Mouse Location
Mouse.Where (x, y, button)
Text.Locate (1, 1)
if button = 0 then
put x : 4, " ", y : 4, " button up"
else
put x : 4, " ", y : 4, " button down"
end if
% Font Settings
var font4 : int
font4 := Font.New ("Arial:17:bold,italic")
assert font4 > 0
% Main Program
put " ICS 1"
put " Michael Litvak"
put " --------------------------------------"
Font.Draw ("Question 1", 125, 280, font4, white)
Font.Draw ("Question 2", 125, 240, font4, white)
Font.Draw ("Question 3", 125, 200, font4, white)
Font.Draw ("Question 4", 125, 160, font4, white)
Font.Draw ("Question 5", 125, 120, font4, white)
% Boxes around Menu
drawbox (123, 278, 245, 297, white)
drawbox (123, 237, 245, 257, white)
drawbox (123, 197, 245, 216, white)
drawbox (123, 158, 245, 176, white)
drawbox (123, 118, 245, 137, white)
% Mouse over IFs
if x > 127 and x < 240 and y > 278 and y < 297 then
Font.Draw ("Question 1", 125, 280, font4, brightgreen)
drawbox (123, 278, 245, 297, brightgreen)
elsif x > 127 and x < 240 and y > 240 and y < 260 then
Font.Draw ("Question 2", 125, 240, font4, brightgreen)
drawbox (123, 237, 245, 257, brightgreen)
elsif x > 127 and x < 240 and y > 200 and y < 214 then
Font.Draw ("Question 3", 125, 200, font4, brightgreen)
drawbox (123, 197, 245, 216, brightgreen)
elsif x > 127 and x < 240 and y > 160 and y < 172 then
Font.Draw ("Question 4", 125, 160, font4, brightgreen)
drawbox (123, 158, 245, 176, brightgreen)
elsif x > 127 and x < 240 and y > 160 and y < 172 then
Font.Draw ("Question 4", 125, 160, font4, brightgreen)
drawbox (123, 158, 245, 176, brightgreen)
elsif x > 127 and x < 240 and y > 120 and y < 132 then
Font.Draw ("Question 5", 125, 120, font4, brightgreen)
drawbox (123, 118, 245, 137, brightgreen)
end if
%Mouse click IFs
if x > 127 and x < 240 and y > 278 and y < 297 and button = 1 then
var number : int := -15
%question1
cls
loop
put number, "," ..
number := number + 5
if number > 100 then
return
end if
end loop
end if
delay (1)
View.Update
end loop
|