Discussions related to Visual Prolog
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Form Menu Accelerator Key question - submenu does not drop down

Unread post 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?
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post 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.
Post Reply