focus on folderex navigating between gets

focus on folderex navigating between gets

Postby JoséQuintas » Tue Oct 08, 2024 11:15 pm

Imageprivate picture hosting

I want next focus on page2 of folderex

try this:
Code: Select all  Expand view  RUN

   xGet:LostFocus( { || xTab:aDialogs[ nPageNext ]:SetFocus(), xGetNext:SetFocus() } )
 


What is wrong ?
JoséQuintas
 
Posts: 33
Joined: Tue Feb 09, 2021 4:20 pm

Re: focus on folderex navigating between gets

Postby Antonio Linares » Wed Oct 09, 2024 5:07 am

Dear Jose,

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

working example code:
Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: focus on folderex navigating between gets

Postby JoséQuintas » Wed Oct 09, 2024 2:46 pm

Code: Select all  Expand view  RUN

#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éQuintas
 
Posts: 33
Joined: Tue Feb 09, 2021 4:20 pm

Re: focus on folderex navigating between gets

Postby Antonio Linares » Thu Oct 10, 2024 4:09 am

Please do it this way:

Code: Select all  Expand view  RUN
 
   @ 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: focus on folderex navigating between gets

Postby karinha » Thu Oct 10, 2024 3: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
User avatar
karinha
 
Posts: 7828
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: focus on folderex navigating between gets

Postby JoséQuintas » Thu Oct 10, 2024 4:21 pm

Gui libraries are crazy.

On dialog creation I create an array with list of gets by page

Code: Select all  Expand view  RUN

      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: Select all  Expand view  RUN

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éQuintas
 
Posts: 33
Joined: Tue Feb 09, 2021 4:20 pm

Re: focus on folderex navigating between gets

Postby JoséQuintas » Thu Oct 10, 2024 4:38 pm

Image

Image

Image

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éQuintas
 
Posts: 33
Joined: Tue Feb 09, 2021 4:20 pm

Re: focus on folderex navigating between gets

Postby Antonio Linares » Thu Oct 10, 2024 5:22 pm

José,

> note: focus color do not works on MEMO.

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: focus on folderex navigating between gets

Postby Antonio Linares » Thu Oct 10, 2024 5:25 pm

Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: focus on folderex navigating between gets

Postby JoséQuintas » Thu Oct 10, 2024 9:59 pm

SOLVED. MY ERROR., ESCUSE ME.

Code: Select all  Expand view  RUN

   FOR nTab = 1 TO Len( aList ) - 1
 


on my application, this works for all now
Code: Select all  Expand view  RUN

   LOCAL bCode

   bCode := { || ;
      gui_MsgDebug( "lostfocus" ), ;
      xTab:SetOption( nPageNext ), ;
      xTextboxNext:SetFocus() }
   xTextbox:bLostFocus := bCode
 


I have this too:
Code: Select all  Expand view  RUN

   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éQuintas
 
Posts: 33
Joined: Tue Feb 09, 2021 4:20 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests