diff --git a/etg/bmpcbox.py b/etg/bmpcbox.py index 5cfa6d41..9e2efa1c 100644 --- a/etg/bmpcbox.py +++ b/etg/bmpcbox.py @@ -44,6 +44,18 @@ def run(): # that both of those classes have in common. c.bases = ['wxControl', 'wxTextEntry', 'wxItemContainer'] + # Copy any method definitions from wx.ComboBox that are not declared here + import combobox + mod = combobox.parseAndTweakModule() + klass = mod.find('wxComboBox') + items = [item for item in klass.items if isinstance(item, etgtools.MethodDef) and + not item.isCtor and + not item.isDtor and + not item.ignored and + not c.findItem(item.name)] + c.items.extend(items) + #print([i.name for i in items]) + c.find('GetCurrentSelection').ignore() # Ignore the old C array verison of the ctor and Create methods, and # fixup the remaining ctor and Create with the typical default values for @@ -67,15 +79,10 @@ def run(): c.find('Append').findOverload('wxClientData *').find('clientData').transfer = True c.find('Insert').findOverload('wxClientData *').find('clientData').transfer = True - - # wxItemContainer pure virtuals that have an implementation in this class + # We need to disambiguate GetStringSelection since it is implemented in + # multiple base classes + c.find('GetStringSelection').ignore() c.addItem(etgtools.WigCode("""\ - virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - virtual int GetSelection() const; - virtual void SetSelection(int n); - virtual wxString GetStringSelection() const; %MethodCode sipRes = new wxString(sipCpp->wxItemContainerImmutable::GetStringSelection()); diff --git a/etg/combobox.py b/etg/combobox.py index af27832f..d78cc3bd 100644 --- a/etg/combobox.py +++ b/etg/combobox.py @@ -23,7 +23,7 @@ ITEMS = [ 'wxComboBox' ] #--------------------------------------------------------------------------- -def run(): +def parseAndTweakModule(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) etgtools.parseDoxyXML(module, ITEMS) @@ -73,8 +73,12 @@ def run(): c.addPyCode("ComboBox.GetMark = wx.deprecated(ComboBox.GetTextSelection, 'Use GetTextSelection instead.')") module.addGlobalStr('wxComboBoxNameStr', c) + return module - #----------------------------------------------------------------- +#----------------------------------------------------------------- + +def run(): + module = parseAndTweakModule() tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etgtools/extractors.py b/etgtools/extractors.py index b089001c..ff04cd6b 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -601,6 +601,10 @@ class MethodDef(FunctionDef): self.ignore() + def setVirtualCatcherCode(self, code): + """ + """ + self.virtualCatcherCode = code #---------------------------------------------------------------------------