dabo Commit
Revision 6395
Date: 2011-02-06 08:59:27 -0800 (Sun, 06 Feb 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6395
Changed:
U trunk/dabo/ui/uiwx/__init__.py
U trunk/dabo/ui/uiwx/dLed.py
U trunk/dabo/ui/uiwx/dShell.py
Log:
Ran into an odd error in the HitTest() method after upgrading to the latest
wxPython. Now sometimes it returns a single value instead of a 2-tuple, so I
added code to handle this case.
dLed wasn't always resizing properly because of the underlying panel's minimum
sizer settings. Fixed.
Added the ability to embed the _Shell class of dShell in non-dShell forms.
Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py 2011-02-06 16:53:56 UTC (rev 6394)
+++ trunk/dabo/ui/uiwx/__init__.py 2011-02-06 16:59:27 UTC (rev 6395)
@@ -448,7 +448,13 @@
if isinstance(wxEvt, wx.ListEvent):
pos = wxEvt.GetPosition()
obj = wxEvt.GetEventObject()
- idx, flg = obj.HitTest(pos)
+ ht = obj.HitTest(pos)
+ try:
+ idx, flg = ht
+ except TypeError:
+ # Recent wx versions raise list events for unknown
reasons.
+ idx = ht
+ flg = None
ed["listIndex"] = idx
try:
ed["col"] = wxEvt.GetColumn()
Modified: trunk/dabo/ui/uiwx/dLed.py
===================================================================
--- trunk/dabo/ui/uiwx/dLed.py 2011-02-06 16:53:56 UTC (rev 6394)
+++ trunk/dabo/ui/uiwx/dLed.py 2011-02-06 16:59:27 UTC (rev 6395)
@@ -24,6 +24,7 @@
self.led.DynamicRadius = lambda: min(self.Width, self.Height)/2
self.led.DynamicFillColor = lambda: self.Color
super(dLed, self)._afterInit()
+ self.layout(resetMin=True)
self.update()
Modified: trunk/dabo/ui/uiwx/dShell.py
===================================================================
--- trunk/dabo/ui/uiwx/dShell.py 2011-02-06 16:53:56 UTC (rev 6394)
+++ trunk/dabo/ui/uiwx/dShell.py 2011-02-06 16:59:27 UTC (rev 6395)
@@ -175,9 +175,12 @@
super(_Shell, self).processLine()
if edt:
# push the latest command into the stack
- self.Form.addToHistory()
+ try:
+ self.Form.addToHistory()
+ except AttributeError:
+ # Not running in dShell
+ pass
-
def getAutoCompleteList(self, cmd):
return self.interp.getAutoCompleteList(cmd,
includeMagic=self.autoCompleteIncludeMagic,
_______________________________________________
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]