dabo Commit
Revision 6481
Date: 2011-02-27 07:08:55 -0800 (Sun, 27 Feb 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6481
Changed:
U trunk/dabo/ui/uiwx/dSizerMixin.py
Log:
Added the 'ChildObjects' property. This will return a list of the objects
managed by the sizer, whether they be controls, sizers, or spacers. The
'Children' property still returns a list of sizer items.
Updated the getItem() method to add and populate the _controllingSizer and
_controllingSizerItem attributes to each item.
Diff:
Modified: trunk/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizerMixin.py 2011-02-27 15:04:04 UTC (rev 6480)
+++ trunk/dabo/ui/uiwx/dSizerMixin.py 2011-02-27 15:08:55 UTC (rev 6481)
@@ -154,6 +154,7 @@
# If compressed to .pyo, __doc__ will be None.
pass
+
def layout(self):
"""
Layout the items in the sizer.
@@ -184,6 +185,7 @@
# If compressed to .pyo, __doc__ will be None.
pass
+
def remove(self, itm, destroy=None):
"""
This will remove the item from the sizer. It will not cause
@@ -272,6 +274,8 @@
ret = szItem.GetWindow()
elif szItem.IsSpacer():
ret = szItem.GetSpacer()
+ ret._controllingSizerItem = szItem
+ ret._controllingSizer = self
elif szItem.IsSizer():
ret = szItem.GetSizer()
return ret
@@ -728,6 +732,12 @@
return ret
+ def _getChildObjects(self):
+ itms = self.GetChildren()
+ ret = [self.getItem(itm) for itm in itms]
+ return ret
+
+
def _getChildSizers(self):
itms = self.GetChildren()
ret = [itm.GetSizer()
@@ -922,6 +932,10 @@
Children = property(_getChildren, None, None,
_("List of all the sizer items managed by this sizer
(list of sizerItems"))
+ ChildObjects = property(_getChildObjects, None, None,
+ _("""List of all the objects (controls, sizers,
spacers) that are directly managed
+ by this sizer (list of objects"""))
+
ChildSizers = property(_getChildSizers, None, None,
_("List of all the sizers that are directly managed by
this sizer (list of sizers"))
_______________________________________________
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]