Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last Man (Control) Standing
Message
De
30/07/1997 17:32:24
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00042332
Message ID:
00042488
Vues:
34
>>Gary Cox's solution about Bringing the controls to Front works well in my situation, but I'm sure a time will come where I need to do it programatically. So thanks to Valerie, Gary, and Matt!
>
>Gino and everyne,
>
>Ther is a potentially very nasty problem with dependence on teh istantiation order of the controls. If you or anyone else ever adds a control or makes any other changes to the form your depedency may collapse. By using either a container or the fomr itslef to thanlde the management of the conatined controls you are NOT depending on instantiation order and therefore there is no potential for breaking the functionality in future edits of the form.
>
>The reason I call this a nasty problem is that there is no visible clues anywhere that the instantiation oreder is being depended on and therefore no clue to future revisors of the fomr that they must deal with that dependency. The presence of this dependency is a violation of encpasulation in that the control that isd dependent is in no control of that thing it is dependent upon. While using a container or the form itself to handle this presents no such dependency as it is a published spec of the language that all contained objects are created before the Init of teh container is executed.

Jim, I agree that this is a maintenance issue, we have had situations where for reasons I have never track down use the send to front/back as a last resort. Even with addobjects in the init/constructor methods. For similar reasons we have taken to using a custom method 'DO' after init is fired by add/createobject in all our classes. There appear to be cases where objects that one would expect to exist for INIT or LOAD to set properties etc. just are not there until after the init/load methods have ended.
So the sequence becomes

this.addobject('newinstance','classname',parms)
this.newinstance.do()
this.newinstance.show() && if a form or other visual object

CodeBook also takes this approach for what I assume are similar reasons.

I guess we got tired of trying to figure out why the spec was not 100% in the implementation and just worked with the shipped product.
:))
Gary
Gary
Helping Make Ideas Reality
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform