Gene

I am using a class " showtxt" instead of a texbox as a control in the grid.
In the LostFocus() I call a method of this class it checks whatever, displays 
a form if needed.
Then returns a value to the grid LostFocus(), there I check the returned value.
LOCAL nRet, lOk

lOk= .T.
nRet= DODEFAULT()
DO CASE
  CASE nRet = 1   && Error, Redo
    lOk= .F.
  CASE nRet = 2   && Ok
    && Proceed
  CASE nRet = 3 AND vCaiMovP.QtdVda<>0  && ENTER key, Click Insert
    KEYBOARD '{ENTER}' 
  CASE nRet = 4 AND vCaiMovP.QtdVda<>0  && TAB Key, SetFocus
    KEYBOARD '{TAB}'
  CASE nRet = 5    && No product
    REPLACE ProdCad WITH 0, QtdVda WITH 0 IN vCaiMovP
    && Nothing
ENDCASE 
return lOK

HTH, E.



On Wednesday, November 6, 2013 5:29 PM, Gene Wirchenko <[email protected]> wrote:
 
At 13:48 2013-11-04, Gene Wirchenko <[email protected]> wrote:
>>Dear Vixens and Reynards:
>>
>>      More slow progress on grids.
>>
>>      I realised that I had fallen on my old habit of using .valid 
>> and decided to use .lostfocus instead for control-level 
>> validation.  It works except...
>>
>>      The control does not display input the second time.
>>
>>      I enter an invalid value then tab.  I get the error 
>> message.  At this point, the focus should be on the error control 
>> and I should be able to enter another value.  The focus is there, 
>> but the characters that I then type are not displayed.  When I tab 
>> out, they do show up.
>>
>>      What am I overlooking here?
>
>      I was unable to find a clean solution and no one posted 
>anything relevant so I got to kludge.  What fun!
>
>      When I throw an error, I also set a form-level flag that there 
>is a grid error and now how many times to ignore validation (2).  I 
>then keyboard tab and backtab. (This will change to what I need to 
>avoid disturbing the display (as best I can)).  My field validation 
>code checks if there is an error, decrements the count, and if the 
>count is still positive, skips the validation or does the validation 
>when the count is zero.
>
>      A <redundancy>horrible</> kludge, but it appears to work.
>
>      <SIGH> I really wish that I did not have to fight VFP so much.
>
>Sincerely,
>
>Gene Wirchenko
>
>
>_______________________________________________
>Post Messages to: [email protected]
>Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
>OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
>Searchable Archive: http://leafe.com/archives/search/profox
>This message: http://leafe.com/archives/byMID/profox/
>** All postings, unless explicitly stated otherwise, are the opinions of the 
>author, and do not constitute legal or medical advice. This statement is added 
>to the messages for those lawyers who are too stupid to see the obvious.
>
>
>

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to