I've been working on a light GUI helper library for
IronPython/Winforms (boo hiss etc!)
TayLayout is a more sophisticated version of the flow layout. Items
are added in a L to R fashion until you specify that a new line is
required. Demonstrated on my blog are the convenience functions for
creating and adding a control to a container in one step. http://www.latedecember.co.uk/sites/personal/davy/arch_IronPython.html
My simple query is, would it be worth writing a wxPython version of Taylayout?
My simple query is, would it be worth writing a wxPython version of Taylayout?
Yes. Some kind of "flow" Sizer has been asked for numerous times.
One question:
Items are added in a L to R fashion until you specify that a new line
is required.
How do you specify that? In fact, if you need to specify it, then you might as well use one of the grid sizers. I'd rather see the newline calculated according to how much space there is available.
From your blog, in which I don't see the line breaks specified:
# Finally set the size of the Form.
self.ALayout.Complete()
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
How do you specify that? In fact, if you need to specify it, then you
might as well use one of the grid sizers.
Set second parameter to True (default) for a new line, False to keep
on current line. (N.B. I am considering using constants or named
parameters here).
I'd rather see the newline calculated according to how much
space there is available.
Taylayout works a bit differently, the form or container size is set
based on the size of the controls. That said, there is also a stretch
feature which expands a control to the container width.
A fixed size container version would be handy too. As long as a new
line could be forced if required. Thanks for the idea
···
On 2/13/07, Robin Dunn <robin@alldunn.com> wrote:
And I think one or two have been posted to this list in the past.
Taylayout works a bit differently, the form or container size is set
based on the size of the controls.
Now I get it. Yes, I actually could use that on a project right now.
A fixed size container version would be handy too. As long as a new
line could be forced if required. Thanks for the idea
yes, having either option would be good.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Well with a bit of deleting and replacing DotNet methods, I managed to
get taylayout running for wxpython. No helper functions yet but the
(tiny) core is there.
Maybe put something up on Google tomorrow night
Couldn't find flowlayout for wxPython. Anyone know where it is? Gmame
turned up little.
Cheers,
Davy
···
On 2/13/07, Christopher Barker <Chris.Barker@noaa.gov> wrote:
Now I get it. Yes, I actually could use that on a project right now.
> Now I get it. Yes, I actually could use that on a project right now.
Well with a bit of deleting and replacing DotNet methods, I managed to
get taylayout running for wxpython. No helper functions yet but the
(tiny) core is there.
Maybe put something up on Google tomorrow night
Couldn't find flowlayout for wxPython. Anyone know where it is? Gmame
turned up little.
FlowLayout was originally coded by Peter Damoc. I have a working copy
of it on my pc at work, so if you are interested I can re-post it here
tomorrow. Or if Peter wants to do it himself, it would be better, as
he is its original "father"
I tried to finish it (as far as I remember, there were some methods
missing), but Peter is far more good at programming than I am, and
actually I don't remember where I left it. If there is interest on it,
I believe we should resurrect FlowLayout and see if we can merge
things with your implementation (or share useful code).
On 2/13/07, Christopher Barker <Chris.Barker@noaa.gov> wrote:
Now I get it. Yes, I actually could use that on a project right now.
Well with a bit of deleting and replacing DotNet methods, I managed to
get taylayout running for wxpython. No helper functions yet but the
(tiny) core is there.
Maybe put something up on Google tomorrow night
Couldn't find flowlayout for wxPython. Anyone know where it is? Gmame
turned up little.
Unfortunately I never got to finish that sizer (my ADD got me)…
Attached is what I think it is the latest version I have.
I would love it if some kind soul would add the missing bits (quote form Robin):
Some things I would like to see added to it are support for
alignment of the items within the space they are given using the
alignment flags, support for items with border space, and perhaps some
sort of support for the wx.EXPAND flag. Oh, and also a docstring!
The entire code is like 70 lines… out of this 70, the first 10 are comments
It is no big deal… but I seam to have failed adding another line to that code for 10 months…
Now I get it. Yes, I actually could use that on a project right now.
Well with a bit of deleting and replacing DotNet methods, I managed to
get taylayout running for wxpython. No helper functions yet but the
(tiny) core is there.
Maybe put something up on Google tomorrow night
Couldn’t find flowlayout for wxPython. Anyone know where it is? Gmame
turned up little.
FlowLayout was originally coded by Peter Damoc. I have a working copy
of it on my pc at work, so if you are interested I can re-post it here
tomorrow. Or if Peter wants to do it himself, it would be better, as
he is its original “father”
I tried to finish it (as far as I remember, there were some methods
missing), but Peter is far more good at programming than I am, and
actually I don’t remember where I left it. If there is interest on it,
I believe we should resurrect FlowLayout and see if we can merge
things with your implementation (or share useful code).
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
I worked on wxTayLayout tonight and put together a sample program. http://code.google.com/p/taylayout/downloads/list
There's some catch up todo with the IronPython version but only really
in the helper methods and classes. Controls can be right-aligned and
stretched. Button and StaticText have helpers but any control can be
added using 'add'.