Computer Science Canada

Button help

Author:  HaVoC [ Tue Jan 20, 2004 12:39 pm ]
Post subject:  Button help

What is the command? So far I have
code:
btn := 2
            if Mouse.Where (qx, qy, btn) = Mouse.Where(qx,qy,btn) then
                locatexy (40, 110)
                put word
            end if

I know that if statement can't work, but You get the point of what I'm trying to do...

Author:  overcoat [ Tue Jan 20, 2004 3:04 pm ]
Post subject: 

do u want 2 help with making buttons???

import GUI

var button:= GUI.CreateButtonFull (maxx div 2 - 40, maxy div 2 - 60, 0, "Exit", GUI.Quit, 0, '^Q', false)

loop
exit when GUI.ProcessEvent
end loop

u dont need mousewhere 4 that

Author:  AsianSensation [ Tue Jan 20, 2004 9:05 pm ]
Post subject: 

overcoat, you are stupid.

havoc, I think you are trying for something like this?

code:
if btn = 2 then
   blah blah blah
end if


Mouse.Where will assign a value to btn.

Author:  HaVoC [ Fri Jan 23, 2004 9:54 am ]
Post subject: 

Yeah that''s it. Except I have other values. See I have mathematical equations falling down the screen, and when a user clicks it, it does what i want it do.

So basicly I need seomthing like,

if questionx <= 100 and questionx >=50
blah blah
end if
but how would I do that?

Author:  McKenzie [ Fri Jan 23, 2004 11:31 am ]
Post subject: 

Havoc, checking to see if they clicked on your equation is the same as checking if they clicked on a box, which in turn is the same as graphing inequalities in math (it is a math program right?)
drawbox(left,bott,right,top,c)

<in loop>
if mousex > left and mousex < right and mousey > bott and mousey < top and button >0 then
...

Author:  Cervantes [ Fri Jan 23, 2004 1:56 pm ]
Post subject: 

death to pre-existing GUI!!

I haven't learned GUI and don't intend to until my compsci class makes me. I'd much rather make my own GUI. and I do that like Mackenzie just said


: