Scrolling Menu

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
Greetings!   I have created a stack with a column of buttons and set it’s name to the menuName of a button.   It’s popuping up perfectly except that if the height of the stack is highter than the screen, it doesn’t scroll with the mouse as a normal menu does.  I tried grouping the buttons and added a scrollbar, but that didn’t work.  Is there a property I need to set?  Or, is there another method or workaround avaliable?

Thanks in advance,
Dan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

dunbarx
I almost know what you are seeing, but not quite.

Is it a menu-style button that is in question? Or some other control, like a scrolling table field? And do you mean that the "top" of the stack is above the "top" of the screen? Please explain.

Craig Newman
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
Craig,

It’s that the stack this is acting as the menu is higher (taller) than the screen.  So, the bottom of the stack is below the bottom of the screen.  Can’t scroll the menu (the stack) to see or select the button that are out of view.   Hope that makes sense.

-Dan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
On 3/19/17 8:22 PM, Dan Friedman via use-livecode wrote:
> Craig,
>
> It’s that the stack this is acting as the menu is higher (taller)
> than the screen.  So, the bottom of the stack is below the bottom of
> the screen.  Can’t scroll the menu (the stack) to see or select the
> button that are out of view.   Hope that makes sense.

I suspect that Craig didn't know that stacks can be menus. I can't think
of an easy way to get the stack to scroll. There may be a way with some
intensive scripting, maybe by tracking the mouseLoc and moving all the
controls up and down.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
Ah.


Have tried to set the size, top or bottom of the stack window to accommodate? This should be easy to manage based on the parameters of your selection gadgetry. I am not quite clear how you are selecting the various buttons, but a single handler in the card script ought to suffice.


Craig



-----Original Message-----
From: Dan Friedman via use-livecode <[hidden email]>
To: use-livecode <[hidden email]>
Cc: Dan Friedman <[hidden email]>
Sent: Sun, Mar 19, 2017 9:25 pm
Subject: Re: Scrolling Menu

Craig,

It’s that the stack this is acting as the menu is higher (taller) than the screen.  So, the bottom of the stack is below the bottom of the screen.  Can’t scroll the menu (the stack) to see or select the button that are out of view.   Hope that makes sense.

-Dan

_______________________________________________use-livecode mailing [hidden email] visit this url to subscribe, unsubscribe and manage your subscription preferences:http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

dunbarx
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
"I suspect that Craig didn't know that stacks can be menus. "

I did, but did not connect those dots. And as you say, I also do not know how to add a scrollbar to a stack.

But a kluge ought to be doable. I will play around for a bit.

Craig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

dunbarx
Jacque.

I actually never tried using a stack as a menu. So I just did. But in both v6.7 and 8.1.3, if I create and name a new stack, add a single button to it, and set the "menuName" of the button to the stack name, as soon as I click on the button, LC crashes and quits.

Was it something I said?

Craig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
On 3/19/17 10:03 PM, dunbarx via use-livecode wrote:
> I actually never tried using a stack as a menu. So I just did. But in both
> v6.7 and 8.1.3, if I create and name a new stack, add a single button to it,
> and set the "menuName" of the button to the stack name, as soon as I click
> on the button, LC crashes and quits.
>
> Was it something I said?

More like something you did. :) I think you put the engine into a loop.
Back in the old MetaCard days, when I was just a tot and walked to
school uphill both ways (in a blizzard,) this used to be the only way we
could make menus. It's still the only way to build a menu that has real
icons or other non-text elements.

In the menu stack, you put buttons that do stuff, usually in mouseDown
or mouseUp handlers. Size the stack to about the width of a real system
menu and make it just enclose its contents. The buttons should be
edge-to-edge in a vertical column, no borders. Basically you are
implementing a hand-made menu object. When the user clicks on the
buttons in the stack, they do menu-like things, like calling a handler
in the mainstack or whatever. (Your test stack doesn't need any button
handlers if you're just testing the display.)

Now you need a way to to tell LC to display the stack menu, so you
create a new button on the mainstack. That's the one that needs the
menuName, so it knows which stack to draw. When the user clicks this
mainstack button, it looks up its menuName, finds that stack, and
displays it.

I wonder what the engine was thinking as it tried to menu-ify a stack
that was holding the button in the stack that was calling itself to show
the stack that was holding the button in the stack that was calling
itself to...

Never mind. You'd think there'd be a recursion warning though.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

dunbarx
Jacque.

Aha.

I will try using another stack. The user guide does not make this as clear as it might, which is where I went to read up on how to make one.

Craig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
Dan Friedman wrote:

 > Greetings!   I have created a stack with a column of buttons and
 > set it’s name to the menuName of a button.   It’s popuping up
 > perfectly except that if the height of the stack is highter than
 > the screen, it doesn’t scroll with the mouse as a normal menu does.
 > I tried grouping the buttons and added a scrollbar, but that didn’t
 > work.  Is there a property I need to set?  Or, is there another
 > method or workaround avaliable?

Reported March 13, 2008:
http://quality.livecode.com/show_bug.cgi?id=6072

I know of no workaround other than to either use a conventional
text-based menus or to redesign with a smaller number of menu items.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
In reply to this post by Sannyasin Brahmanathaswami via use-livecode
I seem to remember in the past that I could set the label of a button, then set the htmlText of a character to some html code, and was able to get that to work. I may be misremembering.

Bob S


> On Mar 19, 2017, at 23:23 , J. Landman Gay via use-livecode <[hidden email]> wrote:
>
> More like something you did. :) I think you put the engine into a loop. Back in the old MetaCard days, when I was just a tot and walked to school uphill both ways (in a blizzard,) this used to be the only way we could make menus. It's still the only way to build a menu that has real icons or other non-text elements.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

dunbarx
This post was updated on .
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 named "xyz" 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"  < 60 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, but 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 that button, as well as the stack and group are accessible; there should be no reason that one could not make a "scrolling stack", even within the limits placed on that stack as it is rendered as a stack menu.

Craig

So the
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scrolling Menu

Sannyasin Brahmanathaswami via use-livecode
dunbarx wrote:

 > So I made a stack that had a group of a dozen buttons piled up
 > vertically.
...
 > 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.

Using buttons on a stack as menu items dates back to the very earliest
days of MetaCard, when the only supported UI was Motif.  The various
settings available for buttons in support of that role (e.g. "cascade"
menustyle) are great for Motif - but not to much for anything else.

Thankfully, in the late '90s the engine evolved to include support for
menus as textual lists, which most of us use today.

Stack menus might be candidates for deprecation were it not for one
thing they continue to do well:  if you need a graphical menu, such as a
gallery picker, the remain an excellent solution.

As one expects with menu items, the full scope of event messages we get
for buttons used in more conventional contexts have no purpose when used
as a menu.  MouseDown triggers the selection which closes the menu
stack, and menuPick is generated as it is with modern textual buttons to
allow handlers to respond to menu selection.

This part was interesting to me, since I've not been able to get
scrolling happening at all:

 > Now this a real kluge, in that the stack is not scrolling, but rather
 > the controls are, and in the "opposite" direction.

Can you describe that in more detail? How do you know the content region
of the stack isn't scrolling if all of the objects contained within it
are scrolling?

If you see anything different than what's reported here it may be
helpful to add a note to this report, and please include your OS and LC
versions:
http://quality.livecode.com/show_bug.cgi?id=6072


 > 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"

We could, but you'll find that once you mouse down on the scrollbar the
menu is dismissed.  This would be an undesirable behavior for any normal
stack, but it's exactly what one wants for menus, which don't normally
have scrollbars.

I needed a middle ground a while back when designing Devo 4, where I
wanted controls to appear temporarily similar to how a menu provides
them, but I also wanted the ability of interacting with them more akin
to a normal stack.

The result is what I call a "flyout pane", and you'll find examples in
the Devo 4 plugin available for free at my site:

http://fourthworld.com/products/devolution/index.html

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...