That was a great post. The rest of the thread isn't too bad either. Once I "get it" I'll boil it down into a wiki page. If some of my Q's seem like I am not paying attention, they are more "I think I know, but let me confirm" (like the first one.)

Ed Leafe wrote:
On Oct 8, 2005, at 2:12 AM, Carl Karsten wrote:

Do Forms and Sizers both have a sizer colection?


No. Forms (and any other container) have a Sizer property that references the sizer that is used to determine the size/position of its member controls.

Is there a 1:1 or 1:many relation between From and Sizer?


You are conceptually pretty close; the only difference is that a sizer is not a container; it's a rule. The actual form hierarchy is


What is a rule?


It governs how objects are arranged. Take a vertical sizer that controls 3 objects. The 'rule' says to divide the space according to the various weights assigned to each object, allowing for any specified borders around each object, and whether the object expands in the horizontal direction to fill up the available space.

weights - new concept.  but I think I get it.  neat.


How does .layout() know what text boxes go with what sizers?


Objects are 'assigned' to a sizer by calling sizer.append(obj). This adds the object to the list of objects that the sizer controls. An object can only be added to a single sizer; attempting to add it to more than one will raise an error.

Lets talk about the term collection. Is Collection a well defined term in the context of Dabo/Python?

In VFP, Collection can mean one of many things:
VFP has the Collection class,
and then VFP has collections that are not based on that class (containers)
and then VFExpress has a collection class that is array based
So when I think "collection" I think of something that could be any one of those, and maybe even something else not listed but similar.

for instance: "list of objects" seems to me to be a collection.


Sizers can control three types of objects: controls, spacers and other sizers.

gets their size and position


I thought nothing had a position?  I think you skipped a step.


Nothing has a *pre-determined* position, as you are used to in VFP. Upon each call to layout, the sizer will calculate the size and position of each of its objects, based upon the current constraints. Every time you resize a form, the size and position of every object is recalculated and updated.

That makes sense. Did I mention this is whole sizer thing is pretty cool? It kinda crept in under my radar - maybe it needs a bit more air time, like a PyCon talk? (or do all the cool people know about this, and I am just showing my greenness?)

^C

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to