issue-#135 adding hierarchical menus

Merged to the master branch
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#135 adding hierarchical menus

Post by Josef Templ »

Since hierarchical menus have not made it into 1.7 but are on the wish list of many users and center members,
I took a closer look into the CpcDropDown implementation and prepared a version that is integrated with HostMenus.

By integrating it into HostMenus it was possible to add support for keyboard shortcuts.

Existing nested menus that worked with CpcDropDown are expected to work without CpcDropDown being installed.
Furthermore, it is also possible to have CpcDropDown installed together with the updated HostMenus.
This should avoid any migration problems.

Here are the diffs: http://redmine.blackboxframework.org/pr ... 6a0f3ab1b6.

Here is a link to a test version: http://blackboxframework.org/unstable/i ... a1.704.zip

Are there any other limitations of CpcDropDown that we could eliminate?

I have also fixed some confusing text in the docu. It seems to refer to an older version of BlackBox.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#135 adding hierarchical menus

Post by Robert »

I use CpcDropDown extensively, so am naturally tempted to support this particular initiative.

But I agree with earlier comments that we probably want to have a higher level discussion about what are our objectives for new features post 1.7, and what are our (realistic) priorities.

We need some way of filtering new feature suggestions, and I don't know that we have such a filter yet. Are the criteria for this filter clearly documented and agreed? What is the process for deciding if a new feature fits these criteria?

I think this is an important, but difficult, discussion. Also, speaking personally, I am quite busy at the moment and so think that this discussion cannot be hurried.


At a more specific level:

1 - Does this proposal allow Menu items to be nested more than 2 levels deep, or is it basically the same function as CpcDropDown?
2 - The CpcDropDown Quick-Start gives clear instructions, with examples, showing how to use it. I don't see such instructions in the Diffs.
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 »

we probably want to have a higher level discussion about what are our objectives for new features post 1.7, and what are our (realistic) priorities.
Agreed.
I think we need to take a deep breath and consider the direction for the development of BlackBox.
Oberon Microsystems had a goal of developing a system that supported "Components".
The BlackBox Component Builder is an integrated development environment optimized for component-based software development
Do we wish to "freeze" the environment or
Do we wish to add to the capabilities of the environment?
Do we wish to change the "look and feel" of the environment?
and more ...

-Doug
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

If something is possible to make with an extension we should not add this to the basic distribution. Let's focus on more easy installation and package manager than on adopting many "bells and whistles" to the basic distribution.
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 »

Ivan Denisov wrote:If something is possible to make with an extension we should not add this to the basic distribution. Let's focus on more easy installation and package manager than on adopting many "bells and whistles" to the basic distribution.
Good comment.
In that regard, I would like to "simplify" the BlackBox code. Why? Because I frequently find myself
looking at the source code, trying to determine what it is doing when I need a feature
of it that is not provided. It seems overly complex to me.

Does anyone else feel that way?

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

As stated in the updated docu the nesting is not limited to 2 levels but is arbitrary.
Nested menus in popup menus and conditional menus still do not work as far as I have just seen. This could also be done.
However, I am not sure if I should put any additional effort into this issue :(

If I remember correctly, there was some discussion when finishing 1.7 that nested menus can be added later in 1.7.1
but because of time constraints it was not done in 1.7.

In general, nested menus are a standard feature of every Windows development system that I know, except BlackBox.
Promoting it from an extension package to the standard distribution together with some improvements
closes this gap. It does not add a lot of code. I provided an implementation together with the
feature request because I never want to propose a feature that has not been implemented, because most of the
implementation was available anyway, and because I wanted to see if it is possible to improve the missing features by integrating it into the system.

The advantages of putting this particular CPC extension package into the standard distribution are:
+ It standardizes the feature and guarantees its availability and compatibility in future releases.
+ It allows us to improve the implementation, e.g. keyboard shortcuts, popup support, conditional menu support.
+ Removing the need to install an external subsystem is a significant simplification for the user.
+ It allows us in the future to use it in case the menus keep growing. E.g Info is already pretty crowded
and new search commands could be put into a nested menu.

I am not talking about moving an arbitrary CPC package to the standard distribution.
This package is very special, I believe.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#135 adding hierarchical menus

Post by Robert »

Josef Temp wrote:This package is very special, I believe.
I would support this change as a special case, but I think we still need to have the general discussion.
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#135 adding hierarchical menus

Post by luowy »

good, a gap will be removed. long time ago I want to do it, but not succeed.
can you give a demo file how to used it?
you say the popup and condition menu have not done,I wish you can finished it.
How do a shotcut with cascade two normal keys: ctrl+M+P ? many editors can do it,I want it.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

Popup and conditional menus now also support nested menus.

Usage is the same as CpcDropDown.
Here is an example menu text. It shows that "CpcDropDown.DropDown" is not required any longer and that it does not hurt either. It uses a keyboard shortcut Ctrl-G and it uses a guard. The command will only be available if a text document has the focus.

MENU "Test"
"nested" "" "$nested" ""
END

MENU "$nested"
"deeply nested" "" "$nested2" ""
END

MENU "$nested2" ("CpcDropDown.DropDown")
"Hello World" "G" "Dialog.ShowMsg('Hello World')" "StdCmds.PasteViewGuard"
END


- Josef
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

If you want to make new menus order it has sense. I think, that Obx ant Tut can be moved to Help menu.
Post Reply