Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BindEvent
Message
De
14/03/2014 14:29:48
 
 
À
14/03/2014 14:26:31
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01596538
Message ID:
01596560
Vues:
57
>>>Hi all
>>>
>>>I'm using the BackStyle_Access method made popular by Craig Boyd and Burkhard Stiller. The method is added to a container in a column. By the way, is it only the container that makes the grid check the back_style? As you might know, the access method fires twice per row. I'm trying to avoid that, if possible. I will have to add the access method to a container that is very widely used. That means the access method will fire for every row and every column, even if I only want it for one column. It's also making tracing a bit of a pain since if I set step on, each of the calls to BackStyle_Access fires.
>>>
>>>I thought I remembered that I could BindEvent to the BackStyle property so that when the grid interrogates the value on the container in the one column, I could trigger my routine. The help says we can bind to properties. It fires the delegate if I change a property, but not when I interrogate it. Is there flag I missed? The help does not mention that interrogating a property's value will not trigger the delegate.
>>>
>>
>>Pretty sure BindEvent() fires only on changes to properties, not on accesses. Maybe create a specific subclass of the container for use in this column? Or, to cut down the code that runs, add a property to indicate whether you want to do whatever it is you're doing with method. Set it to true for the one column and first thing in the method:
>>
>>IF This.lDoThisThing
>>...
>>ENDIF
>>
>>While it won't keep it from firing, it will mean just one line of code to run when it does fire.
>>
>>Tamar
>
>Hi Tamar
>
>Been a while!
>
>I did much what you wrote here. Set a property to .T. then call a method. Developers can bindevent to that method. That method only fires once because of the property. I can't use a different subclass. Too bad I can't suppress the BackStyle_Access on the columns that do not need it.
>
>Thanks!

Mike --

In my usage, I save the current record number in a grid property and only called my method when that value changes. Thus the method is only called once per row.
Jim Nelson
Newbury Park, CA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform