|
Post by rich357 on Mar 1, 2009 16:46:20 GMT -5
I will have a series of buttons in a line and would like them all to have the same length regardless of the character count.
Do I need to give each button a unique handle or can I use the same handle for more?
#handle SETKEY(stringExpr$) - Set the link's event key to stringExpr$
What the heck does this mean and what is it for?
|
|
|
Post by davos1 on Mar 1, 2009 22:39:30 GMT -5
"Do I need to give each button a unique handle or can I use the same handle for more?" well, it seems that you can have ony one handle, (#b) , for different buttons with different actions [go],[go4]... and it works button #b1,"b1one",[go] button #b2,"b2 two",[go] button #b,"b tree",[go] button #b,"b four",[go4] button #b,"b somenumber",[go] wait [go] print " ":print "Handle is ";EventKey$ wait [go4] print "go 4" wait
|
|
|
Post by davos1 on Mar 1, 2009 22:56:33 GMT -5
#handle SETKEY(stringExpr$) - Set the link's event key to stringExpr$ What the heck does this mean and what is it for? well, according to runbasic.wikispaces.com/Buttonit is used to add a cssstyle to the existent one in that handle... The SetID() function allows the element to change one or more attributes while retaining the original class style. run it print:print 'define some CSSClass CSSClass "input.fancyButton", "{ Font-Size: 8pt; Font-Weight: Bold; Font-Style: Italic; Width: 80px; Height: 40px; Background: #C0C0C00; Color: #FFFFFF; Border-Width: Thick; Border-Style: Outset; Border-Color: #AAAAAA; }" 'assign an id to just change the background color CSSID #redButton, "{Background: #FF0000;}" 'create a button with branch label event handler button #doChange, " Do Change ", [doChange] 'assign class to the button #doChange CSSClass("fancyButton") wait [doChange] 'assign one or more attributes with SetID #doChange SetID("redButton") print:print print "The attributes defined in #redButton are" print "added to the original style .fancyButton." wait 2)but also seems to add an id to an HTML element. The SetID() function can also be used to assign attributes of a javascript defined element to a Run BASIC element. This next demo defines a javascript function to get the Coordinated Universal Time (UTC), also known as Greenwich Mean Time (GMT), and write that date and time to a button defined with the same id. Using SetID(), Run BASIC assigns that same javascript id to its native element, bringing the date and time with it. runbasic.wikispaces.com/Button
|
|
|
Post by Brent on Mar 2, 2009 16:06:34 GMT -5
Will this work for you? head "<script type=""text/javascript""><!-- function makeEqualWidth(/*list of IDs*/) { if (arguments.length) { var wid, max = 0; var els = new Array(); for (var i = 0; i < arguments.length; i++) { els = document.getElementById(arguments); wid = els.offsetWidth; if (wid > max) max = wid; } for (var i = 0; i < els.length; i++) { els.style.width = max+'px'; } } } //--></script> </head>"
button #b1, "One", [one] #b1 setid("b1") button #b2, "Two", [two] #b2 setid("b2") button #b3, "Three", [three] #b3 setid("b3")
html "<script type=""text/javascript""><!-- makeEqualWidth('b1','b2','b3'); //--></script>"
end
|
|