Michael Sorich wrote:
>Attached is my latest attempt at a simple layout
>manager. Once again, it is based on anchors with
>automatic partitioning of the background into a grid
>based on the positioning of expandable components.
>Major changes from the previous attempt include:
>
>
>3) can now anchor so relative position of component to
>both sides is held constant (component size does not
>change)
>
>An example is attached. If anyone has a pythoncard
>example where they have used wx sizers, see if this
>method can replicate the result. Alternatively, send
>the code to me and I will give it a go.
>
>
The findfiles tool that comes with PythonCard is a good example using
sizers.
>I think that this method would be enhanced if it could
>be complemented with an easy means of using splitter
>windows (the split would not need to be visible or
>user adjustable). This method divides the background
>into a grid. In some/many cases different parts of the
>background should have separate grids.
>
>This method deals with resizing/repositioning of the
>components with a change in the background size. It
>does not deal with changes as a result of font size
>changes.
>
>
I had to change your code slightly - in anchor.py, there were 3 cases of
for component in self.components:
that needed to be
for component in self.components.itervalues():
I also noticed that if I made the window wide enough, button3 and
button1 would overlap - was that expected ?
For splitter lines: I'd suggest a (temporary) convention using "Static
line"s that follow some naming scheme, e.g.
any Static Line whose name is anchorXyz is used as a splitter
there is a call available to turn all such lines invisible
(I almost said do that automatically - but it would be interesting
for now to see them, so make it under prog control)
Do you think there's room for using "Static box" in a similar way - the
box is treated as a separate sub-grid ?
The biggest thing I'd like to see, which I think should be possible, is
to combine the anchor/constraint scheme with sizers used at the level of
built-in components. i.e. as you do the sizing, you allow components to
produce their own min size according to "standard" sizer methods, and
then use that within the constraint layout. IF that's possible, then I
think you have a good chance of overcoming the most significant
advantage of sizer schemes (automatic handling of cross-platform font
and decoration variations).
-- Alex.
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005
|