FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


Form Menu Accelerator Key question - submenu does not drop down

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog
View previous topic :: View next topic  
Author Message
Harrison Pratt



Des Moines, Iowa USA
Joined: 05 Nov 2000
Posts: 307

PostPosted: 1 Jul 2017 15:36    Post subject: Form Menu Accelerator Key question - submenu does not drop down Reply with quote

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.

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?
Back to top
View user's profile Send private message
Harrison Pratt



Des Moines, Iowa USA
Joined: 05 Nov 2000
Posts: 307

PostPosted: 3 Jul 2017 12:08    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum