Ticket #1136 (new defect)

Opened 3 months ago

Enabled property in context menu not working

Reported by: nate Assigned to: somebody
Priority: critical Milestone: 0.8.3
Component: ui Version: 0.8.2
Keywords: Cc:

Description

I have problems with the Enabled property on a menuitem in a popup. I created the script below to test and the enable doesn't work. Can someone verify?

import dabo
dabo.ui.loadUI('wx')

class mainForm(dabo.ui.dForm):
       def afterInit(self):
               self.bindEvent(dabo.dEvents.MouseRightClick, self.onRightClick)

       def initProperties(self):
               self.Size=(300,300)

       def onRightClick(self, evt):
               popupMenu = dabo.ui.dMenu(self)
               popupMenu.append("Menu1", OnHit=self.onMenu)
               popupMenu.append("Menu2", OnHit=self.onMenu, Enabled=False)

               self.showContextMenu(popupMenu)

       def onMenu(self, evt):
               print "Menu Hit"

app = dabo.dApp()
app.MainFormClass = mainForm
app.start()

Version information:

Platform: Win
Python Version: 2.5.1 on win32
Dabo Version: Version 0.8.3; Revision 3900
UI Version: 2.8.7.1 on wxMSW

Paul had this to say:

Bind to dabo.dEvents.ContextMenu? instead of RightClick?. This gets your menu working on Mac, too.

But that doesn't solve the problem. Here's my observed behavior:

Mac: menu2 is disabled
Linux: menu2 is enabled
Win: menu2 is enabled