Popup menu, re-selecting required menu item

Popup menu, re-selecting required menu item

Postby peterk » Tue Jul 07, 2009 6:57 am

Hi Antonio

Pop up menus by default open with no menu item selected. I wish to specify the item that must be pre-selected when the menu opens.
If I use oMenu:HiLite(1) to highlight the first menu item when the pop menu opens, it does highlight the 1st item correctly.
However - if I then use the kepboard to move to a different item e.g. item 2, I have to press the down key TWICE to move to it instead of once as expected
i.e. using HiLite works but does not seem to set some oMenu internal variable correctly, so keyboard handling thereafter is wrong

I am calling ::HiLite as follows via the 1st item bWhen as there are no event blocks in the activate method

MENU oMenu POPUP
MENUITEM "&Increment previous reference" ACTION nChoice := 1
MENUITEM "&Copy previous reference" ACTION nChoice := 2
SEPARATOR
MENUITEM "C&ancel" ACTION nChoice := 0
EndMENU

nChoice := 1
oMenu:aItems[ 1 ]:bWhen := { || oMenu:oWnd := poGet, oMenu:Hilite( 1 ), oMenu:aItems[ 1 ]:bWhen := nil, .t. }
ACTIVATE POPUP oMenu WINDOW poGet

Your assistance would be appreciated
Thanks, Peter
Peter
peterk
 
Posts: 47
Joined: Thu Jul 13, 2006 2:39 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], karinha, nageswaragunupudi and 60 guests