dabo Commit
Revision 7054
Date: 2012-01-13 15:46:50 -0800 (Fri, 13 Jan 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7054
Changed:
U trunk/dabo/ui/uiwx/dSizerMixin.py
Log:
When adding a spacer to a horizontal sizer, you have to send a tuple like (5,0)
to
get a spacer of 5 in the horizontal direction and 0 in the vertical. If you just
send an integer 5, you'll get a spacer that is (5,5) which I'll go out on a limb
and surmise isn't the common desire. The same is true when wanting a vertical
spacer.
It is annoying to have to type:
vs = dabo.ui.dSizer("v")
vs.append(...)
vs.appendSpacer((0,5))
I'd rather replace that last line with:
vs.appendSpacer(5)
This commit makes it so.
Diff:
Modified: trunk/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizerMixin.py 2012-01-13 23:18:14 UTC (rev 7053)
+++ trunk/dabo/ui/uiwx/dSizerMixin.py 2012-01-13 23:46:50 UTC (rev 7054)
@@ -227,7 +227,10 @@
def addSpacer(self, val, pos=None, proportion=0):
spacer = val
if isinstance(val, int):
- spacer = (val, val)
+ if self.Orientation == "Vertical":
+ spacer = (0, val)
+ else:
+ spacer = (val, 0)
if pos is None:
itm = self.Add(spacer, proportion=proportion,
userData=self)
else:
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]