GET ... WHEN

GET ... WHEN

Postby Raymond Fischbach » Thu Jun 04, 2009 3:28 pm

Hello all,

I am facing a problem with the WHEN clause of a GET.

As a reference, the VALID clause is executed when the GET control loses focus. This works perfectly.
Similarly, I suppose that the WHEN clause should be executed when the GET control receives the focus.
This doesnt' work as expected.

In fact, I have a few GETs with a WHEN clause in a specific Dialog. I want to show a small message for these GETs (a kind of tip).

Code: Select all  Expand view  RUN
@  5.04, 3.0 GET cD10 SIZE 35, 16 PICTURE "999" WHEN DspDia(oWnd,"10")
@  5.04, 7.5 GET cD12 SIZE 35, 16 PICTURE "999" WHEN DspDia(oWnd,"12")
@  5.04,12.0 GET cD14 SIZE 35, 16 PICTURE "999" WHEN DspDia(oWnd,"14")
...

FUNCTION DspDia(oWnd,cTxt)
oWnd:Say(17,1,cTxt)
RETURN .T.


When executing, werever the focus is, the message "14" is displayed.

Can someone enlighten me on what I miss?
What can I do to have the correct message displayed?

Many thanks in advance,
Raymond
Raymond Fischbach
www.mouches.org
User avatar
Raymond Fischbach
 
Posts: 48
Joined: Sun Oct 30, 2005 9:29 am
Location: Belgium

Re: GET ... WHEN

Postby Enrico Maria Giordano » Thu Jun 04, 2009 8:59 pm

Use bGotFocus codeblock instead of WHEN clause.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET ... WHEN

Postby Raymond Fischbach » Fri Jun 05, 2009 6:49 am

Hello Enrico,

Thank you for this info.
But how can I do it?

Many thanks,
Raymond
Raymond Fischbach
www.mouches.org
User avatar
Raymond Fischbach
 
Posts: 48
Joined: Sun Oct 30, 2005 9:29 am
Location: Belgium

Re: GET ... WHEN

Postby Enrico Maria Giordano » Fri Jun 05, 2009 9:40 am

Code: Select all  Expand view  RUN
oGet:bGotFocus = { || YourCodeHere() }


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET ... WHEN

Postby Raymond Fischbach » Sun Aug 02, 2009 8:31 am

Hello Enrico,

Sorry for the late answer but I have had a lot of other work to do in between.
It also took me some time to find how I could define the oGet object.
Finaly, I thought about the ppo file and ... bingo :)

Your solution works perfectly.

Many thanks again,
Raymond
Raymond Fischbach
www.mouches.org
User avatar
Raymond Fischbach
 
Posts: 48
Joined: Sun Oct 30, 2005 9:29 am
Location: Belgium


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 6 guests