dabo Commit
Revision 1881
Date: 2006-01-30 17:36:27 -0800 (Mon, 30 Jan 2006)
Author: ed

Changed:
U   trunk/dabo/ui/uiwx/dSizerMixin.py
U   trunk/dabo/ui/uiwx/dTreeView.py

Log:
Improved edge case handling in dTreeView when there is no node selected.

Fixed a problem in dSizerMixin if an item in a grid sizer is pasted into a box 
sizer. Some of the sizer attributes don't apply to the box sizer; these are now 
ignored.


Diff:
Modified: trunk/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizerMixin.py   2006-01-31 01:28:06 UTC (rev 1880)
+++ trunk/dabo/ui/uiwx/dSizerMixin.py   2006-01-31 01:36:27 UTC (rev 1881)
@@ -347,10 +347,10 @@
                elif lowprop == "border":
                        itm.SetBorder(int(val))
                        ret = True
-               elif lowprop == "rowexpand":
+               elif lowprop == "rowexpand" and isinstance(self, 
dabo.ui.dGridSizer):
                        self.setRowExpand(val, row)
                        ret = True
-               elif lowprop == "colexpand":
+               elif lowprop == "colexpand" and isinstance(self, 
dabo.ui.dGridSizer):
                        self.setColExpand(val, col)                     
                        ret = True
                elif lowprop in ("expand", "halign", "valign", "bordersides"):

Modified: trunk/dabo/ui/uiwx/dTreeView.py
===================================================================
--- trunk/dabo/ui/uiwx/dTreeView.py     2006-01-31 01:28:06 UTC (rev 1880)
+++ trunk/dabo/ui/uiwx/dTreeView.py     2006-01-31 01:36:27 UTC (rev 1881)
@@ -467,7 +467,11 @@
                if nd is None:
                        nd = self.Selection
                        if isinstance(nd, list):
-                               nd = nd[0]
+                               if nd:
+                                       nd = nd[0]
+                               else:
+                                       # Empty list
+                                       return None
                try:
                        ret = self.getChildren(nd)[0]._obj
                except:
@@ -493,7 +497,11 @@
                if nd is None:
                        nd = self.Selection
                        if isinstance(nd, list):
-                               nd = nd[0]
+                               if nd:
+                                       nd = nd[0]
+                               else:
+                                       # Empty list
+                                       return None
                ret = self._getRelative(nd, self.GetPrevSibling)
                if ret is None:
                        try:
@@ -517,7 +525,11 @@
                if nd is None:
                        nd = self.Selection
                if isinstance(nd, list):
-                       nd = nd[0]
+                       if nd:
+                               nd = nd[0]
+                       else:
+                               # Empty list
+                               return None
                try:
                        itemID = func(nd.itemID)
                        ret = [nod._obj for nod in self.nodes




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

Reply via email to