FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Asignar teclas a un get ( Solucionado )
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Asignar teclas a un get ( Solucionado )
Posted: Sun Feb 12, 2017 09:38 PM

Colegas, necesito asignarle ciertas teclas a un control get pero al hacerlo se deshabilitan las teclas por defecto ( las flechas, retroceso, etc. ). Alguna pista para que esto no suceda ? Muchisimas gracias

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 12:15 PM

Muestra como est谩s haciendo via c贸digo. Saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 02:02 PM
Gracias por responder, aqu铆 el c贸digo

Code (fw): Select all Collapse
oGet[ 4 ] : bKeyDown  := { | nKey | ::KeyGet4( nKey, oDlg ) }


Saludos
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 02:39 PM
Que hace ?

Code (fw): Select all Collapse
   Function KeyGet4  ?? ahi algo en ella que causa este efecto 贸 no?
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 03:10 PM
No creo, esto funciona en FWH 14.12 no as铆 en FWH 17.01. Posteo el c贸digo

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
Method KeyGet4( nKey, oDlg ) Class TCobro 
//----------------------------------------------------------------------------//

聽 聽 Switch nKey
聽 聽 聽 聽 Case VK_RETURN
聽 聽 聽 聽 聽 聽 If( Round( ::nTCobrarBk, 2 ) == Round( ::nContado, 2 ) )
聽 聽 聽 聽 聽 聽 聽 聽 ::RealizaPago()
聽 聽 聽 聽 聽 聽 Else
聽 聽 聽 聽 聽 聽 聽 聽 ::MenuContado( oDlg )
聽 聽 聽 聽 聽 聽 End
聽 聽 聽 聽 聽 聽 Exit
聽 聽 聽 聽 Case VK_F9
聽 聽 聽 聽 聽 聽 AEval( ::aFacturas, { | x | x[ 1 ] := .f. } )
聽 聽 聽 聽 聽 聽 ::oBrw1 : Refresh()
聽 聽 聽 聽 聽 聽 ::nContado := 0
聽 聽 聽 聽 聽 聽 ::nTotal 聽 := 0
聽 聽 聽 聽 聽 聽 oGet[ 4 ] : Refresh()
聽 聽 聽 聽 聽 聽 oGet[ 4 ] : Disable()
聽 聽 聽 聽 聽 聽 ::oBrw1 : Enable()
聽 聽 聽 聽 聽 聽 ::oBrw1 : GoTop()
聽 聽 聽 聽 聽 聽 ::oBrw1 : aCols[ 5 ] : cFooter := Transform( ::nTotal, '@E 99,999,999.99' )
聽 聽 聽 聽 聽 聽 ::oBrw1 : SetFocus()
聽 聽 聽 聽 聽 聽 Exit
聽 聽 EndSwitch聽 聽聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 Return 0


Saludos
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 06:35 PM
Intentas asi:


Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
Method KeyGet4( nKey, oDlg ) Class TCobro 
//----------------------------------------------------------------------------//

    Switch nKey
        Case VK_RETURN
            If( Round( ::nTCobrarBk, 2 ) == Round( ::nContado, 2 ) )
                ::RealizaPago()
            Else
                ::MenuContado( oDlg )
            End
            Exit
        Case VK_F9
            AEval( ::aFacturas, { | x | x[ 1 ] := .f. } )
            ::oBrw1 : Refresh()
            ::nContado := 0
            ::nTotal   := 0
            oGet[ 4 ] : Refresh()
            oGet[ 4 ] : Disable()
            ::oBrw1 : Enable()
            ::oBrw1 : GoTop()
            ::oBrw1 : aCols[ 5 ] : cFooter := Transform( ::nTotal, '@E 99,999,999.99' )
            ::oBrw1 : SetFocus()
            Exit
    EndSwitch

Return( nKey )

//    Return 0
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Asignar teclas a un get
Posted: Mon Feb 13, 2017 07:57 PM

Gracias Karinha, funcion贸 perfectamente.

Saludos

Continue the discussion