FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Activate first item on popup menu
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Activate first item on popup menu
Posted: Wed Jun 13, 2007 08: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Activate first item on popup menu
Posted: Wed Jun 13, 2007 08:59 AM
Alex,

In samples\TestPop.prg please insert this line:
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
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Highlighting
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Activate first item on popup menu
Posted: Tue Jun 19, 2007 05: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

Continue the discussion