FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour focus on folderex navigating between gets
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
focus on folderex navigating between gets
Posted: Tue Oct 08, 2024 11:15 PM
private picture hosting

I want next focus on page2 of folderex

try this:
Code (fw): Select all Collapse
   xGet:LostFocus( { || xTab:aDialogs[ nPageNext ]:SetFocus(), xGetNext:SetFocus() } )
What is wrong ?

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: focus on folderex navigating between gets
Posted: Wed Oct 09, 2024 05:07 AM
Dear Jose,

xGet:bLostFocus := { || xTab:SetOption( nPageNext ), xGetNext:SetFocus() }

working example code:
Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: focus on folderex navigating between gets
Posted: Wed Oct 09, 2024 02:46 PM
Code (fw): Select all Collapse
#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
And first losfocus do not works anymore.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 04:09 AM
Please do it this way:
Code (fw): Select all Collapse
   
   @ 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. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 03:32 PM

Veja também, o comando OJUMP para "navegar" entre os GETS dos FOLDERS.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 04:21 PM
Gui libraries are crazy.

On dialog creation I create an array with list of gets by page
Code (fw): Select all Collapse
      IF ::lWithTab .AND. ! aItem[ CFG_ISKEY ]
         AAdd( Atail( aList ), aItem[ CFG_FCONTROL ] )
      ENDIF
And at the end of creation, I setup bLostfocus using the array.
Code (fw): Select all Collapse
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
Now it is working creating bCode first.
Do not test the same on post sample.

Problem now is GET MEMO - TMULTIGET.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 04:38 PM






It is ok for GET, but fail for GET MEMO

if memo is on page 2, fail on page 2.
if memo is on page 3, fail on page 3.
there exists an extra fake get, seems that problem is not about last get, but about MEMO-TMULTIGET.

note: focus color do not works on MEMO.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 05:22 PM

José,

> note: focus color do not works on MEMO.

TMultiGet():SetColorFocus( nRGB( 255, 255, 0 ) )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 05:25 PM
Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: focus on folderex navigating between gets
Posted: Thu Oct 10, 2024 09:59 PM
SOLVED. MY ERROR., ESCUSE ME.
Code (fw): Select all Collapse
   FOR nTab = 1 TO Len( aList ) - 1
on my application, this works for all now
Code (fw): Select all Collapse
   LOCAL bCode

   bCode := { || ;
      gui_MsgDebug( "lostfocus" ), ;
      xTab:SetOption( nPageNext ), ;
      xTextboxNext:SetFocus() }
   xTextbox:bLostFocus := bCode
I have this too:
Code (fw): Select all Collapse
   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

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Continue the discussion