View topic - Menu Utility

Menu Utility

anything that doesn't fit to other groups.

Menu Utility

Postby wednesday » Mon Feb 13, 2012 9:36 am

Hi,

My Requirement is to have a Menu on a MenuBar in a Window.

I am implementing this by having a hotkey to list down the appropriate Menu.
Say I have 3 Menu

File Edit View

whose hotkey are alt+f, alt+e, alt+v resp.

Now when I press 'alt+f' 'File' Menu is displayed as expected. But now if I press right arrow key the focus shifts to 'Edit' Menubutton but 'Edit' Menu is not displayed. Only if I press 'Enter' or hotkey 'Alt+e' My menu is getting displayed.

Find a sample project attached.
1) Run Menu_Test
2) Press alt+f.
file Menu is displayed
3) Now press right arrow key
Focus shifts to 'Edit' MenuButton but but Edit menu is not displayed. Here I want My Edit Menu to be displayed. If i press right arrow key againg my focus shifts to 'View' MenuButton but View menu is not displayed.

And another query related to PtFileSelection

I want to open a new file using PtFileSelection. When i select a file from the list using up/down arrow keys, the highlighted file name is not reflected in 'Name' section of File Selector. only if I press enter or I click on the file by mouse the name gets reflected.

1) Open a terminal
2) ped xyz
3) 'Alt+f'-> Open ( File Selector opens )
4) Now using up down arrow keys select files.

Here as and when the file is selected Name of the file does not get reflected in 'Name' section. We got click it with mouse to reflect the name in 'Name' section of File Selector.
Attachments
Menu_Test.zip
(37.16 KiB) Downloaded 142 times
wednesday
Active Member
 
Posts: 48
Joined: Tue Apr 28, 2009 7:10 am

Re: Menu Utility

Postby slougheed » Mon Feb 13, 2012 9:00 pm

I'll try to answer your first question. You need to add a module callback on the Pt_CB_ARM event (see http://www.qnx.com/developers/docs/6.4. ... enumodules and scroll down to the "Using a menu module" section)

I've attached an updated project although I'm using QNX 6.5.0 with Momentics 4.7 and I see you have 4.5 so it may not work on your system. All I've done is add the callback to each of the ARM events.
steve
Attachments
Menu_Test.zip
Added Pt_CB_ARM callbacks
(42.01 KiB) Downloaded 144 times
slougheed
Active Member
 
Posts: 11
Joined: Tue Nov 22, 2005 9:36 pm

Re: Menu Utility

Postby wednesday » Tue Feb 14, 2012 5:31 am

Thanks..
Its working as expected.
Do you have any idea about my second query i.e. regarding PtFileSelection ?
wednesday
Active Member
 
Posts: 48
Joined: Tue Apr 28, 2009 7:10 am

Re: Menu Utility

Postby slougheed » Tue Feb 14, 2012 2:32 pm

I believe you'll need to add a callback on Pt_CB_FS_SELECTION where you'll set the 'Name' field to the currently selected item. I don't know of an automatic way of making this happen, but I haven't played around with the PtFileSel widget either.
steve
slougheed
Active Member
 
Posts: 11
Joined: Tue Nov 22, 2005 9:36 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron