dabo Commit
Revision 1385
Date: 2005-09-27 12:37:10 -0700 (Tue, 27 Sep 2005)
Author: paul
Changed:
U trunk/dabo/ui/dDataControlMixinBase.py
U trunk/dabo/ui/uiwx/dPemMixin.py
Log:
Moved the raising of the Create event to the absolute end of the init cycle.
This ensures that user code isn't reacting to the Create event before the
init cycle is actually over.
Modified the save/restore value code to use the object's RegID if present,
instead of its absolute hierarchical name.
Diff:
Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py 2005-09-27 14:10:43 UTC (rev
1384)
+++ trunk/dabo/ui/dDataControlMixinBase.py 2005-09-27 19:37:10 UTC (rev
1385)
@@ -209,14 +209,20 @@
# has already released the C++ part of the object).
value = self._value
if self.Application:
- name = self.getAbsoluteName()
+ if self.RegID:
+ name = "%s.%s" % (self.Form.Name, self.RegID)
+ else:
+ name = self.getAbsoluteName()
self.Application.setUserSetting("%s.Value" % name,
value)
def restoreValue(self):
""" Set the control's value to the value in dApp's user
settings table."""
if self.Application:
- name = self.getAbsoluteName()
+ if self.RegID:
+ name = "%s.%s" % (self.Form.Name, self.RegID)
+ else:
+ name = self.getAbsoluteName()
value = self.Application.getUserSetting("%s.Value" %
name)
if value is not None:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2005-09-27 14:10:43 UTC (rev 1384)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2005-09-27 19:37:10 UTC (rev 1385)
@@ -136,6 +136,10 @@
super(dPemMixin, self).__init__(*args, **kwargs)
+ # Finally, at the end of the init cycle, raise the Create event
+ self.raiseEvent(dEvents.Create)
+
+
def _constructed(self):
"""Returns True if the ui object has been fully created yet,
False otherwise."""
try:
@@ -186,9 +190,6 @@
self.afterInit()
- # Raise the Create event, in case someone wants to bind to
that...
- self.raiseEvent(dEvents.Create)
-
def _preInitUI(self, kwargs):
"""Subclass hook. Some wx objects (RadioBox) need certain props
forced if
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev