dabo Commit
Revision 6465
Date: 2011-02-24 13:06:55 -0800 (Thu, 24 Feb 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6465
Changed:
U trunk/dabo/ui/uiwx/dTreeView.py
Log:
Some additional cleanup in _setMultipleSelect() method.
Fix issue setting node font with hidden root.
Diff:
Modified: trunk/dabo/ui/uiwx/dTreeView.py
===================================================================
--- trunk/dabo/ui/uiwx/dTreeView.py 2011-02-24 17:19:56 UTC (rev 6464)
+++ trunk/dabo/ui/uiwx/dTreeView.py 2011-02-24 21:06:55 UTC (rev 6465)
@@ -128,9 +128,12 @@
def _setFont(self, val):
assert isinstance(val, dabo.ui.dFont)
self._font = val
- self.tree.SetItemFont(self.itemID, val._nativeFont)
- val.bindEvent(dabo.dEvents.FontPropertiesChanged,
self._onFontPropsChanged)
- dabo.ui.callAfterInterval(100, self.tree.refreshDisplay)
+ if not self.IsRootNode or self.tree.ShowRootNode:
+ # On some platforms exception is raised while operation
+ # on hidden root node.
+ self.tree.SetItemFont(self.itemID, val._nativeFont)
+ val.bindEvent(dabo.dEvents.FontPropertiesChanged,
self._onFontPropsChanged)
+ dabo.ui.callAfterInterval(100, self.tree.refreshDisplay)
def _getFontBold(self):
@@ -1088,22 +1091,22 @@
return self._hasWindowStyleFlag(wx.TR_MULTIPLE)
def _setMultipleSelect(self, val):
- if self._constructed():
- self._delWindowStyleFlag(wx.TR_MULTIPLE)
- self._delWindowStyleFlag(wx.TR_EXTENDED)
- self._delWindowStyleFlag(wx.TR_SINGLE)
- if val:
- self._addWindowStyleFlag(wx.TR_MULTIPLE)
- self._addWindowStyleFlag(wx.TR_EXTENDED)
- else:
+ self._delWindowStyleFlag(wx.TR_MULTIPLE)
+ self._delWindowStyleFlag(wx.TR_EXTENDED)
+ self._delWindowStyleFlag(wx.TR_SINGLE)
+ if val:
+ self._addWindowStyleFlag(wx.TR_MULTIPLE)
+ self._addWindowStyleFlag(wx.TR_EXTENDED)
+ else:
+ if self._constructed():
self.lockDisplay()
sel = self.Selection
self.UnselectAll()
self._addWindowStyleFlag(wx.TR_SINGLE)
self.Selection = sel
self.unlockDisplay()
- else:
- self._properties["MultipleSelect"] = val
+ else:
+ self._addWindowStyleFlag(wx.TR_SINGLE)
def _getNodeClass(self):
_______________________________________________
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]