Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Buttonwait
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Reza




PostPosted: Mon Jun 06, 2005 8:15 pm   Post subject: Buttonwait

hey,
i have a question about buttonwait,
i was trying to make a procedure or some sort that would keep getting buttonclicks until one of a bunch of places is clicked. I'm not using GUI.
How can i make a procedure to do that.
Thanks
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Mon Jun 06, 2005 8:59 pm   Post subject: (No subject)

Are you making your own GUI? Excellent. Smile
To do this, you first do your Mouse.ButtonWait (), then check if the x value returned by that procedure (the mouse procedure) is between the x1 and x2 of your button (or object, whatever it happens to be) and also check if the y value returned by that procedure is between the y1 and y2 of the button/object.
Try writing an if statement that would match what I just said, and post it, so we can tell you if you're on the right track. Smile
Reza




PostPosted: Tue Jun 07, 2005 7:25 pm   Post subject: Code

Hey, thanks for ur advice,
so i coded this program, it simply keeps getting clicks until it's right and then it clears screen.

setscreen ("offscreenonly,graphics:200;200")
var x, y, button, buttonNumber, buttonUpDown : int
var finish : int := 0
drawfillbox (10, 10, 100, 100, 1)
View.Update
loop
Mouse.ButtonWait ("up", x, y, buttonNumber, buttonUpDown)
exit when x >= 10 and x <= 100 and y >= 10 and y <= 100
end loop
cls
View.Update
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: