I want next focus on page2 of folderex
try this:
- Code: Select all Expand view
xGet:LostFocus( { || xTab:aDialogs[ nPageNext ]:SetFocus(), xGetNext:SetFocus() } )
What is wrong ?
xGet:LostFocus( { || xTab:aDialogs[ nPageNext ]:SetFocus(), xGetNext:SetFocus() } )
#include "FiveWin.ch"
function Main()
local oDlg, oFld, cTest1, cTest2, cTest3, oGet2, oGet3
cTest1 := cTest2 := cTest3 := Space( 30 )
TGet():SetColorFocus( nRGB( 255, 255, 0 ) )
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 FOLDEREX oFld OF oDlg SIZE 200, 150
@ 1, 1 GET cTest1 OF oFld:aDialogs[ 1 ]
@ 2, 1 GET oGet2 VAR cTest2 OF oFld:aDialogs[ 1 ]
oGet2:bLostFocus = { || oFld:SetOption( 2 ), oGet3:SetFocus() }
@ 1, 1 GET oGet3 VAR cTest3 OF oFld:aDialogs[ 2 ]
ACTIVATE DIALOG oDlg CENTERED
return nil
#include "FiveWin.ch"
function Main()
local oDlg, oFld, cTest1, cTest2, cTest3, oGet1, oGet2, oGet3
cTest1 := cTest2 := cTest3 := Space( 30 )
TGet():SetColorFocus( nRGB( 255, 255, 0 ) )
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 FOLDEREX oFld OF oDlg SIZE 200, 150
@ 1, 1 GET oGet1 VAR cTest1 OF oFld:aDialogs[ 1 ]
@ 2, 1 GET oGet2 VAR cTest2 OF oFld:aDialogs[ 1 ]
oGet2:bLostFocus := { || oFld:SetOption( 2 ), oGet3:SetFocus() }
@ 1, 1 GET oGet3 VAR cTest3 OF oFld:aDialogs[ 2 ]
oGet3:bLostFocus := { || oFld:SetOption( 1 ), oGet1:SetFocus() }
ACTIVATE DIALOG oDlg CENTERED
return nil
@ 2, 1 GET oGet2 VAR cTest2 OF oFld:aDialogs[ 1 ]
oGet2:bLostFocus := { || oFld:SetOption( 2 ), oGet3:SetFocus(), oGet3:bLostFocus := nil }
@ 1, 1 GET oGet3 VAR cTest3 OF oFld:aDialogs[ 2 ] ;
VALID ( oGet3:bLostFocus := { || oFld:SetOption( 1 ), oGet1:SetFocus() }, .T. )
IF ::lWithTab .AND. ! aItem[ CFG_ISKEY ]
AAdd( Atail( aList ), aItem[ CFG_FCONTROL ] )
ENDIF
STATIC FUNCTION gui_TabNavigate( xDlg, xTab, aList )
LOCAL nTab, nPageNext
IF Len( aList ) == 0
RETURN Nil
ENDIF
FOR nTab = 1 TO Len( aList ) - 1
nPageNext := iif( nTab == Len( aList ), 1, nTab + 1 )
GUI():TabSetLostFocus( aList[ nTab, Len( aList[ nTab ] ) ], xTab, nPageNext, aList[ nPageNext, 1 ] )
NEXT
//xTab:aDialogs[1]:SetFocus()
xTab:SetOption( 1 )
RETURN Nil
STATIC FUNCTION gui_TabSetLostFocus( xTextbox, xTab, nPageNext, xTextboxNext )
LOCAL bCode
bCode := { || ;
xTab:SetOption( nPageNext ), ;
/* xTab:aDialogs[nPageNext ]:SetFocus() */ ;
xTextboxNext:SetFocus() }
xTextbox:bLostFocus := bCode
RETURN Nil
#include "FiveWin.ch"
function Main()
local oDlg, oFld, cTest1, cTest2, cTest3, cTest4, oGet2, oGet3, oMGet1
cTest1 := cTest2 := cTest3 := cTest4 := Space( 30 )
TGet():SetColorFocus( nRGB( 255, 255, 0 ) )
TMultiGet():SetColorFocus( nRGB( 255, 255, 0 ) )
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 FOLDEREX oFld OF oDlg SIZE 200, 150
@ 1, 1 GET cTest1 OF oFld:aDialogs[ 1 ]
@ 2, 1 GET oGet2 VAR cTest2 OF oFld:aDialogs[ 1 ]
oGet2:bLostFocus = { || oFld:SetOption( 2 ), oGet3:SetFocus() }
@ 1, 1 GET oGet3 VAR cTest3 OF oFld:aDialogs[ 2 ]
@ 2, 1 GET oMGet1 VAR cTest4 MEMO OF oFld:aDialogs[ 2 ] SIZE 180, 50
oMGet1:bLostFocus = { || oFld:SetOption( 1 ) }
ACTIVATE DIALOG oDlg CENTERED
return nil
FOR nTab = 1 TO Len( aList ) - 1
LOCAL bCode
bCode := { || ;
gui_MsgDebug( "lostfocus" ), ;
xTab:SetOption( nPageNext ), ;
xTextboxNext:SetFocus() }
xTextbox:bLostFocus := bCode
IF GUI():LibName() $ "FIVEWIN,HWGUI"
/* dummy textbox for bugs */
AAdd( ::aControlList, EmptyFrmClassItem() )
Atail( ::aControlList )[ CFG_CTLTYPE ] := TYPE_BUG_GET
GUI():TextCreate( ::xDlg, ::xDlg, @Atail( ::aControlList )[ CFG_FCONTROL ], ;
APP_DLG_HEIGHT - 40, 20, 0, 0, " ", "", 0, { || .T. },,,Atail( ::aControlList ), Self )
ENDIF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 59 guests