Clausole When not run ok - Resolved!!!

Clausole When not run ok - Resolved!!!

Postby Silvio.Falconi » Thu Jul 04, 2019 8:51 am

I made this button on Ribbonbar because radio control is not transparent)

@ 24, 400 ADD BUTTON oSay OF ::oGrPlanning BITMAP ".\bitmaps\bradio1.bmp" MOSTLEFT SIZE 65, 18 PROMPT "Filtro" ;
ACTION ( oSelf:lFilter := ! oSelf:lFilter, ;
oSay:SetFile( If( oSelf:lFilter, ".\bitmaps\bradio1.bmp", ".\bitmaps\bradio2.bmp" ) ) )


then I have a get

@ 9,592 GET oNum1 VAR oSelf:nNumFrom SIZE 90,60 PIXEL OF ::oGrPlanning ;
FONT oFontBig ;
BITMAP FwDArrow() ;
ACTION NIL ;
WHEN oSelf:lFilter


when the oSelf_lFiler is F the get is allwasy active

how I can resolve ?
Last edited by Silvio.Falconi on Fri Jul 05, 2019 5:42 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7038
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clausole When not run ok

Postby karinha » Thu Jul 04, 2019 1:01 pm

lFilter is STATIC VARIABLE? .T. or .F.?

To best assist you, always set a full example. You always put pieces of the program.

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7800
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Clausole When not run ok

Postby Silvio.Falconi » Thu Jul 04, 2019 1:49 pm

lfilter is a DATA of my class and init is false
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7038
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clausole When not run ok

Postby karinha » Thu Jul 04, 2019 2:22 pm

And when you change lfilter to .T., What returns?

Code: Select all  Expand view

Return( ::lFilter )  // ??
 



? lFilter

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7800
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Clausole When not run ok

Postby Silvio.Falconi » Thu Jul 04, 2019 2:47 pm

return right only the get not respect the when clausole

Image


I tried with btnbmp

@ 24, 400 BTNBMP oSay PROMPT { || If( oSelf:lFilter, "Filtro", "Tutti" ) } ;
RESOURCE aImagesGiorno[ 1 ] ;
SIZE 50,60 PIXEL OF ::oGrPlanning FLAT ;
ACTION ( oSelf:lFilter := !oSelf:lFilter, ;
::SetImages( If(oSelf:lFilter, aImagesGiorno[ 1 ], aImagesGiorno[ 2 ] ) ),;
msginfo(oSelf:lFilter) )


@ 9,592 GET oNum1 VAR oSelf:nNumFrom SIZE 110,40 PIXEL OF ::oGrPlanning ;
FONT oFontBig ;
BITMAP FwDArrow() ;
ACTION nil,;
oNum1:REFRESH() ) when ::lFilter //or when oself:lfilter


Image

the btnbmp run ok and change the value od lFilter
then the get not respect the clausole WHEN oself:lfilter or when ::lFilter


because the get must run only when lfilter is true

I tried also with @ 24, 400 BTNBMP oSay PROMPT { || If( oSelf:lFilter, "Filtro", "Tutti" ) } ;
RESOURCE aImagesGiorno[ 1 ] ;
SIZE 50,60 PIXEL OF ::oGrPlanning FLAT ;
ACTION ( oSelf:lFilter := !oSelf:lFilter, ;
::SetImages( If(oSelf:lFilter, aImagesGiorno[ 1 ], aImagesGiorno[ 2 ] ) ),;
oNum1:refresh(),oNum2:refresh() )

but oNum1 and oNum2 are not disable when the lFilter is False
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7038
Joined: Thu Oct 18, 2012 7:17 pm

Re: Clausole When not run ok

Postby nageswaragunupudi » Thu Jul 04, 2019 4:24 pm

You need to use oDlg:AEvalWhen()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Clausole When not run ok

Postby Silvio.Falconi » Thu Jul 04, 2019 7:55 pm

Already in the afternoon I had solved when Enrico reminded me that I had to use AEvalWhen (), anyway thanks anyway. ia another time I had the same problem but unfortunately a little for the age a little for the heat I have not recirculated myself
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7038
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests