FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Haga clic en el BITMAP no obedece WHEN GET
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Haga clic en el BITMAP no obedece WHEN GET
Posted: Tue Mar 17, 2015 04:12 AM

Hola a todos.

Lo siento por la traducci贸n.

Tengo un problema serio cuando tengo dos GETS y uno necesita del otro validado con el fin de ejecutar la acci贸n, haga clic en la segunda BMP no obedece al WHEN do GET. 驴Qu茅 hacer para corregirlo?

sigue un tramo de c贸digo de prueba:

redefine Get oGet1 var cCodigo picture '99999' id 101 of oDlg_0051 valid( val_0051() ) action( Eval( bLista01 ) ) Bitmap "Lupa2" update
oGet1:lBtnTransparent := .t.
oGet1:bKeyDown := { | nKey | if( nKey = VK_F2, Eval( bLista01 ), NIL ) }
oGet1:cToolTip := 'Informe o n煤mero da Conta '
bLista01 := {|| cCodigo := ListaCC( cCodigo, oGet1 ) }

redefine Get oGet2 var cProduto picture '999' id 102 of oDlg_0051 valid( val_0051a() ) action( Eval( bLista02 ) ) Bitmap "Lupa2" update WHEN .f.
oGet2:lBtnTransparent := .t.
oGet2:bKeyDown := { | nKey | if( nKey = VK_F2, Eval( bLista02 ), NIL ) }
oGet2:cToolTip := 'Informe o n煤mero da Conta '
bLista02 := {|| cProduto := ListaProduto( cProduto, oGet2 ) }

En este caso, incluso con WHEN .F. clic desencadena la funci贸n.

qu茅 hacer para hacer clic en el BMP respetar el WHEN de GET?

gracias a todos

Alexandre Pereira
Belo Horizonte/MG - Brasil

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Tue Mar 17, 2015 07:28 AM

Alexandre,

Que versi贸n de FWH usas ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Tue Mar 17, 2015 01:58 PM

Ol谩 Antonio.

FWH 14.12.

Regards,

Alexandre Pereira

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Tue Mar 17, 2015 04:06 PM

Prueba a a帽adir esto:

oGet2:oBtn:Disable()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 03:18 AM

Gracias Antonio,

Pero hay muchos objetos y el programa es enorme, pens茅 que tal vez cambio el TGet pero estoy encontrando dificuldados porque BMP es otro objeto.

Simplemente no me hago el cambio en TGet sin comprometer el resto del sistema.

驴Tiene alg煤n otro consejo?

Gracias,

Alexandre Pereira

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 07:44 AM

Alexandre,

La soluci贸n id贸nea entonces es definir el M茅todo Disable() en la Clase TGet de esta forma:

METHOD Disable() INLINE ::Super:Disable(), ::oBtn:Disable()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 03:57 PM

Maestro,

La forma en que ha pasado dio error. Sin embargo, cambi茅 el TGet y as铆 lo hizo:

METHOD CreateButton() CLASS TGet
...
::oBtn:lCancel = .f. // Inicia FALSO para ser habilitado na GOTFOCUS (Alexandre Pereira)
...

METHOD LostFocus( hCtlFocus ) CLASS TGet
...
// Desabilitando quando sair
if ! Empty( ::oBtn )
::oBtn:lCancel := .f.
endif
...

METHOD GotFocus( hCtlLost ) CLASS TGet
...
if ! Empty( ::oBtn )
::oBtn:lCancel := .t.
endif
...

Ahora est谩 trabajando de la manera correcta, respetando las VALIDSs otro GETS.

Cuando la modificaci贸n se incorpora en los nuevos FIVES retiro la TGET.PRG de mi proyecto.

Gracias por la atenci贸n.

Alexandre Pereira

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 04:09 PM

Alexandre,

Pero la DATA lCancel no es para habilitar y deshabilitar un bot贸n. lCancel se usa para que el bot贸n se salte la validaci贸n del control en curso.

Es extra帽o que te funcione bien con eso.

Que error te di贸 el c贸digo que te suger铆 ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 04:55 PM

Antonio,

Realmente lCancel es despreciar la v谩lida, sin embargo, esto afecta cuando el bot贸n est谩 dentro del GET. As铆 que estaba aceptando el clic y la realizaci贸n de la acci贸n y haciendo caso omiso de la otra valid de la GET (que deb铆a ser validada). Como cambi贸 no falla para validar el otro "GET" y trabaja estrechamente con el GET que est谩 inmersa.

El formulario anterior el GET funcionaba perfecto, pero el CLICK sobre BITMAP ignorando V谩lidos otro GET.

En cuanto al error que dio en la declaraci贸n del m茅todo DISABLE:

...
Size: 7,224,320 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 14.12
Windows version: 6.1, Build 7600

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 18/03/2015, 13:42:37
Error description: Error BASE/1004 Class: 'NIL' has no exported method: DISABLE

Args:
[ 1] = U

Stack Calls

Called from: => DISABLE( 0 )
Called from: P:\Desenv\DeclaCRED\funcoes\tget.000 => (b)TGET:TGET( 148 )
Called from: => TGET:DISABLE( 0 )
Called from: .\source\classes\WINDOW.PRG => TDIALOG:AEVALWHEN( 2883 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 708 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 890 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 )
Called from: P:\Desenv\DeclaCRED\DeclaCRED.prg => MAIN( 88 )

Una vez m谩s, perd贸name por la traducci贸n.

Alexandre Pereira

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 07:52 PM

Alexandre,

Pru茅balo asi:

METHOD Disable() INLINE ::Super:Disable(), If( ::oBtn != nil, ::oBtn:Disable(),)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 08:11 PM

Maestro,

A煤n aceptando haga clic en el BMP.

El problema est谩 realmente en lCancel, se activa el bot贸n para recibir el clic incondicionalmente.

Como lo hizo antes est谩 la soluci贸n.

Gracias.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Wed Mar 18, 2015 08:46 PM

Alexandre,

Si te funciona bien, entonces perfecto :-)

gracias!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Thu Mar 19, 2015 12:42 PM

Alexandre,

Implementado para el pr贸ximo FWH 15.03

muchas gracias! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 11
Joined: Tue Mar 17, 2015 03:50 AM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Fri Mar 20, 2015 06:28 PM

Gracias Maestro.

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Haga clic en el BITMAP no obedece WHEN GET
Posted: Mon Mar 23, 2015 10:31 AM

Antonio,
a modify can be important to AutoGet Class
I wish insert a button on this type of Tget but it not run
then the user can use autoget fill data or press the button to lookup and select the data from file
I think this modify can be easy but I not Know How do it
is there some Gurus ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion