dabo Commit
Revision 2982
Date: 2007-03-25 14:00:01 -0700 (Sun, 25 Mar 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/2982
Changed:
U trunk/dabo/ui/uiwx/dFont.py
U trunk/dabo/ui/uiwx/dPemMixin.py
Log:
Modified dPemMixin to also update Dynamic props when the object is resized.
Previously properties such as DynamicWidth didn't get updated when the user
resized the form or splitter window.
Added an exception handler for dFont._setFontSize(). In some cases I was
getting error messages about not being able to modify a native font on OS X.
Diff:
Modified: trunk/dabo/ui/uiwx/dFont.py
===================================================================
--- trunk/dabo/ui/uiwx/dFont.py 2007-03-25 20:37:20 UTC (rev 2981)
+++ trunk/dabo/ui/uiwx/dFont.py 2007-03-25 21:00:01 UTC (rev 2982)
@@ -73,7 +73,10 @@
if self._useMacFontScaling():
self._macNonScaledSize = val
val = val / .75
- self._nativeFont.SetPointSize(val)
+ try:
+ self._nativeFont.SetPointSize(val)
+ except:
+ dabo.errorLog.write(_("Setting FontSize to %s failed")
% val)
self._propsChanged()
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2007-03-25 20:37:20 UTC (rev 2981)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2007-03-25 21:00:01 UTC (rev 2982)
@@ -379,6 +379,7 @@
try:
self.Parent.bindEvent(dEvents.Update, self.__onUpdate)
+ self.Parent.bindEvent(dEvents.Resize, self.__onResize)
except:
## pkm: I don't think we want to bind this to self,
because then you
## will have recursion in the event handling. We
are either a form
@@ -1075,12 +1076,19 @@
def __onUpdate(self, evt):
- """Update any dynamic properties, and then call the refresh()
hook."""
+ """Update any dynamic properties, and then call the update()
hook."""
if isinstance(self, dabo.ui.deadObject) or not
self._constructed():
return
self.update()
+ def __onResize(self, evt):
+ """Update any dynamic properties."""
+ if not self or not self._constructed():
+ return
+ self.__updateDynamicProps()
+
+
def update(self):
"""Update the properties of this object and all contained
objects."""
if isinstance(self, dabo.ui.deadObject):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev