Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Thu Dec 01, 2011 6:36 pm
Siguiendo en la línea de los recientes cambios en el Método GoNextCtrl() de la Clase TWindow, hemos implementado un nuevo método GoPrevCtrl() asi como una optimización para GoNextCtrl().
Agradecemos vuestras pruebas y comentarios
Gracias!
Agradecemos vuestras pruebas y comentarios
Gracias!
Code: Select all
METHOD GoNextCtrl( hCtrl ) CLASS TWindow
local hCtlNext := NextDlgTab( ::hWnd, hCtrl )
if ::oWnd:ClassName() $ "TFOLDER,TFOLDEREX,TPAGES"
if hCtrl == NextDlgTab( ::hWnd, GetWindow( ::hWnd, GW_CHILD ), .T. ) // last ctrl ?
hCtlNext = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd )
endif
endif
::hCtlFocus = hCtrl
SetFocus( hCtlNext )
return nil
//----------------------------------------------------------------------------//
METHOD GoPrevCtrl( hCtrl ) CLASS TWindow
local hCtlPrev := NextDlgTab( ::hWnd, hCtrl, .T. )
local oCtl, oDlg
if ::oWnd:ClassName() $ "TFOLDER,TFOLDEREX,TPAGES"
if hCtrl == NextDlgTab( ::hWnd, NextDlgTab( ::hWnd,;
GetWindow( ::hWnd, GW_CHILD ), .T. ) ) // first ctrl ?
hCtlPrev = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd, .T. )
endif
endif
::hCtlFocus = hCtrl
if GetClassName( hCtlPrev ) $ "SysTabControl32,TFOLDEREX,TPAGES"
oCtl = oWndFromHwnd( hCtlPrev )
oDlg = oCtl:aDialogs[ oCtl:nOption ]
hCtlPrev = NextDlgTab( oDlg:hWnd, GetWindow( oDlg:hWnd, GW_CHILD ), .T. )
endif
SetFocus( hCtlPrev )
return nil