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
Jack wrote:What is this ACTION on a GET ?
I use VALID but never ACTION .
When is it execute ?
Thanks
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 ),) }
oGet:bLostFocus = { || oGet:Cargo := nil, oDlg:End() }
oGet:oWnd:bGotFocus = { || oGet:Cargo := nil, oDlg:End() }
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_DELETE, ( oGet:VarPut(0), oGet:Refresh(), oDlg:End()),),;
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
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 ),) }
oGet:bLostFocus = { || oGet:Cargo := nil, oDlg:End() }
oGet:oWnd:bGotFocus = { || oGet:Cargo := nil, oDlg:End() }
oGet:oWnd:bMMoved = { || oGet:Cargo := nil, oDlg:End() }
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_DELETE, ( oGet:VarPut(0), oGet:Refresh(), oDlg:End()),),;
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
oGet:oWnd:bMMoved := { || oGet:Cargo := nil, oDlg:End() }
#include "fivewin.ch"
function main()
local oWnd, oCbx
local cVar := "Hola"
local aItems := {"Hola","cara","de","bola"}
DEFINE WINDOW oWnd
@ 10, 10 COMBOBOX oCbx VAR cVar ITEMS aItems SIZE 200, 300 PIXEL OF oWnd
ACTIVATE WINDOW oWnd ON INIT SetCbxHScroll( oCbx )
return nil
FUNCTION SetCbxHScroll( oCbx )
SumarEstilo( HWndComboList( oCbx:hWnd ), WS_HSCROLL )
return 0
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
#include "commctrl.h"
HB_FUNC( SUMARESTILO )
{
HWND hWnd = (HWND) hb_parnl( 1 );
DWORD dwStyle = GetWindowLong( hWnd, GWL_STYLE );
dwStyle |= ((DWORD)hb_parnl(2));
SetWindowLong( hWnd, GWL_STYLE, dwStyle );
}
BOOL SGetComboBoxInfo( HWND hWnd, PCOMBOBOXINFO pcbi )
{
typedef BOOL (CALLBACK* LPFNDLLFUNC)( HWND, PCOMBOBOXINFO );
HINSTANCE hLib;
LPFNDLLFUNC GetComboBoxInfo;
BOOL bRet = FALSE;
hLib = LoadLibrary( "User32.dll" );
if( hLib )
{
GetComboBoxInfo = ((LPFNDLLFUNC) GetProcAddress( hLib, "GetComboBoxInfo" ));
bRet = (BOOL) GetComboBoxInfo( hWnd, pcbi );
FreeLibrary( hLib );
}
return bRet;
}
// Obtener el HWND de la lista desplegable del combobox
HB_FUNC( HWNDCOMBOLIST )
{
COMBOBOXINFO cbi ;
ZeroMemory( &cbi, sizeof( COMBOBOXINFO ) );
cbi.cbSize = sizeof(COMBOBOXINFO);
SGetComboBoxInfo( (HWND) hb_parnl( 1 ), &cbi );
hb_retnl( (LONG)cbi.hwndList ) ;
}
#pragma ENDDUMP
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 117 guests