FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Consulta sobre GET
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Consulta sobre GET
Posted: Wed Oct 27, 2010 04:41 PM
Amigos del foro :

Si alguien pudiera ayudarme

Esto es un fragmento de mi c贸digo :

Code (fw): Select all Collapse
REDEFINE GET oGet1 VAR cCodIni ID 101 OF oDlg update ;
聽 聽 聽 聽 PICTURE "@!" ;
聽 聽 聽 聽 ON CHANGE Self:Assign() ;
聽 聽 聽 聽 VALID OkCodIni( cCodIni )
聽 聽 聽 聽 oGet1:bGotFocus := {||SetKey( VK_F2, { || VerCodIni( oGet1, @cCodIni, oDlg ) })}
聽 聽 聽 聽 oGet1:bGotFocus := { | oSelf | oSelf:SelectAll()} 
聽 聽 聽 聽 oGet1:bLostFocus := {||SetKey( VK_F2, nil )}


La intenci贸n es que al mismo tiempo que yo asigno la tecla F2 a VerCodIni, tambien me aparezca seleccionado el Get.

Hay alguna forma de que con una sola instrucci贸n oGet1:bGotFocus() pueda hacer las dos cosas ?

De antemano muchas gracias

Saludos
Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta sobre GET
Posted: Wed Oct 27, 2010 06:50 PM
Hola

Puedes usarlo asi.

Code (fw): Select all Collapse
bSetKey := SetKey( VK_F2, { |x,y,z| iif( z:classname = "TGET" .and. Z:nId = 101, VerCodIni(..), nil ) } )

REDEFINE GET oGet1 VAR cCodIni ID 101 OF oDlg update ;
聽 聽 聽 聽 PICTURE "@!" ;
聽 聽 聽 聽 ON CHANGE Self:Assign() ;
聽 聽 聽 聽 VALID OkCodIni( cCodIni )

oGet1:bGotFocus := { | oSelf | oSelf:SelectAll()}

ACTIVATE DIALOG oDlg

SetKey( VK_F2, bSetKey )
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta sobre GET
Posted: Thu Oct 28, 2010 03:56 AM
Patricio

Gracias por tus atenciones :

Prob茅 tu codigo y funcion贸 perfecto, pero lo que yo no coment茅 es que quiero hacerlo para tres Gets y asignar la tecla F2 para los tres

Es posible hacerlo ?

Aqui est谩 mi c贸digo :



Code (fw): Select all Collapse
STATIC FUNCTION PoneFil( oLbx )
聽 聽 LOCAL oDlg, oBAce, bSetKey1, bSetkey2, bSetKey3
聽 聽 LOCAL oGet1, oGet2, oGet3
聽 聽 LOCAL cCodIni, cCodFin, cFamil
聽 聽 
聽 聽 cat->(DBGOTOP())
聽 聽 cCodIni := cat->modelo
聽 聽 cat->(DBGOBOTTOM())
聽 聽 cCodFin := cat->modelo
聽 聽 cat->(DBGOTOP())
聽 聽 cFamil := "?????"
聽 聽 
聽 聽 bSetKey1 := SetKey( VK_F2, { |x,y,z| iif( z:classname = "TGET" .and. ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Z:nId = 101, VerCodIni( oGet1, @cCodIni, oDlg ), nil ) } )
聽 聽 bSetKey2 := SetKey( VK_F2, { |x,y,z| iif( z:classname = "TGET" .and. ;
聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Z:nId = 103, VerCodFin( oGet2, @cCodFin, oDlg ), nil ) } )
聽 聽 bSetKey3 := SetKey( VK_F2, { |x,y,z| iif( z:classname = "TGET" .and. ;
聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Z:nId = 105, VerFamil( oGet3, @cFamil, oDlg ), nil ) } )
聽 聽 聽聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 DEFINE DIALOG oDlg RESOURCE "CamPre"
聽 聽 聽 oDlg:lHelpIcon := .F.
聽 聽 
聽 聽 REDEFINE GET oGet1 VAR cCodIni ID 101 OF oDlg update ;
聽 聽 聽 聽 PICTURE "@!" ;
聽 聽 聽 聽 ON CHANGE Self:Assign() ;
聽 聽 聽 聽 VALID OkCodIni( cCodIni )
聽 聽 聽 聽 oGet1:bGotFocus := { | oSelf | oSelf:SelectAll()}
聽 聽 聽 聽 
聽 聽 REDEFINE GET oGet2 VAR cCodFin ID 103 OF oDlg update ;
聽 聽 聽 聽 PICTURE "@!" ;
聽 聽 聽 聽 ON CHANGE Self:Assign() ;
聽 聽 聽 聽 VALID OkCodFin( cCodFin )
聽 聽 聽 聽 oGet2:bGotFocus := { | oSelf | oSelf:SelectAll()}
聽 聽 聽 聽 
聽 聽 REDEFINE GET oGet3 VAR cFamil 聽ID 105 OF oDlg update ;
聽 聽 聽 聽 PICTURE "@!" ;
聽 聽 聽 聽 ON CHANGE Self:Assign()
聽 聽 聽 聽 
聽 聽 REDEFINE BUTTON oBAce ID 107 OF oDlg ;
聽 聽 聽 聽 ACTION Filtro( cCodIni, cCodFin, cFamil ), oDlg:End()
聽 聽 
聽 聽 ACTIVATE DIALOG oDlg CENTERED
聽 聽 聽 聽 SetKey( VK_F2, bSetKey1 )
聽 聽 聽 聽 SetKey( VK_F2, bSetKey2 )
聽 聽 聽 聽 SetKey( VK_F2, bSetKey3 )
聽 聽 聽 oLbx:refresh()
聽 聽 聽 oLbx:SetFocus()
聽 聽 
RETURN NIL



Saludos
Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta sobre GET
Posted: Thu Oct 28, 2010 12:37 PM
Hola


Si es posible, debes hacerlo en un solo Setkey, ya que si asignas en otro eliminas el anterior

Code (fw): Select all Collapse
bSetKey := SetKey( VK_F2, { |x,y,z| iif( z:classname = "TGET" .and. Z:nId = 101, VerCodIni(..), nil ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 iif( z:classname = "TGET" .and. Z:nId = 103, VerCodIni(..), nil ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 iif( z:classname = "TGET" .and. Z:nId = 105, VerCodIni(..), nil ) } )
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 196
Joined: Fri May 15, 2009 01:25 AM
Re: Consulta sobre GET
Posted: Fri Oct 29, 2010 01:10 AM

Patricio

Muchas gracias por tu ayuda te estoy muy agradecido, funcion贸 tal como yo deseaba

S贸lo una cosa mas :

La linea SetKey( VK_F2, bSetkey) que va despues del ACTIVATE DIALOG cu谩l es su funci贸n porque si no la incluyo tambien funciona mi c贸digo

ACTIVATE DIALOG oDlg CENTERED
//SetKey( VK_F2, bSetKey )
oLbx:refresh()
oLbx:SetFocus()

Saludos

Juan Arroyo
M茅xico
FWH 7.12 VERCE 5.3 xHarbour 1.1.0
juan_arroyo_t@hotmail.com
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta sobre GET
Posted: Fri Oct 29, 2010 12:22 PM
Hola

que bien que te haya resultado, debes cerrar tu post (SOLUCIONADO )

Code (fw): Select all Collapse
SetKey()
Associates a code block with a key. 

SetKey( <nInkeyCode> 聽 聽, ;
聽 聽 聽 聽[<bNewCodeblock>], ;
聽 聽 聽 聽[<bCondition>] 聽 聽 ) --> bOldCodeblock


Como vez retorna la ultima tecla asociada

estar谩 activo mientras no asignes un nuevo codeblock a la tecla

si ya no quieres asignar mas la tecla F2, solo le asignas NIL

Code (fw): Select all Collapse
Setkey( VK_F2, NIL )
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl

Continue the discussion