Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A/A Qs
Message
De
12/01/2000 13:16:15
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Re: A/A Qs
Divers
Thread ID:
00316635
Message ID:
00317113
Vues:
19
Put a plain-jane checkbox whose class has only a value_Assign method in it on a form. Put some WAIT WINDOW, DEBUGOUT, or MESSAGEBOX() code in the method, run the form, and click your checkbox with the mouse or keyboard. If your Assign method fired, you've done something different than I, and I would be really curious to see what it is. From my experience, this method will only fire when something external to the control explicitly sets the control's value property.


>Curious as to why the value_assign would not work. I have it working fine with a bound checkbox and assumed it would work the same with all the other controls.
>
>>John, I disagree (as you probably would have guessed I would :-))
>>
>>Try this:
>>
>>Place two textboxes on a form, bind the first one to THISFORM.Tag. In that textbox, put THISFORM.Text2.Value = THISFORM.Tag in the InterActiveChange Event.
>>
>>Then run the form and start typing in the first textbox.
>>
>>Doing this, you'll find that the value of a property (or field) controlled by a control's controlsource will only change when the control loses focus, and not as the value changes.
>>
>>Furthermore, there's a small problem with Value_Assign methods: they don't work.
>>
>>To have code fire when the value of a databound control changes, there is no other way that I know of, then to put code in both the ProgrammaticChange and InteractiveChange Events. And even the ProgrammaticChange doesn't cover the control being assigned a value from its controlsource (an event that occurs ONLY with an explicit or implicit (after form.init) call to the control.refresh method.
>>
>>David-
>>
>>FWIW, all of my base databound controls have a method called AnyChange that is called from both the InteractiveChange and the programmaticChange events. When I need code to run every time the value of a control changes, I put it in the AnyChange method. Your current situation sounds like a prime candidate for this type of arrangement.
>>
>>>True, but that's not necessarily good design. You may have an object who's main role in life is to maintain attributes. If you want to wholly encapsulate function within this object, you want to couple it as little as possible to the UI and that is where Assign and Access come to play, but using A/A in the object itself and not in the front-end control, see?
>>>
>>>>You shouldn't need A/A here, we've already got InterActive Change and Programmatic Change in the base class, use those instead.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform