Scrolling Menu

dunbarx dunbarx at aol.com
Mon Mar 20 23:31:45 EDT 2017


So I made a stack that had a group of a dozen buttons piled up vertically.
The height of that pile was greater than the height of the stack. I placed
another thin button alongside the group that was of the same height as the
stack, tall and skinny.

The numbers are not important, but I placed this in the skinny button
script:

on mouseDown
   put item 2 of the mouseLoc into refLoc
   repeat until the mouse is up
   if  refLoc - the top of btn "xyz"  < 40 then
      set the top of grp 1 to the top of grp 1 - 1
   else
      set the top of grp 1 to the top of grp 1 + 1
   end if
   end repeat
end mouseDown

Now I make the stack a stack menu. The issue with a stack menu is that very
few messages are sent at all, but "mouseDown" is one that is. The stack
remains nice and still but the group scrolls smoothly, up or down depending
on where you click vertically. Not rocket science.

The stack itself really believes it is a menu style button, even containing
a phantom "menuPick" handler for convenience. Now this a real kluge, in that
the stack is not scrolling, but rather the controls are, and in the
"opposite" direction. 

This surely can be enhanced to show a scrollbar to emulate a scroll button
at the stack level. All the properties of the button, stack and group are
accessible; there should be no reason that one could not make a "scrolling
stack"

Craig

So the 



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Scrolling-Menu-tp4713182p4713221.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list