Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control init fail, class init fail
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00428995
Message ID:
00429620
Vues:
11
This object needs to be used inside the container or nothing will work right, so I'm not worried about it not finding the property.

I don't want to make it resize because it might cover up other objects on the form. Which would mean I'd have to go and change the size, anyway. Besides, I'd end up in a catch-22 if I did that. The object in question bases its size on its container's size. So if I make the container base its size on the object, I think VFP would get thouroughly confused. :)

I don't understand why you guys are so against it putting up a little note saying the container is too small. It's not like the customer would ever see it. Just me and Matt and any other programmer he might hire. It should never happen, anyway, because the class starts out at its smallest size and the instructions specifically say not to make it any smaller. If someone forgets and makes it too small, they get the note and have to go make it bigger. It's really not a big deal.

Thanks,

Michelle


>Michelle,
>
>Conditional instantiation is nasty anyway you look at it. And it appears the VFP has recently changed behavior. It used to bubble up these contained object instantiation failures and not instaniate the outermost object. But VFP6SP4 is not behaving that way now from a test I just ran.
>
>The suggestion of using a public is bad because public variables are bad.
>
>The suggestion of using .parent property are bad because they require that the objects can only be put into a container that supports the "conditional instantiation" property.
>
>If your container did a test of it's ControlCount to see if everything inside it instantiated is bad because you have to maintain the nHowManyChildObjectsShouldIHave property at the right value which is a PITA as you are adding/removing things.
>
>Seeing your reply to Bret, why not make your objects a little smarter in the first place to obviate the need of failing to instantiate? If the parent object isn't big enough the contained objects can make it bigger: this.parent.Resize() which could run a calculation to find the max X-Y coordinates used by all it's contained objects.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform