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

Username:   Password: 
 RegisterRegister   
 In which cases would you use this button code?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: Thu Jan 29, 2004 10:52 pm   Post subject: In which cases would you use this button code?

In which cases would you use:
code:

GUI.CreateButton (x, y, width : int, text : string,
    actionProc : procedure x ()) : int


and when would you useK
code:

GUI.CreateButtonFull (x, y, width : int, text : string,
    actionProc : procedure x (), height : int, shortcut : char, default : boolean) : int
Sponsor
Sponsor
Sponsor
sponsor
shorthair




PostPosted: Thu Jan 29, 2004 10:56 pm   Post subject: (No subject)

There is no need for create button full really , and i warn you as being a new programmer to istead of going into the path of GUI , go into the path of making your own buttons ,that way ther eis not reset prglems or mixups , and it will be alot fater aswell , if you would like to learn more about making your own buttons PM me
Paul




PostPosted: Thu Jan 29, 2004 10:58 pm   Post subject: (No subject)

You mean like using mousewhere and stuff, check the x and y coordinates?
the problem is, I dont know how to make the program stop and wait for a click

like this:
code:

var font := Font.New ("serif:24")
var x, y, button : int
       
            Mouse.Where (x, y, button)
           drawbox (6, maxy -111, 111, maxy-74, black)
            drawfillbox (7, maxy -110, 110, maxy-75, grey)
           Draw.Text ("sure bet", 10, maxy - 100, font, 34)
           
           if button = 0 and x>6 and x < 111 and y > maxy-111 and y< maxy-74then
                locate (maxrow -5, maxcol -5)
                put "Sure Bet"
            else
                put " not clicked"
       
end if

how can I make it so that only a click is responded to?
jonos




PostPosted: Thu Jan 29, 2004 11:36 pm   Post subject: (No subject)

i think you need to change button = 0 to button = 1 because button = 0 is no click on the mouse. also you should put it in a loop i think , that's what i do...
Delta




PostPosted: Thu Jan 29, 2004 11:36 pm   Post subject: (No subject)

Well thats the thing... GUI.CreateButtonFull... at least the only reason I use it... is because you can set a shortcut key for it... say you want to press ctrl+z to undo something... then boom... it runs the button procedure... very useful
Paul




PostPosted: Thu Jan 29, 2004 11:38 pm   Post subject: (No subject)

Thanx Jonos, even though I didn't get it right away, I got it eventually, I'll run a loop ONLY for the assignment of the variables, stupid me. Yay, self learning, I feel proud
we64




PostPosted: Thu Jan 29, 2004 11:44 pm   Post subject: (No subject)

maybe you could do something like what I did in my hangman program...
if you do, change my button a little better.... Laughing Laughing (my buttons were crappy. Very Happy )
Paul




PostPosted: Thu Jan 29, 2004 11:45 pm   Post subject: (No subject)

you should see Ivan's, he showed me how to do the unpushed/pushed buttons.
jonos




PostPosted: Fri Jan 30, 2004 12:09 am   Post subject: (No subject)

seriously, if you have any problems with turing, just go to turing reference and search for that command you have problems with, that's what i did for some stuff and it really helped (that's how i figured out the button = 1 thing a little white back)
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  [ 9 Posts ]
Jump to:   


Style:  
Search: