Don't set the id parameter default to wx.ID_ANY if there is a default.

This commit is contained in:
Robin Dunn
2016-08-02 10:50:07 -07:00
parent 3f4646c7cd
commit 054067ae71
2 changed files with 5 additions and 2 deletions

View File

@@ -239,7 +239,7 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True):
parent.transferThis = True
# if there is an id param give it a default
id = func.findItem('id') or func.findItem('winid')
if id:
if id and not id.default:
id.default = 'wxID_ANY'
# if there is a pos or size parameter without a default then give it one.

View File

@@ -13,7 +13,10 @@ class cshelp_Tests(wtc.WidgetTestCase):
pnl = wx.Panel(self.frame)
pnl.SetHelpText("HelpMe!")
cBtn = wx.ContextHelpButton(pnl)
# Make sure we haven't borked the magic ID
assert cBtn.GetId() == wx.ID_CONTEXT_HELP
def test_cshelp2(self):
wx.wxEVT_HELP