diff --git a/etg/aboutdlg.py b/etg/aboutdlg.py index 18842fcb..385fc337 100644 --- a/etg/aboutdlg.py +++ b/etg/aboutdlg.py @@ -33,11 +33,16 @@ def run(): module.addHeaderCode('#include ') + for funcname in ['wxAboutBox', + 'wxGenericAboutBox', + ]: + c = module.find(funcname) + c.mustHaveApp() + c = module.find('wxAboutDialogInfo') assert isinstance(c, etgtools.ClassDef) - #----------------------------------------------------------------- tools.doCommonTweaks(module) # Add some aliases for the non-UK spelling diff --git a/etg/artprov.py b/etg/artprov.py index 2e41b754..964b745a 100644 --- a/etg/artprov.py +++ b/etg/artprov.py @@ -34,8 +34,9 @@ def run(): c = module.find('wxArtProvider') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() - # These are protrected and so they are ignored by default. Unignore them. + # These are protected and so they are ignored by default. Unignore them. c.find('CreateBitmap').ignore(False) c.find('CreateIconBundle').ignore(False) diff --git a/etg/bitmap.py b/etg/bitmap.py index 0acd8053..94da11cd 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -37,8 +37,12 @@ def run(): # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. + c = module.find('wxMask') + c.mustHaveApp() + c = module.find('wxBitmap') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() tools.removeVirtuals(c) diff --git a/etg/brush.py b/etg/brush.py index 50c1ba71..0ed0fef3 100644 --- a/etg/brush.py +++ b/etg/brush.py @@ -34,6 +34,7 @@ def run(): c = module.find('wxBrush') assert isinstance(c, etgtools.ClassDef) tools.removeVirtuals(c) + c.mustHaveApp() c.addCppMethod('int', '__nonzero__', '()', """\ return self->IsOk(); diff --git a/etg/choicdlg.py b/etg/choicdlg.py index fa1b3b28..c444d881 100644 --- a/etg/choicdlg.py +++ b/etg/choicdlg.py @@ -86,6 +86,19 @@ def run(): func.ignore() + for c in module.find('wxGetSingleChoiceIndex').all(): + c.mustHaveApp() + + for c in module.find('wxGetSingleChoice').all(): + c.mustHaveApp() + + for c in module.find('wxGetSingleChoiceData').all(): + c.mustHaveApp() + + + #c = module.find('wxGetSingleChoiceIndex') + #c.mustHaveApp() + #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/clipbrd.py b/etg/clipbrd.py index 78ed26b0..f5950039 100644 --- a/etg/clipbrd.py +++ b/etg/clipbrd.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxClipboard') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() c.find('AddData.data').transfer = True c.find('SetData.data').transfer = True diff --git a/etg/colordlg.py b/etg/colordlg.py index e14e8888..5a07e9db 100644 --- a/etg/colordlg.py +++ b/etg/colordlg.py @@ -39,6 +39,11 @@ def run(): tools.fixTopLevelWindowClass(c) + c = module.find('wxGetColourFromUser') + c.mustHaveApp() + + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/colour.py b/etg/colour.py index 5770b1eb..be3f4dd1 100644 --- a/etg/colour.py +++ b/etg/colour.py @@ -66,6 +66,7 @@ def run(): c = module.find('wxColour') assert isinstance(c, etgtools.ClassDef) tools.removeVirtuals(c) + c.mustHaveApp() # Hide the string ctor so our typemap will be invoked for the copy ctor instead. c.find('wxColour').findOverload('wxString').ignore() diff --git a/etg/config.py b/etg/config.py index 4ba2c23b..ed5d65e9 100644 --- a/etg/config.py +++ b/etg/config.py @@ -36,6 +36,7 @@ def run(): c = module.find('wxConfigBase') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() c.abstract = True ctor = c.find('wxConfigBase') @@ -161,6 +162,7 @@ def run(): #----------------------------------------------------------------- c = module.find('wxFileConfig') + c.mustHaveApp() c.addPrivateCopyCtor() c.find('wxFileConfig').findOverload('wxInputStream').find('conv').ignore() ctor = c.find('wxFileConfig').findOverload('wxString').find('conv').ignore() diff --git a/etg/cshelp.py b/etg/cshelp.py index b4ac7bbe..b5a8fa34 100644 --- a/etg/cshelp.py +++ b/etg/cshelp.py @@ -44,15 +44,21 @@ def run(): c.abstract = True c.find('Set').transferBack = True c.find('Set.helpProvider').transfer = True + c.mustHaveApp() c = module.find('wxSimpleHelpProvider') c.addItem(etgtools.WigCode("virtual wxString GetHelp(const wxWindowBase* window);")) + c.mustHaveApp() c = module.find('wxHelpControllerHelpProvider') c.addPrivateCopyCtor() + c.mustHaveApp() + c = module.find('wxContextHelp') + c.mustHaveApp() + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/cursor.py b/etg/cursor.py index af8c3633..5674bade 100644 --- a/etg/cursor.py +++ b/etg/cursor.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxCursor') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() c.find('wxCursor').findOverload('bits').ignore() c.find('wxCursor').findOverload('cursorName').find('type').default='wxBITMAP_TYPE_ANY' diff --git a/etg/dc.py b/etg/dc.py index 69853955..4d1fc7d4 100644 --- a/etg/dc.py +++ b/etg/dc.py @@ -44,6 +44,7 @@ def run(): c = module.find('wxDC') assert isinstance(c, etgtools.ClassDef) + c.mustHaveApp() c.addPrivateCopyCtor() c.addPublic() @@ -449,10 +450,6 @@ def run(): - # TODO: Port the PseudoDC from Classic - - - #----------------------------------------------------------------- c = module.find('wxDCClipper') assert isinstance(c, etgtools.ClassDef) diff --git a/etg/dcbuffer.py b/etg/dcbuffer.py index 7a854763..4788e9ea 100644 --- a/etg/dcbuffer.py +++ b/etg/dcbuffer.py @@ -37,6 +37,8 @@ def run(): c = module.find('wxBufferedDC') c.addPrivateCopyCtor() + c.mustHaveApp() + for m in c.find('wxBufferedDC').all() + c.find('Init').all(): if m.findItem('dc'): m.findItem('dc').keepReference = True @@ -45,6 +47,8 @@ def run(): c = module.find('wxBufferedPaintDC') + c.mustHaveApp() + c.addPrivateCopyCtor() c.find('wxBufferedPaintDC').findOverload('wxBitmap').find('buffer').keepReference = True @@ -54,6 +58,8 @@ def run(): # static_cast<> to one of the buffered DCs, so we'll change the base class # here to more truly adhere to reality. c = module.find('wxAutoBufferedPaintDC') + c.mustHaveApp() + c.addPrivateCopyCtor() c.bases = ['wxPaintDC'] diff --git a/etg/dcclient.py b/etg/dcclient.py index 97f3f2de..aa9321c2 100644 --- a/etg/dcclient.py +++ b/etg/dcclient.py @@ -36,12 +36,15 @@ def run(): c = module.find('wxPaintDC') c.addPrivateCopyCtor() + c.mustHaveApp() c = module.find('wxClientDC') c.addPrivateCopyCtor() + c.mustHaveApp() c = module.find('wxWindowDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcgraph.py b/etg/dcgraph.py index b1a59d55..53724c9b 100644 --- a/etg/dcgraph.py +++ b/etg/dcgraph.py @@ -32,6 +32,7 @@ def run(): c = module.find('wxGCDC') + c.mustHaveApp() # FIXME: Do we handle platform-specific classes, and if so, how? c.find('wxGCDC').findOverload('wxEnhMetaFileDC').ignore() c.addPrivateCopyCtor() diff --git a/etg/dcmemory.py b/etg/dcmemory.py index 014274a0..0f116073 100644 --- a/etg/dcmemory.py +++ b/etg/dcmemory.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxMemoryDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcmirror.py b/etg/dcmirror.py index 38a7fa96..59cab868 100644 --- a/etg/dcmirror.py +++ b/etg/dcmirror.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxMirrorDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcprint.py b/etg/dcprint.py index 828a80be..90443042 100644 --- a/etg/dcprint.py +++ b/etg/dcprint.py @@ -34,6 +34,7 @@ def run(): c = module.find('wxPrinterDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcps.py b/etg/dcps.py index 27b0aa85..6b910573 100644 --- a/etg/dcps.py +++ b/etg/dcps.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxPostScriptDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcscreen.py b/etg/dcscreen.py index 0f90c445..6e0548bc 100644 --- a/etg/dcscreen.py +++ b/etg/dcscreen.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxScreenDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dcsvg.py b/etg/dcsvg.py index 5187dcf7..1b35e886 100644 --- a/etg/dcsvg.py +++ b/etg/dcsvg.py @@ -33,6 +33,7 @@ def run(): c = module.find('wxSVGFileDC') c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- diff --git a/etg/dirdlg.py b/etg/dirdlg.py index c709299f..655d2ddd 100644 --- a/etg/dirdlg.py +++ b/etg/dirdlg.py @@ -38,6 +38,9 @@ def run(): module.find('wxDirSelectorPromptStr').ignore() + c = module.find('wxDirSelector') + c.mustHaveApp() + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/display.py b/etg/display.py index 796ac443..72e674c2 100644 --- a/etg/display.py +++ b/etg/display.py @@ -36,6 +36,7 @@ def run(): assert isinstance(c, etgtools.ClassDef) c.addPrivateAssignOp() c.addPrivateCopyCtor() + c.mustHaveApp() c.addProperty('ClientArea GetClientArea') @@ -44,6 +45,7 @@ def run(): c.addProperty('Name GetName') + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/dragimag.py b/etg/dragimag.py index 011b851d..e2db9184 100644 --- a/etg/dragimag.py +++ b/etg/dragimag.py @@ -34,6 +34,7 @@ def run(): di = module.find('wxDragImage') assert isinstance(di, etgtools.ClassDef) + di.mustHaveApp() # make a copy and rename it to 'wxGenericDragImage' gdi = tools.copyClassDef(di, 'wxGenericDragImage') diff --git a/etg/filedlg.py b/etg/filedlg.py index 7d4f8ede..006c434d 100644 --- a/etg/filedlg.py +++ b/etg/filedlg.py @@ -69,6 +69,16 @@ def run(): tools.fixTopLevelWindowClass(c) + + for funcname in ['wxFileSelector', + 'wxFileSelectorEx', + 'wxLoadFileSelector', + 'wxSaveFileSelector', + ]: + c = module.find(funcname) + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/font.py b/etg/font.py index 6bb630e8..ea4a5661 100644 --- a/etg/font.py +++ b/etg/font.py @@ -36,6 +36,7 @@ def run(): c = module.find('wxFont') assert isinstance(c, etgtools.ClassDef) tools.removeVirtuals(c) + c.mustHaveApp() # FFont factory function for backwards compatibility module.addCppFunction('wxFont*', 'FFont', @@ -63,7 +64,7 @@ def run(): c.addProperty('Style GetStyle SetStyle') c.addProperty('Weight GetWeight SetWeight') - # TODO, there is now a Underlined method so we can't have a + # TODO, there is now an Underlined method so we can't have a # property of the same name. #c.addProperty('Underlined GetUnderlined SetUnderlined') #c.addProperty('Strikethrough GetStrikethrough SetStrikethrough') diff --git a/etg/fontdlg.py b/etg/fontdlg.py index ee62a73d..52ce1214 100644 --- a/etg/fontdlg.py +++ b/etg/fontdlg.py @@ -41,6 +41,11 @@ def run(): # there are two of these, ignore one of them c.find('GetFontData').ignore() + + c = module.find('wxGetFontFromUser') + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/fontenum.py b/etg/fontenum.py index 20f4622d..4e0485bb 100644 --- a/etg/fontenum.py +++ b/etg/fontenum.py @@ -34,6 +34,7 @@ def run(): c = module.find('wxFontEnumerator') assert isinstance(c, etgtools.ClassDef) c.addPrivateCopyCtor() + c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/frame.py b/etg/frame.py index ce33fa01..14827404 100644 --- a/etg/frame.py +++ b/etg/frame.py @@ -17,7 +17,7 @@ DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by # this script. -ITEMS = [ 'wxFrame' ] +ITEMS = [ 'wxFrame' ] #--------------------------------------------------------------------------- @@ -25,14 +25,14 @@ def run(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) etgtools.parseDoxyXML(module, ITEMS) - + #----------------------------------------------------------------- # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. - + c = module.find('wxFrame') assert isinstance(c, etgtools.ClassDef) - + c.find('wxFrame.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' diff --git a/etg/gdicmn.py b/etg/gdicmn.py index 15dd9a9f..de9034a0 100644 --- a/etg/gdicmn.py +++ b/etg/gdicmn.py @@ -357,6 +357,20 @@ def run(): """ ) + + for funcname in ['wxColourDisplay', + 'wxDisplayDepth', + 'wxDisplaySize', + 'wxGetDisplaySize', + 'wxDisplaySizeMM', + 'wxGetDisplaySizeMM', + 'wxGetDisplayPPI', + 'wxClientDisplayRect', + 'wxGetClientDisplayRect', + ]: + c = module.find(funcname) + c.mustHaveApp() + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/msgdlg.py b/etg/msgdlg.py index 1c7fb8ea..1083c35d 100644 --- a/etg/msgdlg.py +++ b/etg/msgdlg.py @@ -83,6 +83,10 @@ def run(): module.find('wxMessageBox').releaseGIL() + c = module.find('wxMessageBox') + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/textdlg.py b/etg/textdlg.py index 6bf8e58f..400c65ff 100644 --- a/etg/textdlg.py +++ b/etg/textdlg.py @@ -53,6 +53,13 @@ def run(): tools.fixTopLevelWindowClass(c) + c = module.find('wxGetPasswordFromUser') + c.mustHaveApp() + + c = module.find('wxGetTextFromUser') + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/tipdlg.py b/etg/tipdlg.py index eec402b7..b6995b6a 100644 --- a/etg/tipdlg.py +++ b/etg/tipdlg.py @@ -34,6 +34,13 @@ def run(): module.addHeaderCode('#include ') module.find('wxCreateFileTipProvider').factory = True + c = module.find('wxCreateFileTipProvider') + c.mustHaveApp() + + c = module.find('wxShowTip') + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/utils.py b/etg/utils.py index afcef0be..1f389b17 100644 --- a/etg/utils.py +++ b/etg/utils.py @@ -71,11 +71,23 @@ def run(): module.find('wxGetOsVersion.minor').out = True c = module.find('wxBusyCursor') + c.mustHaveApp() # add context manager methods c.addPyMethod('__enter__', '(self)', 'return self') c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'pass') + for funcname in ['wxBell', + 'wxBeginBusyCursor', + 'wxEndBusyCursor', + 'wxShutdown', + 'wxInfoMessageBox', + 'wxIsBusy', + ]: + c = module.find(funcname) + c.mustHaveApp() + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)