dabo Commit
Revision 4254
Date: 2008-07-08 14:03:07 -0700 (Tue, 08 Jul 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4254
Changed:
U trunk/dabo/ui/uiwx/dMenu.py
Log:
Fixed dMenu.Enabled to work properly. I assume that referencing or
assigning menu.Enabled has never worked correctly. I also expect
there to be situations where this commit will cause tracebacks, such
as an AttributeError on _wxMenuItemId, or a Parent of None, but I'd
like to see that happen before catching them.
Thanks Nate Lowrie for catching this problem.
Diff:
Modified: trunk/dabo/ui/uiwx/dMenu.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenu.py 2008-07-08 20:34:06 UTC (rev 4253)
+++ trunk/dabo/ui/uiwx/dMenu.py 2008-07-08 21:03:07 UTC (rev 4254)
@@ -408,6 +408,8 @@
"""
## MenuOpen and MenuClose don't appear to be working on Linux.
Need
## to test on Mac and Win.
+ self._wxMenuItemId = id_
+
if self.Application is not None:
# Set up a mechanism to catch menu events and re-raise
Dabo events.
# If Application is None, however, this won't work
because of wx
@@ -487,11 +489,11 @@
def _getEnabled(self):
- return self.IsEnabled()
+ return self.Parent.IsEnabled(self._wxMenuItemId)
def _setEnabled(self, val):
if self._constructed():
- self.Enable(bool(val))
+ self.Parent.Enable(self._wxMenuItemId, bool(val))
else:
self._properties["Enabled"] = 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]