issue-#135 adding hierarchical menus

Merged to the master branch
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#135 adding hierarchical menus

Post by luowy »

@Josef
it is pity that your code cant work but CpcDropdowm can, with the same menu file,
after replaced "InitSubMenus" with "MakeDropDowns", it do work.
so I think your code has bug.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

Ivan Denisov wrote:If you want to make new menus order it has sense. I think, that Obx ant Tut can be moved to Help menu.
I realized that my suggestion is bad, because it will break possibility to remove Obx subsystem.

One of the first problem for me is that Linux version also have to support this new issue :(
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 Templ wrote: Are there any other limitations of CpcDropDown that we could eliminate?
There is a CPC Tool that disables se!ected Menus. It is a useful function, but I think the implementation (it renames files) is primative. Maybe we could incorporate a neater solution into the standard distribution?
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

Robert wrote:
Josef Templ wrote: Are there any other limitations of CpcDropDown that we could eliminate?
There is a CPC Tool that disables se!ected Menus. It is a useful function, but I think the implementation (it renames files) is primative. Maybe we could incorporate a neater solution into the standard distribution?
This is outside CpcDropDown and beyond this issue, I think.

- 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: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
I don't understand this. If CpcDropDown.DropDown is not needed then why have you included it in the menu type for $nested2?
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: I don't understand this. If CpcDropDown.DropDown is not needed then why have you included it in the menu type for $nested2?
The intention was to show that the changes of HostMenus work even with
menus that used the CpcDropDown package before. In other words, the
intention was to demonstrate that there are no migration problems of existing menu texts.

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

luowy wrote:@Josef
it is pity that your code cant work but CpcDropdowm can, with the same menu file,
after replaced "InitSubMenus" with "MakeDropDowns", it do work.
so I think your code has bug.
Why does it work for me but not for you?

What version of Windows are you using?
What version of HostMenus are you using?
Do you have CpcDropDown installed and configured in addition to the changed HostMenus?
What is the outcome of the test with CpcDropDown installed?
What is the outcome of the test without CpcDropDown installed?

- 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:
luowy wrote:@Josef
it is pity that your code cant work but CpcDropdowm can, with the same menu file,
after replaced "InitSubMenus" with "MakeDropDowns", it do work.
so I think your code has bug.
Why does it work for me but not for you?

What version of Windows are you using?
What version of HostMenus are you using?
Do you have CpcDropDown installed and configured in addition to the changed HostMenus?
What is the outcome of the test with CpcDropDown installed?
What is the outcome of the test without CpcDropDown installed?

- Josef
It doesn't work for me either. I removed the qualifier (CpcDropDown.DropDown).
I do not have CpCDropDown working on my machine which is windows XP.
I am running BB build #704.
When I press ^G when the log file has the focus nothing happens.
When I pull down the Test menu (where I put your menus) I get the message
command error: syntax error
Here is the code I am using for your menus

Code: Select all

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

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

MENU "$nested2"
"Hello World" "G" "Dialog.ShowMsg('Hello World')" "StdCmds.PasteViewGuard"
END
-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 »

Thanks, Doug.
I think I know what it is now.

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

fixed.
The tests had a dependency on the order of menus due to a subtle bug in hotkey handling.
Build http://blackboxframework.org/unstable/i ... a1.706.zip contains the fixes.

- Josef
Post Reply