Page 1 of 1

Form Menu Accelerator Key question - submenu does not drop down

Posted: 1 Jul 2017 15:36
by Harrison Pratt
I created a menu and attached it to a form using the form's Property Editor in the IDE. Also I created MenuItemListener code to handle the menu event.

Code: Select all

predicates     onMenuItem : window::menuItemListener. clauses     onMenuItem( Source,  resourceIdentifiers::id_chart_modify_properties ):-           Chart = chart::getChart( class_name() ),         _ = chartPropertyEditor::display( Source, Chart ),         !.       onMenuItem(_,_).
Everything works as expected, except the way the form's Menu behaves.

The submenu drops down normally on a mouse click, but it doesn't drop down when accessing the menu using the Alt-<somekey> or the assigned Accelerator key.

When I test the Form's menu in the IDE editor, the Alt-<somekey> causes the the submenu to show as expected.

Do I need to write custom code to handle the accelerators for form menus?

Posted: 3 Jul 2017 12:08
by Harrison Pratt
Got it!
I needed to add onInitMenu/1 in the property editor for the form's Event, and do the same for the TaskWindow to restore its normal menu behavior after the form is closed.