Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Order of Instantiation Of Objects In a Container
Message
De
24/02/2007 09:59:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/02/2007 19:13:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01198480
Message ID:
01198546
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Sergey and Cetin,
>
>Thanks for your warning about relying on instantiation order. This is why I have to do it: I am building a control which will be placed on various forms. The control contains a grid whose control source is a local view that requires parameters to be set which must be done in code. I must set the parameters and open the local view before the grid instantiates. To do this, I am placing another object (let's call it a loader object) on the control whose Init method will open the local view. Therefore, this loader object must be instantiated before the grid. I can't think of any other way to do it. Any ideas?
>
>Sergey, I see the method ZOrder. I don't understand how I call it to set the instantiation order of objects within a container, can you explain?
>
>Thanks, Chaim

Chaim,
Grid doesn't need neither its parameters nor the view to init. You can simply set its recordsource to "". Later when you need to set it up you can call a custom method of it.
Yet another technique (if you need it badly to do in init) is to put code in init with an if check. Something like:
if !this.IsReadyForSetup
 return && just init
endif
* setup code when ready
Thus from your other object's init (or form init as it fires after all objects init) you could call:
with this.parent.dependantGrid
 .IsReadyForSetup = .t.
 .Init()
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform