FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Thu Dec 01, 2011 06: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!

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

Antonio Linares
www.fivetechsoft.com
Posts: 140
Joined: Tue Oct 11, 2005 02:36 AM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Fri Dec 02, 2011 02:23 AM
Ola amigos

Antonio estou tendo problemas com a TFOLDEREX quando em uma DIALOG tenho no inicio varios GETs e logo abaixo uma TFOLDEREX... quando vou teclando ENTER a mesma nao passa para a TFOLDEREX

Estou usando .RES

mais creio que com o EXEMPLO ABAIXO voce tera o resultado esperado

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

       local oDlg, oGet, cTest := "Hello world", cAnother := "Another GET"
       local oGet1, cTest1 := "Hello world 1", cAnother1 := "Another GET 1"

       SetGetColorFocus( nRGB( 235, 235, 145 ) )

       DEFINE DIALOG oDlg SIZE 400, 300

       @ 1, 1 GET oGet1 VAR cTest1 OF oDlg
       
       @ 2, 1 GET cAnother1 OF oDlg

       @ 53, 5 FOLDEREX oFld PIXEL ;
          PROMPT "&One", "&Two", "&Three" ;
          SIZE 190, 60
         
       @ 1, 1 GET oGet VAR cTest OF oFld:aDialogs[ 1 ]
       
       @ 2, 1 GET cAnother OF oFld:aDialogs[ 1 ]  
       
       @ 7.2, 14 BUTTON "Ok"    
             
       ACTIVATE DIALOG oDlg CENTERED ;
          ON INIT ( oGet1:SetFocus(), .F. )

    return nil


Fico no aguardo
Jackson Douglas C. Brito

Boa Vista - RR - Brasil

FWH 12.09 Last Build

xHarbour Free

UESTUDIO

SQLRDD
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Fri Dec 02, 2011 10:41 AM

Jackson,

Si, aún existen algunos problemas de tabulación con TFolderEx. Estamos trabajando para resolverlos.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Sat Dec 03, 2011 08:26 PM
Antonio,

En los valid de los get's tengo comprobaciones de que lo escrito sea correcto.
Estas validaciones usan "msgrun".

Con estas mejoras de GoNextCtrl() y GoPrevCtrl() se produce el siguiente error:

Code (fw): Select all Collapse
  Error BASE/1.132  Error de límites: acceso al array

   Argumentos   :
     [   1] = A   { ... }
     [   2] = N   1

Llamadas al Stack
________________________________________________________________________________
1 Called TDIALOG:LASTACTIVECTRL(3382)
          2 Called TDIALOG:GONEXTCTRL(2741)
          3 Called TDIALOG:COMMAND(375)
          4 Called TWINDOW:HANDLEEVENT(0)
          5 Called TDIALOG:HANDLEEVENT(884)
          6 Called DIALOGBOXINDIRECT(0)
          7 Called TDIALOG:ACTIVATE(265)
          8 Called MSGRUN(42)


Dicho error es produccido al pulsar el intro varias veces de forma rapida.
Osea, me posiciono en el primer get y pulso intro varias veces para ir avanzando entre los get's.

Si esta pulsaciones se realizan de forma lenta funciona correctamente.

Anteriormente no me pasaba.
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Sun Dec 04, 2011 12:04 PM

Ya no llamamos al método LastActiveCtrl() :-)

Ahora las comprobaciones se hacen mucho más rápidas y con un código mucho más limpio :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Sun Dec 04, 2011 12:21 PM

Antonio,

Si es que creía que el error se producía con los nuevos métodos GoNextCtrl y GoPrevCtrl.

Es error mio, por ni siquiera comprobar que lastActiveCtrl era llamado en GoNextCtrl.

Copiando el código nuevo para las métodos GoNextCtrl y GoPrevCtrl funciona correctamente.

Perdón por las molestias.

Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()
Posted: Tue Dec 06, 2011 07:48 PM

Lo importante es que funcione bien :-)

gracias!

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion