separators in popup menus? [Solved]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

separators in popup menus? [Solved]

Post by stam » Mon Jun 07, 2021 11:16 pm

Is it possible to have separators/dividers and submenus in a popup menu in LiveCode, like this popup menu in the IDE?
I've not been able to find any info on this....
popupmenu.jpg
Last edited by stam on Tue Jun 08, 2021 12:35 am, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9838
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: separators in popup menus?

Post by FourthWorld » Mon Jun 07, 2021 11:42 pm

The Human Interface Guidelines for desktop OSes do not support disabled items in option controls, and accordingly they are not supported in LiveCode.

If you have enough items were dividers are needed to help users keep them straight, maybe a dialog window or splitting them up into multiple controls might reduce cognitive load.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: separators in popup menus?

Post by dunbarx » Tue Jun 08, 2021 12:25 am

Hi.

Separators can indeed be used in option-style menus. Load one with something like:
abc
def
-
ghj
klm
-
xyz
I have not tested whether hierarchal menuItems are supported.

Craig

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: separators in popup menus?

Post by stam » Tue Jun 08, 2021 12:27 am

Ok Richard, i'll bite ;)
FourthWorld wrote:
Mon Jun 07, 2021 11:42 pm
The Human Interface Guidelines for desktop OSes do not support disabled items in option controls, and accordingly they are not supported in LiveCode.

As should be evident in the example i posted above, i'm specifically referring to a contextual menu.
With this in mind, your statement is factually incorrect - please see the Apple desktop human interface guideline on contextual menus here: https://developer.apple.com/design/huma ... ual-menus/

Please also see Apple's advice on 'Menu Anatomy' here: https://developer.apple.com/design/huma ... u-anatomy/, which applies to both normal and contextual menus

On the section on Organizing Menu Items it specifically mentions:
Use separator lines to create visually distinct groups of related menu items. The number of groups to provide is partly an aesthetic decision and partly a usability decision.

I haven't read the Windows interface guidelines in detail, but a quick glance similarly shows liberal use of dividers: https://docs.microsoft.com/en-us/window ... /cmd-menus and in my limited Linux experience, I am pretty certain dividers are implemented in contextual menus there as well.
FourthWorld wrote:
Mon Jun 07, 2021 11:42 pm
If you have enough items were dividers are needed to help users keep them straight, maybe a dialog window or splitting them up into multiple controls might reduce cognitive load.

It does not follow that just because i'm asking for dividers that i must be referring to many different options that would 'increase cognitive load'.
I only have two groups of options that should be separated as cognitively there are two different purposes and only 1 contextual menu. This is standard fair across all desktop systems.

Or perhaps you're referring to something else?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9665
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: separators in popup menus?

Post by dunbarx » Tue Jun 08, 2021 12:31 am

Stam.

Recent posts crossed in the mail. Read upwards...

Craig

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: separators in popup menus?

Post by stam » Tue Jun 08, 2021 12:33 am

dunbarx wrote:
Tue Jun 08, 2021 12:25 am
Hi.

Separators can indeed be used in option-style menus. Load one with something like:
abc
def
-
ghj
klm
-
xyz
I have not tested whether hierarchal menuItems are supported.

Craig
Ah perfect, that did it, thank you Craig!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9838
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: separators in popup menus?

Post by FourthWorld » Tue Jun 08, 2021 12:51 am

stam wrote:
Tue Jun 08, 2021 12:27 am
Or perhaps you're referring to something else?
Excellent homework. It's nice to find a second person who reads those documents.

Yes, I read the ambiguous term "popup menu" as "option control", as I noted explicitly in my reply.

As for context menus , yes, those are command sets and not selectors, so any guidance provided for selectors would not apply.

That said, while it's easy to make both dividing lines and submenus in context menus (what problem did you run into?), Apple's HIG includes (or used to, before they trimmed it way down) a reminder that submenus are physically cumbersome to use, and accordingly should be used as sparingly as practical in the menu bar, avoided elsewhere if at all possible.

And, like all guidelines, you'll likely be able to find exceptions to OS vendor guidance in products from the OS vendor themselves. So if finding justification is more interesting than providing ergonomically-friendly interfaces, knock yourself out.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: separators in popup menus? [Solved]

Post by stam » Tue Jun 08, 2021 12:57 am

I really only asked about submenus as an afterthought, because they’re in the screenshot from LC’s IDE.

The main question was about dividers (hence the title of the post) and I thought posting a pic of a contextual menu would make that clear that’s what i was referring to…

Sorry if this caused any confusion!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9838
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: separators in popup menus? [Solved]

Post by FourthWorld » Tue Jun 08, 2021 1:13 am

stam wrote:
Tue Jun 08, 2021 12:57 am
I really only asked about submenus as an afterthought, because they’re in the screenshot from LC’s IDE.
Yeah, any app designer wants to leave wiggle room for when any special needs arise that HIG authors didn't account for. Dev tools in general take a lot of liberties with conventions adhered to in consumer apps, and a dev tool that allows programming and runtime in the same environment will need swaths of wiggle room.
The main question was about dividers (hence the title of the post) and I thought posting a pic of a contextual menu would make that clear that’s what i was referring to…

Sorry if this caused any confusion!
No worries. UI nomenclature evolves a lot over the years, and language precision isn't a feature of English anyway. Most good questions take more than a single post to answer effectively.

In addition to the good reading in the OS HIGs, the LiveCode User Guide has some useful info. In Programming a User Interface -> Programming Menus and Menu Bars there's a section for "Creating Cascading Menus" (submenus) on pg 176, and the following page on "Ticks, Dashes & Checks in Menus" discusses dividers, check marks, and diamond marks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: separators in popup menus? [Solved]

Post by stam » Tue Jun 08, 2021 1:17 am

FourthWorld wrote:
Tue Jun 08, 2021 1:13 am
In addition to the good reading in the OS HIGs, the LiveCode User Guide has some useful info. In Programming a User Interface -> Programming Menus and Menu Bars there's a section for "Creating Cascading Menus" (submenus) on pg 176, and the following page on "Ticks, Dashes & Checks in Menus" discusses dividers, check marks, and diamond marks.
The folly of becoming overly reliant of google searching! I must not have used terms that would locate this and didn't really think to check the User Guide... Thanks for highlighting this Richard!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9838
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: separators in popup menus? [Solved]

Post by FourthWorld » Tue Jun 08, 2021 1:27 am

stam wrote:
Tue Jun 08, 2021 1:17 am
FourthWorld wrote:
Tue Jun 08, 2021 1:13 am
In addition to the good reading in the OS HIGs, the LiveCode User Guide has some useful info. In Programming a User Interface -> Programming Menus and Menu Bars there's a section for "Creating Cascading Menus" (submenus) on pg 176, and the following page on "Ticks, Dashes & Checks in Menus" discusses dividers, check marks, and diamond marks.
The folly of becoming overly reliant of google searching! I must not have used terms that would locate this and didn't really think to check the User Guide... Thanks for highlighting this Richard!
Your instincts to use a general web search engine are good, and often well rewarded (I prefer DuckDuckGo for privacy reasons, but most work well enough).

But for LiveCode essentials like menu building, the User Guide is reasonably comprehensive, enough to provide a good foundation.

In fact, it also serves as an example of the value of submitting feedback directly to the company (something that comes up whenever we see folks insisting on posting suggestions for the company here in this user-to-user forum): for many years, the menu item in LC's Help menu linking to the User Guide was buried in the middle of that long menu, easily overlooked. It's such a useful document, and represents a considerable investment on their part, it's a shame that it's not read more often. So I wrote the team suggesting it be placed at the top of the Help menu, and they met me more than halfway, moving it second from the top after the "Start Center" (a reasonable compromise, since of course starting with Start isn't a bad notion).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: separators in popup menus? [Solved]

Post by bogs » Tue Jun 08, 2021 11:19 am

Just thought I'd pop into this hig'ly discussion to add that Lc *does* include a little tool to make your menu creation a LOT simpler, and I don't know if you came across it yet.

Just to make sure I understood your goal, your looking to create a pop up menu that has dividers and you used (as an example) the right click object menu from within the IDE when you right click on a {card | stack | object}.

If you go to the "Tools" menu -> "Menu Builder", you get this fairly complete menu builder....
aPic_mnuBuilder1.png
Hmmm...'dis mus be da plaze...
aPic_mnuBuilder1.png (20.76 KiB) Viewed 5340 times
Once you've filled out whatever you need to fill out, with dividers / subMenus / whatever and give it a name, you get a group with a button in it that is generally set to 'popUp'. By going to that buttons properties, you can set it to which ever of the button types you want.

Set the group property to not visible, write your mouseUp handler like so....

Code: Select all

on mouseUp pButton
	if pButton is 3 then popUp button "mnuPopUp"
end mouseUp
...and you get the following (Note that the tool palette is showing this program running, the menu is *not* the IDE menu)....
aPic_mnuBuilder2.png
A little pop to go with those fries...?
You can even have the builder set up your script skeleton menu, all ready for you to fill out.

This is a great little tool, and is mentioned very little in general, so I figured I'd mention it here.

*Edit - I should mention that the only thing I have found I was unable to do with the menu builder is insert icons in front of menu items (there probably is a way to do this, I'm just REALLY lazy !), however, you could also create a menu using a stack (suggestion from Craig a while ago), and make it as fancy as you want, however that is a little outside the discussion here).
Image

stam
Posts: 2683
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: separators in popup menus? [Solved]

Post by stam » Tue Jun 08, 2021 11:59 am

Hi Bogs,
bogs wrote:
Tue Jun 08, 2021 11:19 am
Just thought I'd pop into this hig'ly discussion to add that Lc *does* include a little tool to make your menu creation a LOT simpler, and I don't know if you came across it yet.
while that is overkill for my current need (really the hyphen did the trick!) that is really interesting to know - i missed this feature and am enjoying that i continue to be pleasantly surprised by LC's features (it's just a pity so many are hidden!)

Thank you for alerting me to this! (i've not yet delved into 'proper' menu building, this will likely be helpful...)
Stam

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: separators in popup menus? [Solved]

Post by bogs » Tue Jun 08, 2021 12:24 pm

Overkill? Hee hee, I work under the theory that if a little is good, too much should be just right :twisted:

I use this all the time, even for the simplest menus, just to save typing time. In fact, the only time I don't use it literally is when I need to use a stack for a menu. I've setup about 9 different menus I use all the time and stuck them on my menus stack for easy importing / exporting into my projects (start using stack "mnuStack").

Takes all the guesswork right out of the equation.
stam wrote:
Tue Jun 08, 2021 11:59 am
... i continue to be pleasantly surprised by LC's features (it's just a pity so many are hidden!)
I think more is the pity that many of these useful gadgets were removed entirely, like the dbquery builder, the animation builder, the report builder, etc.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9838
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: separators in popup menus? [Solved]

Post by FourthWorld » Tue Jun 08, 2021 4:34 pm

How "hidden" is a Menu Builder tool accessible from the menu bar's Tools menu, or menu functionality described in the manual under the section on menus?

It's just a deep product. It has a lot going on. I don't think it's practical to expect either the IDE or oneself to be able to eliminate the cognitive load of mastering thousands of features in any way that makes all of them feel equally obvious.

Computers are weird; programming them is even weirder. Almost nothing in any human artifact is truly "intuitive", no matter how much reviewers have overused the word beyond all meaning for so many years. And with programming, multiply that.

Everyone with every non-trivial tool acquires mastery only after much practice. And the most serious learners benefit from coaching. This has always been true with human learning, from forging bronze to competing in e-sports. LiveCode is no exception.

From the forum at Athens' Lyceum to the forums on the web, learning is accelerated by asking questions of ol' timers who've already made the mistakes they want to help younger people avoid.

But mistakes are an inherent part of the learning process. Indeed, the absence of mistakes indicates little is being learned.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”