Richard,
Have you considered to use a GET and a XBrowse together ?
Here you have a function PopupBrowse() that behaves quite similar to a combobox, but you have all the xbrowse possibilities:
function PopupBrowse( aValue, oGet, bInit )
local oDlg, oBrw
local aPoint := { oGet:nTop + oGet:nHeight, oGet:nLeft }
if oGet:Cargo == nil
aPoint = ClientToScreen( oGet:oWnd:hWnd, aPoint )
DEFINE DIALOG oDlg OF oGet:oWnd STYLE WS_POPUP ;
SIZE 500, 180
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT oDlg:SetPos( aPoint[ 1 ], aPoint[ 2 ] )
@ 0, 0 XBROWSE oBrw ARRAY aValue AUTOSORT ;
SIZE oDlg:nWidth, oDlg:nHeight OF oDlg PIXEL
oBrw:CreateFromCode()
Eval( bInit, oBrw )
oBrw:PostMsg( WM_SETFOCUS )
oBrw:bKeyDown = { | nKey | If( nKey == VK_RETURN, oDlg:End(),) }
oBrw:bChange = { || oGet:VarPut( oBrw:aCols[ 1 ]:Value ), oGet:Refresh() }
oBrw:bLButtonUp = { | nRow, nCol | If( nRow > oBrw:nHeaderHeight,;
( Eval( oBrw:bChange ), oDlg:End(),;
oGet:oWnd:GoNextCtrl( oGet:hWnd ),;
oGet:Cargo := nil ),) }
oBrw:Seek( oGet:GetText() )
oGet:Cargo = oDlg
oGet:bKeyDown = { | nKey | If( nKey == VK_DOWN, oBrw:GoDown(),),;
If( nKey == VK_UP, oBrw:GoUp(),),;
If( nKey == VK_RETURN, oDlg:End(),), 0 }
oGet:oWnd:bLClicked = { || oDlg:End(), oGet:Cargo := nil }
oGet:oWnd:bMouseWheel = { || oDlg:SetFocus() }
else
oGet:Cargo:End()
oGet:Cargo = nil
endif
return nil
An example of use:
REDEFINE GET oGet VAR ... ;
ID ... OF oDlg ACTION PopupBrowse( aValues, oGet, bInit )