Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby Antonio Linares » 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!

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

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby miragerr » Fri Dec 02, 2011 2: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: Select all  Expand view


#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
User avatar
miragerr
 
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby fgondi » Sat Dec 03, 2011 8: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: Select all  Expand view
 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
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby fgondi » 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
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Métodos mejorados GoNextCtrl() y GoPrevCtrl()

Postby Antonio Linares » Tue Dec 06, 2011 7:48 pm

Lo importante es que funcione bien :-)

gracias!
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests