Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why don't ...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Divers
Thread ID:
00212631
Message ID:
00212758
Vues:
22
>... controls [e.g., command buttons, textboxes, etc.] have Resize methods? Even adding a resize method to my subclass of such controls does not automatically fire if I resize a form. :( So much for encapsulating all code within these classes.
>
>I guess what I am looking for are opinions and thought on what would be the best way to handle this while thinking outside the box [i.e., regardless of how we currently have to handle this].
>
>My thought would be that each control have its own resize method and a few more properties to store the original parent container's dimensions, the control's original dimensions and coordinates [top, left]. From there, everything is now relative, the control does not have to be resized or repositioned by some parent's resize method.
>
>Just wondering.

Let me ask a question here, to see if I'm thinking properly in OO theory.

It's my understanding that, in OO theory, it's OK (or even expected) for a container to know about its contained objects and manipulate them. What's not OK is for an object to manipulate its container, or its siblings within the container. i.e., the form should be able to resize its text boxes, command buttons, etc., but its command buttons shouldn't be able to resize the form, and its command buttons shouldn't be able to resize its form's textboxes.

Now, if you wanted a command button to have a resize method so it changed its prompt if the form resized it, or a text box to turn its foreground color to magenta if the form resized it, that would still fit within these rules...

Right?

Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform