Page 1 of 1

Say/Get detiene brincos del tabulador (Corregido)

PostPosted: Thu Mar 24, 2011 4:48 am
by RodolfoRBG
Estimados amigos,

Intento manejar una ventana desde codigo con el siguiente codigo:
Code: Select all  Expand view

 DEFINE WINDOW oWnd MDICHILD OF M->oWndPrin TITLE "Calendario" FROM 0, 0 TO 300,CooWP[4] PIXEL HELPID "Calendario"
  @ 180,005 GET oFInic VAR Finic OF oWnd SIZE 80,20 PIXEL UPDATE
  @ 180,095 COMBOBOX Operac ITEMS MasMen OF oWnd SIZE 40,50 PIXEL UPDATE
  @ 180,145 GET oNDias VAR NDias OF oWnd SIZE 30,20 PIXEL PICTURE "###" UPDATE //<-En este GET se detiene
  @ 180,185 SAY "Dias = " OF oWnd PIXEL //<-Esta instruccion hace que se detenga
  @ 180,245 GET oFFinal VAR FFinal OF oWnd SIZE 80,20 PIXEL UPDATE //<-Con el tabulador, no llega hasta este GET
 ACTIVATE WINDOW oWnd
 


pero si uso el tabulador se detiene en el GET oNDias, solo si quito el SAY se puede brincar al ultimo GET (oFFinal)

Intente "engañar" a la ventana usando en lugar de SAY un GET guardando en la variable SayDias:="Dias = " y condicionandolo asi:
Code: Select all  Expand view

  @ 180,185 GET SayDias OF oWnd SIZE 30,20 PIXEL WHEN .F.
 


pero se sigue deteniendo en el GET anterior. Solo quitando el GET condicionado o el SAY logro que se pase al ultimo get. Como lo puedo solucionar?

Se les agradece de antemano sugerencias.

Re: Say/Get detiene brincos del tabulador

PostPosted: Thu Mar 24, 2011 7:45 am
by FiveWiDi
RodolfoRBG wrote:Estimados amigos,

Intento manejar una ventana desde codigo con el siguiente codigo:
Code: Select all  Expand view

 DEFINE WINDOW oWnd MDICHILD OF M->oWndPrin TITLE "Calendario" FROM 0, 0 TO 300,CooWP[4] PIXEL HELPID "Calendario"
  @ 180,005 GET oFInic VAR Finic OF oWnd SIZE 80,20 PIXEL UPDATE
  @ 180,095 COMBOBOX Operac ITEMS MasMen OF oWnd SIZE 40,50 PIXEL UPDATE
  @ 180,145 GET oNDias VAR NDias OF oWnd SIZE 30,20 PIXEL PICTURE "###" UPDATE //<-En este GET se detiene
  @ 180,185 SAY "Dias = " OF oWnd PIXEL //<-Esta instruccion hace que se detenga
  @ 180,245 GET oFFinal VAR FFinal OF oWnd SIZE 80,20 PIXEL UPDATE //<-Con el tabulador, no llega hasta este GET
 ACTIVATE WINDOW oWnd
 


pero si uso el tabulador se detiene en el GET oNDias, solo si quito el SAY se puede brincar al ultimo GET (oFFinal)

Intente "engañar" a la ventana usando en lugar de SAY un GET guardando en la variable SayDias:="Dias = " y condicionandolo asi:
Code: Select all  Expand view

  @ 180,185 GET SayDias OF oWnd SIZE 30,20 PIXEL WHEN .F.
 


pero se sigue deteniendo en el GET anterior. Solo quitando el GET condicionado o el SAY logro que se pase al ultimo get. Como lo puedo solucionar?

Se les agradece de antemano sugerencias.


Hola,

Yo tuve (aún tengo) algún problema similar a lo que explicas; prueba substituir el método GoNextCtrl en Window.prg por el siguiente código:
Code: Select all  Expand view
METHOD GoNextCtrl( hCtrl ) CLASS TWindow

   local hCtlNext, nAt

   //if Upper( ::ClassName() ) != "TDIALOG"

    if Upper( ::ClassName() ) != "TDIALOG" .and. ;
       Upper( ::ClassName() ) != "TMDICHILD" .and. ;
       Upper( ::ClassName() ) != "TGROUP"    // C.Gelabert 13/03/2008


      nAt = AScan( ::aControls, { | o | o:hWnd == hCtrl } )
      if nAt != 0
         if nAt < Len( ::aControls )
            hCtlNext = ::aControls[ nAt + 1 ]:hWnd
         else
            hCtlNext = ::aControls[ 1 ]:hWnd
         endif
//         if lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), WS_TABSTOP )  // 2010-09-19
         if lAnd( GetWindowLong( hCtlNext, GWL_STYLE ), WS_TABSTOP )
            SetFocus( hCtlNext )
         endif
         return nil
      endif
   endif

   hCtlNext := NextDlgTab( ::hWnd, hCtrl )
   ::hCtlFocus = hCtlNext

   if ! Empty( ::aControls ) .and. hCtrl == ::LastActiveCtrl():hWnd //ATail( ::aControls ):hWnd
      if ! Empty( ::oWnd ) .and. ;
         ( ( Upper( ::oWnd:ClassName() ) $ "TFOLDER;TPAGES;TFOLDEREX" ) )
         hCtlNext = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd )
         ::hCtlFocus = hCtrl
      endif
   endif

   if hCtlNext == hCtrl .and. Upper( GetClassName( hCtrl ) ) == "EDIT"
      hCtlNext = NextDlgTab( GetParent( ::hWnd ), hCtrl )
   endif

   if hCtlNext != hCtrl
      SetFocus( hCtlNext )
   endif

return nil

//----------------------------------------------------------------------------//


Si te funciona, te pasaré el código del método GoPrevCtrl, que tiene el mismo problema.

A ver si tienes suerte.

Re: Say/Get detiene brincos del tabulador

PostPosted: Thu Mar 24, 2011 5:14 pm
by RodolfoRBG
Don Carlos, funciono perfecto!!! Muchas horas perdidas por este detallito.

Afecta en algo esta modificacion o hay alguna razon por la que no se ha corregido esto?

Te agradecere publiques la otra parte, lo relacionado con GoPrevCtrl()

Re: Say/Get detiene brincos del tabulador

PostPosted: Fri Mar 25, 2011 11:17 am
by FiveWiDi
RodolfoRBG wrote:Don Carlos, funciono perfecto!!! Muchas horas perdidas por este detallito.

Afecta en algo esta modificacion o hay alguna razon por la que no se ha corregido esto?

Te agradecere publiques la otra parte, lo relacionado con GoPrevCtrl()


Me alegro, aquí va:
Code: Select all  Expand view
//----------------------------------------------------------------------------//

METHOD GoPrevCtrl( hCtrl ) CLASS TWindow

   local hCtlPrev := NextDlgTab( ::hWnd, hCtrl, .t. )
   local n, cFoldName, nAt

   //if Upper( ::ClassName() ) != "TDIALOG"

   if Upper( ::ClassName() ) != "TDIALOG" .and. ;
     Upper( ::ClassName() ) != "TMDICHILD" .and. ;
     Upper( ::ClassName() ) != "TGROUP"    // C.Gelabert 13/03/2008

      nAt = AScan( ::aControls, { | o | o:hWnd == hCtrl } )
      if nAt != 0
         if nAt > 1
            hCtlPrev = ::aControls[ nAt - 1 ]:hWnd
         else
            hCtlPrev = ATail( ::aControls ):hWnd
         endif
         if lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), WS_TABSTOP )
            SetFocus( hCtlPrev )
         endif
         return nil
      endif
   endif

   #ifdef __CLIPPER__
      cFoldName = "TFOLDER"
   #else
      cFoldName = "SYSTABCONTROL32"
   #endif

   ::hCtlFocus = hCtlPrev

   if ! Empty( ::aControls ) .and. hCtrl == ::FirstActiveCtrl():hWnd //::aControls[ 1 ]:hWnd
      if ! Empty( ::oWnd ) .and. ;
         ( ( Upper( ::oWnd:ClassName() ) $ "TFOLDER;TPAGES;TFOLDEREX" ) )
         hCtlPrev = NextDlgTab( ::oWnd:oWnd:hWnd, ::oWnd:hWnd, .t. )
         ::hCtlFocus = hCtrl
      endif
   endif

   If hCtlPrev != hCtrl
      If Upper( GetClassName( hCtlPrev ) ) == cFoldName .or. ;
         Upper( GetClassName( hCtlPrev ) ) == "TPAGES"
         n = AScan( ::aControls, { | o | o:hWnd == hCtlPrev } )
         if n > 0
            ::aControls[ n ]:aDialogs[ ::aControls[ n ]:nOption ]:LastActiveCtrl():SetFocus()
         endif
      else
         SetFocus( hCtlPrev )
      endif
   endif

return nil

//----------------------------------------------------------------------------//
 


Espero que Antonio nos lea; de hecho afecta sobre todo a las pantallas MDICHILD y no se si somos muchos los que las utilizamos.

Re: Say/Get detiene brincos del tabulador

PostPosted: Fri Mar 25, 2011 11:39 am
by horacio
Esto me viene de perillas, siempre tuve que hacer malabares para usar la tecla de tabulación en ventanas MDICHILD. Muchisimas gracias por este Post.
Salu2

Re: Say/Get detiene brincos del tabulador

PostPosted: Fri Mar 25, 2011 12:07 pm
by FiveWiDi
horacio wrote:Esto me viene de perillas, siempre tuve que hacer malabares para usar la tecla de tabulación en ventanas MDICHILD. Muchisimas gracias por este Post.
Salu2


Rodolfo y Horacio,

Enviarle un post a Antonio, que ahora ya somos al menos 3 los afectados

Yo ya lo hice hace tiempo, pero supongo que tenía otros asuntos de más impacto encima de la mesa.

Gracias.

Re: Say/Get detiene brincos del tabulador

PostPosted: Fri Mar 25, 2011 6:26 pm
by RodolfoRBG
En efecto, sobretodo porque YA ESTA CORREGIDO!!! solo debe incorporarlo en las nuevas versiones para no tener que modificarlo en cada actualizacion.