Changeset 4254

Show
Ignore:
Timestamp:
07/08/2008 02:03:07 PM (2 months ago)
Author:
paul
Message:

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.


Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dMenu.py

    r4186 r4254  
    409409        ## MenuOpen and MenuClose don't appear to be working on Linux. Need 
    410410        ## to test on Mac and Win. 
     411        self._wxMenuItemId = id_ 
     412 
    411413        if self.Application is not None: 
    412414            # Set up a mechanism to catch menu events and re-raise Dabo events.  
     
    488490 
    489491    def _getEnabled(self): 
    490         return self.IsEnabled(
     492        return self.Parent.IsEnabled(self._wxMenuItemId
    491493 
    492494    def _setEnabled(self, val): 
    493495        if self._constructed(): 
    494             self.Enable(bool(val)) 
     496            self.Parent.Enable(self._wxMenuItemId, bool(val)) 
    495497        else: 
    496498            self._properties["Enabled"] = val