Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a sort of *LASTKEY()* for the mouse ?
Message
From
16/08/2000 07:58:41
 
 
To
15/08/2000 05:19:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00404395
Message ID:
00405404
Views:
11
Alejandro:

What we did in our framework is to add 2 methods to our baseclass for the controls that our standards allow: Validate_Class & Validate_Hook

i.e. a cntLookup Control contains a textbox, lookupbtn, label to display info and a shape for visual look.
Customer_Number is based upon cntLookup, as is Employee_Number, Package_Number, etc.
The Validate_Class method of Customer_Number is general, related to Customers is part of the sub-class. The Validate_Hook method is used at the instance level to deal with a customer number in a specific table. Each Validate_xxxxxx method returns either .T. or .F. as necessary. The trick is that the VALID() in the baseclass that calls this.Validate_Class(); this.Validate_Hook(); and any other code necessary, ALWAYS Returns .T. We handle invalid entries by changing the color to a shade of red and displaying an error message in a panel of a statusbar. Before the user can save the entries, a Validate_All runs through just the Validate_Hook() of each control and setfocus at the 1st invalid field, while putting up a messagebox. If the user presses ESC, clicks Cancel button or the Closebox, validation is skipped.

When the user clicks on the lookupbtn (or presses F2), the associated textbox does turn red if it's value is invalid, but control is allowed to pass to the button.

I agree that inside VFP, it HAS to KNOW where control is going, but that behavior isn't available to us.

HTH
Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform