dabo Commit
Revision 6109
Date: 2010-10-17 05:49:32 -0700 (Sun, 17 Oct 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6109
Changed:
U trunk/dabo/ui/uiwx/dPemMixin.py
Log:
Implemented delayed setting of the Caption property to correct WordWrap issues,
proposed by Henning Hraban Ramm. It is working correctly on OS X; please verify
on other platforms.
Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2010-10-16 22:15:01 UTC (rev 6108)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2010-10-17 12:49:32 UTC (rev 6109)
@@ -1915,7 +1915,7 @@
def _setCaption(self, val):
# Force the value to string
val = "%s" % val
- if self._constructed():
+ def __captionSet(val):
# Windows textboxes change their value when SetLabel()
is called; this
# avoids that problem.
if not isinstance(self, (dabo.ui.dTextBox,
dabo.ui.dEditBox)):
@@ -1935,6 +1935,16 @@
# wxPython 2.7.x started not having
this attribute for labels
# at least.
pass
+ if self._constructed():
+ try:
+ if self.WordWrap or
self._properties["WordWrap"]:
+ # Word wrapping doesn't always work
correctly when
+ # the Caption is set initially, so set
it afterwards as well.
+ dabo.ui.callAfter(__captionSet, val)
+ return
+ except (AttributeError, KeyError):
+ pass
+ __captionSet(val)
else:
self._properties["Caption"] = val
_______________________________________________
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]