issue-#135 adding hierarchical menus

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

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

Ivan Denisov wrote:One problem detected. It is not mapping the menu items... So they can not be translated well.
I knew that there was an additional limitation of CpcDropDown but couldn't remember what it was.
Thanks for the hint. I will look at it.

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

DGDanforth wrote: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
Doug, you are using the wrong build.
build #716 belongs to issue-#138.

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

The label of a submenu reference is now preserved in InitSubmenus.
This preserves both the mapping with Dialog.MapString and the hotkey setting.

@Ivan: I had to do it differently from your proposal because your version
ignores the hotkeys (the underlined key in case you operate the menu with the keyboard).

- 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 Templ wrote:Doug, you are using the wrong build.
build #716 belongs to issue-#138.
You have told both Doug & myself that build 716 is wrong for Issue 135 - this does not surprise me, which is why I asked!
Will someone please tell me which build is right - the Voting topic included Diffs, but not a reference to a test build, as far as I could see.

I know I am too slow for the vote, but I want to test it anyway.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

Now translations works fine.

Doug, I think, that new voting required.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

Robert wrote:I know I am too slow for the vote, but I want to test it anyway.
Just find appropriate issue number = 135
here: http://blackboxframework.org/unstable/
and download last version in the directory = 719.
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 »

Ivan Denisov wrote:
Robert wrote:I know I am too slow ...
Just find appropriate issue number = 135
here: http://blackboxframework.org/unstable/
and download last version in the directory = 719.
Apologies - I was just about to delete my last post, but you have answered already anyway - thanks.

Josef explained what to do, I read that, but for no good reason initially misunderstood his comment!
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:Now translations works fine.

Doug, I think, that new voting required.
New vote because ... bug was fixed?
I need a diffs file for that.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#135 adding hierarchical menus

Post by Ivan Denisov »

DGDanforth wrote:
Ivan Denisov wrote:Now translations works fine.

Doug, I think, that new voting required.
New vote because ... bug was fixed?
I need a diffs file for that.
http://redmine.blackboxframework.org/pr ... b7dfe816ed

Josef also did some cosmetic renaming, so there are long diff. However the only important part is inside the InitSubmenus procedure.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#135 adding hierarchical menus

Post by Josef Templ »

The important change is the addition of

res := WinApi.GetMenuStringW(menu.menuH, item(Item).id, label, LEN(label), {});

in InitSubmenus.

Since "submenu" seems to be a single word in english, I have changed the capitalization
of "subMenu" to "submenu" wherever it appeared.

- Josef
Post Reply