diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index 9596eadc..1b99145a 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -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. diff --git a/unittests/test_cshelp.py b/unittests/test_cshelp.py index 6eb6910a..bb4e4600 100644 --- a/unittests/test_cshelp.py +++ b/unittests/test_cshelp.py @@ -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