issue-#135 adding hierarchical menus

Merged to the master branch
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#135 adding hierarchical menus

Post by DGDanforth »

I prefer the syntax

MENU "A"
...
END

MENU "B"
"Embedded A" "" "$A" ""
END

so that any menu can be embedded in any other menu without first specifying that it is an "embedding" menu.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

This is almost the same as what we already have.
Except that you removed the leading $ in the menu name, right?
This leads to some complications and an inconvenience:

If you select $A you can easily navigate to any place where the menu is either defined or referenced
by simply pressing F3 (Search). You loose this convenience when you remove the leading $ in the menu definition.
You also loose the explicit marker that the menu is a submenu. You would have to read the complete file
to see if it is referenced somewhere. This is a complication for both, the human reader and the
implementation.

- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#135 adding hierarchical menus

Post by DGDanforth »

Josef Templ wrote:This is almost the same as what we already have.
Except that you removed the leading $ in the menu name, right?
Yes
Josef Templ wrote: This leads to some complications and an inconvenience:

If you select $A you can easily navigate to any place where the menu is either defined or referenced
by simply pressing F3 (Search).
You could search for either "A" or "$A"
Josef Templ wrote: You loose this convenience when you remove the leading $ in the menu definition.
You also loose the explicit marker that the menu is a submenu. You would have to read the complete file
to see if it is referenced somewhere
. This is a complication for both, the human reader and the
implementation.

- Josef
It is not a complication for the reader but it is a complication for the implementation.
An example of not requiring the "$" for menus is
INCLUDE "Dev"
and then
MENU "A"
"Embedded Dev" "" "$Dev" ""
END
The A menu has an embedded Dev sub menu which is identical to the BB Dev menu.
I find that much simpler than having to redefine the menu
MENU "$Dev"
...
END
("Dev" is only an example)
-Doug
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

How do you decide if a menu is a top-level menu (i.e. visible in the menubar) or not?
There must be some rule for both the human reader/writer and the implementation
and it should be a simple rule. I am not sure if I understand the rule in your proposal.

- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#135 adding hierarchical menus

Post by DGDanforth »

Josef Templ wrote:How do you decide if a menu is a top-level menu (i.e. visible in the menubar) or not?
There must be some rule for both the human reader/writer and the implementation
and it should be a simple rule. I am not sure if I understand the rule in your proposal.

- Josef
If a menu is not embedded, it is a top level menu.
If "A" does not appear as "$A" in any menu then it is a top level menu.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

DGDanforth wrote: If a menu is not embedded, it is a top level menu.
If "A" does not appear as "$A" in any menu then it is a top level menu.
I didn't want and still do not want to change the menu file syntax at all.
Currently there is no change of the syntax.
Also in CpcDropDown there was no change of the syntax of a menu file.

If you have to look up all the menu file to decide if a menu is a top level menu or not,
this would be a big step back.

To summarize, I think that there is no significant progress to expect from any further syntax discussion.
I only started this discussion because I thought that there is a limitation in the sense that
a top-level menu starting with $ is not possible. However, it is. See the updated docu.
So there is no real limitation at all and no need to change the syntax.

This issue is ready for voting, from my point of view.

- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#135 adding hierarchical menus

Post by DGDanforth »

Poll created.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

One problem detected. It is not mapping the menu items... So they can not be translated well.
test.png
test.png (13.7 KiB) Viewed 7503 times
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

Proposed solution.
Attachments
map.png
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#135 adding hierarchical menus

Post by DGDanforth »

Not only that But I just tried

Code: Select all

MENU "$Search"
  "Files" ...
  "File" ...
END

MENU "Test"
  "Search" "" "$Search" ""
END
and $Search showed up on the top level menu bar!

I thought that was not supposed to happen.
I am using build #716
Post Reply