Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Broadcasting in a complex form.
Message
De
01/04/1998 21:15:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Broadcasting in a complex form.
Divers
Thread ID:
00088856
Message ID:
00088856
Vues:
47
I need to broadcast changes in the values of certain controls to members of a fairly complex form consisting of about 400 controls and 31 pages and subpages.

I am using two approaches now. I directly notify a dependent control of the change in the value of a control, which requires a lot of coding and maintenance as controls are added, modified and deleted. Second, I generally broadcast changes across all of the pages of the form. Because of the large number of controls, this takes a noticable amount time.

I am thinking of setting up a messagecenter object on the form to receive and dispatch messages only to those controls which need the information. The heart of the messagecenter control would be an array (or cursor) which maintains a list of controls that need to receive notices of changes in values. The array would be updated by each dependent control as it is init()ed -- that is, it would notify the messagecenter of the kinds of value change messages it needs to receive, and messagcenter would add the information to the dispatcher array.

When the value of a control changes, the control would notify the message center of the change (through the lostfocus(), interactivechange() or programmaticchange() events). The messagecenter would then check the dispatcher array to see which controls need to be notified of the change in value, and dispatch the message only to those controls.

This kind of broadcast (mediumcast??) paradigm can be coded into high-level control objects so that all derived controls would inherit the capability of sending and receiving messages -- which takes care of a lot of the code maintenance problem. It should also be much faster than a general broadcast.

My question is: Has anyone implemented such a scheme? If so, can you suggest any additions that would make the concept work more efficiently? Better yet, is there any code out there that I can adapt?

Any advice would be appreciated.

JME
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform