Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the same method for all fields in a grid
Message
From
29/06/2001 05:13:25
 
 
To
26/06/2001 15:42:06
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00523476
Message ID:
00525075
Views:
18
Thanks Gerry

>Subclassing is always a good idea IMO; as far as PEMSTATUS, I frequently code "virtual" methods/events ... ie. base methods/events that do "nothing" and are only implemented in the subclasses.

I do this as a matter of course as well:)

I was not very keen on the solution you mention below since the method would be executed mutiple times even on grids that do not have a .GridDoubleClicked method

My experience with grids has been that they are difficult to debug in certain situtations when every field is firing off a method constantly so this should be avoided if possible.

Also I have not yet experimented with the builders for implementing grids that make use of my own custom classes. I suspect there may be some problem in that area.

Since the amount of labour I am trying to save is fairly small it looks like Nick's ingenious click transparent class will be the quick solution to this problem. I expect I will find more way to use this class as well.

>In your case, I would add a "virtual" .GridDoubleClicked() event to the "base" Form you typically use for containing Grids; eg. something like ...
>
>
>PROC .GridDoubleClicked
>   LPARAMETERS oTextBox
>   *  Virtual.
>   RETURN .T.
>
>
>In the TextBox Class, I would code:
>
>
>PROC DblClick
>   THISFORM.GridDoubleClicked( THIS )
>
>
>In the above case, there is not need to code PEMSTATUS. If a Form in question does not wish to respond to .DblClick (from a TextBox), then that Form simply would not override (ie. "implement") .GridDoubleClicked.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform