Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User defined methods pre-empt necessary processing?
Message
 
 
To
18/08/1999 02:23:29
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00242642
Message ID:
00255627
Views:
27
David,

FWIW, I've never ever coded anything in a CommabdButton When or Valid method. They make no sense to use in the context of VFP and I think they are holdovers in an attempt to make 2.x code port easier. It sounds like you are porting 2.x code. I completely junked my 2.x stuff and redid my UI in VFP.

If I want to prevent a user from clicking a button I'd .Enabled = .f. If I wanted to know when a button got the focus I'd use the GotFocus() event to notify me, I can't actually say that I've ever wanted to do this. What we used to put in a 2.x button Valid() belongs in Click().

You do have complete control over VFP objects NODEFAULT and BaseClass::Method() allow you to alter the normal flow of event sequences.

>It's not what happens inside that counts. It's only observable behavior I care about. I'm sure that what they do makes perfect sense and is consistent and correct, but I want to know exactly what that is...all of it.
>
>Here's an example of what I mean.
>
>If you read about the event model in the programmer's guide it tells you that when fires just before got focus and valid fires just before lost focus. Fine. Makes sense. When let's you decide if you really want to allow focus and valid let's you decide if you really want to allow losing it.
>
>Now try clicking on a command button that already has focus. The event sequence is: click,valid,when ?? huh? why when? I've already got focus?? Well, I'm sure there's a good reason based on some unwritten paradigm, but it doesn't follow the pattern and it got me into trouble.
>
>My code failed because it made some assumptions based on when only occuring if a control does not already have the focus. The description of the when event says 'occurs before a control receives the focus'. Nothing I could find describing commandbuttons countermands this.
>
>So I banged around with the debugger and finally figured out what was going wrong and worked around it.
>
>Firing sequences are external behavior that should absolutely be well defined and documented because events do stuff!
>
>Never said they did the wrong stuff! Just want to know All the stuff they do!
>
>VFP wants us to use baseclasses as black boxes. Fine. They still ought to tell me every damn thing thing those boxes can do to any object (using the word in its generic sense) whose state effects the behavior of my program.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform