Activate first item on popup menu

Activate first item on popup menu

Postby AlexSchaft » Wed Jun 13, 2007 8:46 am

Hi,

When a popup menu is activated, the highlight is not show, and the user must first press up or down to see the highlight. Is there a way to automatically highlight the first item?

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Wed Jun 13, 2007 8:59 am

Alex,

In samples\TestPop.prg please insert this line:
Code: Select all  Expand view
function ShowPopup( nRow, nCol )

   oMenu := BuildPopup()

   // This one!
   oMenu:aItems[ 1 ]:bWhen = { || oMenu:oWnd := oWnd, oMenu:Hilite( 1 ), oMenu:aItems[ 1 ]:bWhen := nil }

   ACTIVATE POPUP oMenu WINDOW oWnd AT nRow, nCol

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Highlighting

Postby AlexSchaft » Tue Jun 19, 2007 12:11 pm

Hi,

The highlight seems to work, but the menu still "thinks" it is not highlighted, as you must press down twice to get off the first row. Is there a way around this?

Alex
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby Antonio Linares » Tue Jun 19, 2007 5:54 pm

Alex,

You could try to send a WM_KEYDOWN to the popup:

SendMessage( oPopup:hMenu, WM_KEYDOWN, VK_DOWN )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests