Hi Folks,
I'd like to use icon 201317 as a button. It shows an up and a down arrow so the button needs to have a script to run depending on which part is clicked. I'd also like it to increment more if the mouse is held down. Would anyone know how this could be done or where I could find an example?
Many thanks in advance.
Jim H
icon 201317 split button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I just tried it out:
You need:
There also seems to be a problem with doubleclick-hold (click, then quickly hold the mouse down), due to the way Rev handles doubleclicks, but I didn't find a workaround to that, and it's not a common action.
have fun
Björnke
PS: this was nice to try out, and work's surprisingly well, you can even "scrub" while mousestilldown (it'll always count up or down depending on the mouse position)
Code: Select all
on mouseDown
doCalc
end mouseDown
on mouseStilldown
doCalc
end mouseStilldown
on mouseUp
set the icon of me to 1005
end mouseUp
on mouseRelease
set the icon of me to 1005
end mouseRelease
on doCalc
if the mouseV- the top of me >= the height of me div 2 then
set the icon of me to 1008
subtract one from field "showvalue"
else
set the icon of me to 1009
add one to field "showvalue"
end if
end doCalc
- a field called "showvalue"
- a button with the style set to transparent, showname false, autohilite false, script as above
- the three images 201317, 201318, 201319 placed onto the stack
There also seems to be a problem with doubleclick-hold (click, then quickly hold the mouse down), due to the way Rev handles doubleclicks, but I didn't find a workaround to that, and it's not a common action.
have fun
Björnke
PS: this was nice to try out, and work's surprisingly well, you can even "scrub" while mousestilldown (it'll always count up or down depending on the mouse position)
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
icon 201317 split button
That's brilliant!
And if I repeat the doCalc on mouseStilldown it increments faster - great.
Thanks a million.
Jim H
And if I repeat the doCalc on mouseStilldown it increments faster - great.
Thanks a million.
Jim H
Re: icon 201317 split button
I suggest to, whenever possible, use a build in way for doing things. So to vary the speed of a moustStillDown it's best to use the idleRate property.hamlynart wrote:And if I repeat the doCalc on mouseStilldown it increments faster - great.
You did read all the documentation entries for terms you don't know yet and just heard about on the forum, right

Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode