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('wxDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxDialogNameStr', c) c.find('wxDialog.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' # PocketPC only, don't think we'll need these ;) c.find('DoOK').ignore() c.find('GetToolBar').ignore() # Release the GIL for potentially blocking or long-running functions c.find('ShowModal').releaseGIL() # context manager methods c.addPyMethod('__enter__', '(self)', 'return self') c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'self.Destroy()') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMessageDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxMessageBoxCaptionStr', c) # Several of the wxMessageDIalog methods take a # wxMessageDialog::ButtonLabel parameter, which enables either a string or # a Stock ID to be passed. To facilitate this same ability for Python the # SIP types are changed to a custom type which is a MappedType which # handles converting from the two types for us. See msgdlg_btnlabel.sip c.find('ButtonLabel').ignore() for item in c.allItems(): if isinstance(item, ParamDef) and item.type == 'const ButtonLabel &': item.type = 'const wxMessageDialogButtonLabel &' tools.fixTopLevelWindowClass(c) # Make a copy of wxMessageDialog so we can generate code for # wxGenericMessageDialog too. gmd = copy.deepcopy(c) assert isinstance(gmd, etgtools.ClassDef) gmd.name = 'wxGenericMessageDialog' gmd.find('wxMessageDialog').name = 'wxGenericMessageDialog' # the ctor m = gmd.addItem(etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogCheckBox', briefDoc="Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) m = gmd.addItem(etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogDetails', briefDoc="Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) module.addItem(gmd) module.find('wxMessageBox').releaseGIL() c = module.find('wxMessageBox') c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/textdlg.h>") module.find('wxGetTextFromUserPromptStr').ignore() module.find('wxGetPasswordFromUserPromptStr').ignore() c = module.find('wxTextEntryDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) # We don't wrap wxTextValidator for m in c.find('SetTextValidator').all(): m.ignore() module.addGlobalStr('wxGetTextFromUserPromptStr', c) module.addGlobalStr('wxGetPasswordFromUserPromptStr', c) c = module.find('wxPasswordEntryDialog') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMDIClientWindow') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateClient').isVirtual = True c = module.find('wxMDIParentFrame') tools.fixTopLevelWindowClass(c) c.find('OnCreateClient').isVirtual = True m = c.find('GetClientWindow') assert isinstance(m, etgtools.MethodDef) m.type = 'wxMDIClientWindow *' m.setCppCode( "return static_cast<wxMDIClientWindow*>(self->GetClientWindow());") c = module.find('wxMDIChildFrame') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/textdlg.h>") module.find('wxGetTextFromUserPromptStr').ignore() module.find('wxGetPasswordFromUserPromptStr').ignore() c = module.find('wxTextEntryDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) # We don't wrap wxTextValidator for m in c.find('SetTextValidator').all(): m.ignore() module.addGlobalStr('wxGetTextFromUserPromptStr', c) module.addGlobalStr('wxGetPasswordFromUserPromptStr', c) c = module.find('wxPasswordEntryDialog') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/colordlg.h>") c = module.find('wxColourDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c = module.find('wxGetColourFromUser') c.mustHaveApp() c = module.find('wxColourDialogEvent') tools.fixEventClass(c) module.addPyCode("""\ EVT_COLOUR_CHANGED = PyEventBinder(wxEVT_COLOUR_CHANGED, 1) """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxAuiMDIParentFrame') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c.find('SetMenuBar.menuBar').transfer = True c.find('SetArtProvider.provider').transfer = True c = module.find('wxAuiMDIChildFrame') tools.fixTopLevelWindowClass(c) tools.fixSetStatusWidths(c.find('SetStatusWidths')) c.find('SetMenuBar.menuBar').transfer = True c.find('Show').isVirtual = True c = module.find('wxAuiMDIClientWindow') tools.fixWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxFileDialog') isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxFileDialogNameStr', c) module.find('wxFileSelectorDefaultWildcardStr').ignore() # TODO: add this back. We'll need a way to pass it a callable that can be # called from a C ExtraControlCreatorFunction function c.find('SetExtraControlCreator').ignore() c.find('ExtraControlCreatorFunction').ignore() c.find('GetFilenames').ignore() c.addCppMethod('wxArrayString*', 'GetFilenames', '()', doc="""\ Returns a list of filenames chosen in the dialog. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetFilename for the others.""", body="""\ wxArrayString* arr = new wxArrayString; self->GetFilenames(*arr); return arr;""", factory=True) c.find('GetPaths').ignore() c.addCppMethod('wxArrayString*', 'GetPaths', '()', doc="""\ Returns a list of the full paths of the files chosen. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetPath for the others. """, body="""\ wxArrayString* arr = new wxArrayString; self->GetPaths(*arr); return arr;""", factory=True) tools.fixTopLevelWindowClass(c) for funcname in ['wxFileSelector', 'wxFileSelectorEx', 'wxLoadFileSelector', 'wxSaveFileSelector', ]: c = module.find(funcname) c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxFindDialogEvent') assert isinstance(c, etgtools.ClassDef) tools.fixEventClass(c) module.addPyCode("""\ EVT_FIND = wx.PyEventBinder( wxEVT_FIND, 1 ) EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_FIND_NEXT, 1 ) EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_FIND_REPLACE, 1 ) EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_FIND_REPLACE_ALL, 1 ) EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_FIND_CLOSE, 1 ) # deprecated wxEVT aliases wxEVT_COMMAND_FIND = wxEVT_FIND wxEVT_COMMAND_FIND_NEXT = wxEVT_FIND_NEXT wxEVT_COMMAND_FIND_REPLACE = wxEVT_FIND_REPLACE wxEVT_COMMAND_FIND_REPLACE_ALL = wxEVT_FIND_REPLACE_ALL wxEVT_COMMAND_FIND_CLOSE = wxEVT_FIND_CLOSE """) c = module.find('wxFindReplaceDialog') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/colordlg.h>") c = module.find('wxColourDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c = module.find('wxGetColourFromUser') c.mustHaveApp() c = module.find('wxColourDialogEvent') tools.fixEventClass(c) module.addPyCode("""\ EVT_COLOUR_CHANGED = PyEventBinder(wxEVT_COLOUR_CHANGED, 1) """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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' c.find('SetMenuBar.menuBar').transfer = True # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. tools.fixSetStatusWidths(c.find('SetStatusWidths')) c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True c.find('DoGiveHelp').isVirtual = True # TODO: support this c.find('MSWGetTaskBarButton').ignore() #c.addCppMethod('wxTaskBarButton*', 'MSWGetTaskBarButton', '()', # doc="""\ # MSW-specific function for accessing the taskbar button under Windows 7 or later. # # Returns a :class:`wx.TaskBarButton` pointer representing the taskbar button of the # window under Windows 7 or later. The returned ``wx.TaskBarButton`` may be # used, if not ``None``, to access the functionality including thumbnail # representations, thumbnail toolbars, notification and status overlays, # and progress indicators. # # This method will raise a ``NotImplemetedError`` on platforms other than MSW. # """, # body="""\ # #ifdef __WXMSW__ # return self->MSWGetTaskBarButton(); # #else # wxPyRaiseNotImplemented(); # return NULL; # #endif # """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/dirctrl.h>") c = module.find('wxGenericDirCtrl') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c.find('GetPaths').ignore() c.addCppMethod('wxArrayString*', 'GetPaths', '()', pyArgsString="() -> list", doc='Returns a list of the currently selected paths.', body="""\ wxArrayString* paths = new wxArrayString; self->GetPaths(*paths); return paths; """) module.addPyCode("""\ EVT_DIRCTRL_SELECTIONCHANGED = wx.PyEventBinder( wxEVT_DIRCTRL_SELECTIONCHANGED, 1 ) EVT_DIRCTRL_FILEACTIVATED = wx.PyEventBinder( wxEVT_DIRCTRL_FILEACTIVATED, 1 ) """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMDIClientWindow') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateClient').isVirtual = True c = module.find('wxMDIParentFrame') tools.fixTopLevelWindowClass(c) c.find('OnCreateClient').isVirtual = True m = c.find('GetClientWindow') assert isinstance(m, etgtools.MethodDef) m.type = 'wxMDIClientWindow *' m.setCppCode("return static_cast<wxMDIClientWindow*>(self->GetClientWindow());") c = module.find('wxMDIChildFrame') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/fontdlg.h>') c = module.find('wxFontDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) # 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)
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('wxDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxDialogNameStr', c) c.find('wxDialog.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' # PocketPC only, don't think we'll need these ;) c.find('DoOK').ignore() c.find('GetToolBar').ignore() # Release the GIL for potentially blocking or long-running functions c.find('ShowModal').releaseGIL() # context manager methods c.addPyMethod('__enter__', '(self)', 'return self') c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'self.Destroy()') tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxFileDialog') isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxFileDialogNameStr', c) module.find('wxFileSelectorDefaultWildcardStr').ignore() # TODO: add this back. We'll need a way to pass it a callable that can be # called from a C ExtraControlCreatorFunction function c.find('SetExtraControlCreator').ignore() c.find('ExtraControlCreatorFunction').ignore() c.find('GetFilenames').ignore() c.addCppMethod('wxArrayString*', 'GetFilenames', '()', doc="""\ Returns a list of filenames chosen in the dialog. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetFilename for the others.""", body="""\ wxArrayString* arr = new wxArrayString; self->GetFilenames(*arr); return arr;""", factory=True) c.find('GetPaths').ignore() c.addCppMethod('wxArrayString*', 'GetPaths', '()', doc="""\ Returns a list of the full paths of the files chosen. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetPath for the others. """, body="""\ wxArrayString* arr = new wxArrayString; self->GetPaths(*arr); return arr;""", factory=True) tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. # Let the generator know about these intermediate classes even though they # are undocumented. wxTDIChildFrame is used elsewhere in the class hierarchy # so it needs to be available. module.insertItemBefore( module.find('wxMDIClientWindow'), etgtools.WigCode("""\ class wxMDIChildFrameBase : wxFrame { public: wxMDIChildFrameBase(); virtual void Activate() = 0; wxMDIParentFrame *GetMDIParent() const; virtual bool IsTopLevel() const; }; class wxTDIChildFrame : wxMDIChildFrameBase /Abstract/ { public: }; """)) c = module.find('wxMDIClientWindow') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateClient').isVirtual = True c = module.find('wxMDIParentFrame') tools.fixTopLevelWindowClass(c) c.find('OnCreateClient').isVirtual = True m = c.find('GetClientWindow') assert isinstance(m, etgtools.MethodDef) m.type = 'wxMDIClientWindow *' m.setCppCode( "return static_cast<wxMDIClientWindow*>(self->GetClientWindow());") c = module.find('wxMDIChildFrame') c.bases = ['wxMDIChildFrameBase'] tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. # Let the generator know about these intermediate classes even though they # are undocumented. wxTDIChildFrame is used elsewhere in the class hiearchy # so it needs to be available. module.insertItemBefore(module.find('wxMDIClientWindow'), etgtools.WigCode("""\ class wxMDIChildFrameBase : wxFrame { public: wxMDIChildFrameBase(); virtual void Activate() = 0; wxMDIParentFrame *GetMDIParent() const; virtual bool IsTopLevel() const; }; class wxTDIChildFrame : wxMDIChildFrameBase /Abstract/ { public: }; """)) c = module.find('wxMDIClientWindow') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateClient').isVirtual = True c = module.find('wxMDIParentFrame') tools.fixTopLevelWindowClass(c) c.find('OnCreateClient').isVirtual = True m = c.find('GetClientWindow') assert isinstance(m, etgtools.MethodDef) m.type = 'wxMDIClientWindow *' m.setCppCode("return static_cast<wxMDIClientWindow*>(self->GetClientWindow());") c = module.find('wxMDIChildFrame') c.bases = ['wxMDIChildFrameBase'] tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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' c.find('SetMenuBar.menuBar').transfer = True # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. m = c.find('SetStatusWidths') m.find('n').ignore() m.find('widths_field').type = 'const wxArrayInt&' m.find('widths_field').name = 'widths' m.argsString = '(int n, const wxArrayInt& widths)' m.setCppCode("""\ const int* ptr = &widths->front(); self->SetStatusWidths(widths->size(), ptr); """) # provisionally ignore new features features in 3.1.0 c.find("MSWGetTaskBarButton").ignore() # missing wxTaskBarButton c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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' c.find('SetMenuBar.menuBar').transfer = True # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. m = c.find('SetStatusWidths') m.find('n').ignore() m.find('widths_field').type = 'const wxArrayInt&' m.find('widths_field').name = 'widths' m.argsString = '(int n, const wxArrayInt& widths)' m.setCppCode("""\ const int* ptr = &widths->front(); self->SetStatusWidths(widths->size(), ptr); """) # provisionally ignore new features features in 3.1.0 c.find("MSWGetTaskBarButton").ignore(); # missing wxTaskBarButton c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxSymbolPickerDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/rearrangectrl.h>') c = module.find('wxRearrangeList') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeList.order').default = 'wxArrayInt()' c.find('wxRearrangeList.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' module.addGlobalStr('wxRearrangeListNameStr', c) module.addGlobalStr('wxRearrangeDialogNameStr', c) c = module.find('wxRearrangeCtrl') tools.fixWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeCtrl.order').default = 'wxArrayInt()' c.find('wxRearrangeCtrl.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' c = module.find('wxRearrangeDialog') tools.fixTopLevelWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeDialog.order').default = 'wxArrayInt()' c.find('wxRearrangeDialog.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/rearrangectrl.h>') c = module.find('wxRearrangeList') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeList.order').default = 'wxArrayInt()' c.find('wxRearrangeList.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' module.addGlobalStr('wxRearrangeListNameStr', c) module.addGlobalStr('wxRearrangeDialogNameStr', c) c = module.find('wxRearrangeCtrl') tools.fixWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeCtrl.order').default = 'wxArrayInt()' c.find('wxRearrangeCtrl.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' c = module.find('wxRearrangeDialog') tools.fixTopLevelWindowClass(c) c.addPrivateCopyCtor() c.find('wxRearrangeDialog.order').default = 'wxArrayInt()' c.find('wxRearrangeDialog.items').default = 'wxArrayString()' c.find('Create.order').default = 'wxArrayInt()' c.find('Create.items').default = 'wxArrayString()' #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMiniFrame') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/propdlg.h>') c = module.find('wxPropertySheetDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c, hideVirtuals=False) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxRichTextFormattingDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) tools.ignoreConstOverloads(c) c.piBases = ['wx.adv.PropertySheetDialog'] #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/richtext/richtextstyledlg.h>") c = module.find('wxRichTextStyleOrganiserDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/splash.h>') c = module.find('wxSplashScreen') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c.find('OnCloseWindow').ignore() c.find('GetSplashWindow').ignore() c.addCppMethod('wxBitmap*', 'GetBitmap', '()', doc="Get the spash screen's bitmap", body="""\ return & self->GetSplashWindow()->GetBitmap(); """) c.addCppMethod('void', 'SetBitmap', '(const wxBitmap& bitmap)', doc="Set a new bitmap for the splash screen.", body="""\ self->GetSplashWindow()->SetBitmap(*bitmap); """) module.addPyCode("""\ SPLASH_CENTER_ON_PARENT = SPLASH_CENTRE_ON_PARENT SPLASH_CENTER_ON_SCREEN = SPLASH_CENTRE_ON_SCREEN SPLASH_NO_CENTER = SPLASH_NO_CENTRE """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/propdlg.h>') c = module.find('wxPropertySheetDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c, hideVirtuals=False) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxRichTextFormattingDialog') assert isinstance(c, etgtools.ClassDef) c.piBases = ['wx.adv.PropertySheetDialog'] tools.fixTopLevelWindowClass(c) tools.ignoreConstOverloads(c) c.piBases = ['wx.adv.PropertySheetDialog'] #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/richtext/richtextstyledlg.h>") c = module.find('wxRichTextStyleOrganiserDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/numdlg.h>') c = module.find('wxNumberEntryDialog') tools.fixTopLevelWindowClass(c) c = module.find('wxGetNumberFromUser') c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/fontdlg.h>') c = module.find('wxFontDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) # there are two of these, ignore one of them c.find('GetFontData').ignore() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/numdlg.h>') c = module.find('wxNumberEntryDialog') tools.fixTopLevelWindowClass(c) c = module.find('wxGetNumberFromUser') c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxDialogNameStr', c) tools.fixTopLevelWindowClass(c) c.find('wxDialog.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' c.find('GetToolBar').ignore() # Uses a template, but it would be easier to reimplement it in Python if # it is ever needed so don't bother complexifying the wrapper for it. c.find('ShowWindowModalThenDo').ignore() # Release the GIL for potentially blocking or long-running functions c.find('ShowModal').releaseGIL() # context manager methods c.addPyMethod('__enter__', '(self)', 'return self') c.addPyMethod('__exit__', '(self, exc_type, exc_val, exc_tb)', 'self.Destroy()') c.find('GetContentWindow').isVirtual = True c = module.find('wxWindowModalDialogEvent') tools.fixEventClass(c) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode('#include <wx/splash.h>') c = module.find('wxSplashScreen') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c.find('OnCloseWindow').ignore() c.find('GetSplashWindow').ignore() c.addCppMethod('wxBitmap*', 'GetBitmap', '()', doc="Get the spash screen's bitmap", body="""\ return & self->GetSplashWindow()->GetBitmap(); """) c.addCppMethod('void', 'SetBitmap', '(const wxBitmap& bitmap)', doc="Set a new bitmap for the splash screen.", body="""\ self->GetSplashWindow()->SetBitmap(*bitmap); """) c.addPyCode("""\ SPLASH_CENTER_ON_PARENT = SPLASH_CENTRE_ON_PARENT SPLASH_CENTER_ON_SCREEN = SPLASH_CENTRE_ON_SCREEN SPLASH_NO_CENTER = SPLASH_NO_CENTRE """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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. module.addHeaderCode("#include <wx/dirctrl.h>") c = module.find('wxGenericDirCtrl') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) module.addPyCode("""\ EVT_DIRCTRL_SELECTIONCHANGED = wx.PyEventBinder( wxEVT_DIRCTRL_SELECTIONCHANGED, 1 ) EVT_DIRCTRL_FILEACTIVATED = wx.PyEventBinder( wxEVT_DIRCTRL_FILEACTIVATED, 1 ) """) #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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' c.find('SetMenuBar.menuBar').transfer = True # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. tools.fixSetStatusWidths(c.find('SetStatusWidths')) c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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' c.find('SetMenuBar.menuBar').transfer = True # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. tools.fixSetStatusWidths(c.find('SetStatusWidths')) c.addProperty('MenuBar GetMenuBar SetMenuBar') c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
def run(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING, check4unittest=False) etgtools.parseDoxyXML(module, ITEMS) module.check4unittest = False #----------------------------------------------------------------- # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. c = module.find('wxTopLevelWindow') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxFrameNameStr', c) c.find('wxTopLevelWindow.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' c.find('HandleSettingChange').ignore() c.find('SetLeftMenu').ignore() c.find('SetRightMenu').ignore() c.find('IsUsingNativeDecorations').ignore() c.find('UseNativeDecorations').ignore() c.find('UseNativeDecorationsByDefault').ignore() c.find('MSWGetSystemMenu').ignore() # what is this? c.addCppMethod( 'void', 'MacSetMetalAppearance', '(bool on)', """\ int style = self->GetExtraStyle(); if ( on ) style |= wxFRAME_EX_METAL; else style &= ~wxFRAME_EX_METAL; self->SetExtraStyle(style); """) c.addCppMethod( 'bool', 'MacGetMetalAppearance', '()', """\ return self->GetExtraStyle() & wxFRAME_EX_METAL; """) c.addCppMethod('bool', 'MacGetUnifiedAppearance', '()', 'return true;') c.addCppMethod( 'void*', 'MacGetTopLevelWindowRef', '()', """\ #ifdef __WXMAC__ return (void*)(self->MacGetTopLevelWindowRef()); #else return 0; #endif """) c.addProperty('DefaultItem GetDefaultItem SetDefaultItem') c.addProperty('Icon GetIcon SetIcon') c.addProperty('Title GetTitle SetTitle') c.addProperty('TmpDefaultItem GetTmpDefaultItem SetTmpDefaultItem') c.addProperty('OSXModified OSXIsModified OSXSetModified') c.addProperty( 'MacMetalAppearance MacGetMetalAppearance MacSetMetalAppearance') tools.fixTopLevelWindowClass(c) c.find('ShouldPreventAppExit').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMultiChoiceDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c = module.find('wxSingleChoiceDialog') tools.fixTopLevelWindowClass(c) # Make a new class so we can ignore the clientData parameter in the ctor c.addHeaderCode("""\ class wxPySingleChoiceDialog : public wxSingleChoiceDialog { public: wxPySingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) : wxSingleChoiceDialog(parent, message, caption, choices, (void**)NULL, style, pos) {} }; """) for item in c.allItems(): if item.name == 'wxSingleChoiceDialog': item.name = 'wxPySingleChoiceDialog' c.renameClass('SingleChoiceDialog') # ignore this ctor c.find('wxPySingleChoiceDialog').findOverload('int n').ignore() # and ignore the clientData param in this one ctor = c.find('wxPySingleChoiceDialog').findOverload('wxArrayString') ctor.find('clientData').ignore() c.find('GetSelectionData').ignore() # ignore a bunch of the standalone functions for f in module.find('wxGetSingleChoiceIndex').all(): f.ignore() for f in module.find('wxGetSingleChoiceData').all(): f.ignore() for f in module.find('wxGetSelectedChoices').all(): # TODO, it might be nice to keep this one f.ignore() # keep just the overloads of this function that use wxArrayString, and # ignore the ones that have "int n" for func in module.find('wxGetSingleChoice').all(): for p in func: if p.type == 'int' and p.name == 'n': 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) tools.runGenerators(module)
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('wxPreviewControlBar') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateButtons').isVirtual = True c.find('GetZoomControl').isVirtual = True c.find('SetZoomControl').isVirtual = True #c.find('GetPrintPreview').isVirtual = True c.find('GetPrintPreview').type = 'wxPrintPreview*' c.find('GetPrintPreview').setCppCode("return static_cast<wxPrintPreview*>(self->GetPrintPreview());") c = module.find('wxPreviewCanvas') tools.fixWindowClass(c) c.bases = ['wxScrolledWindow'] c = module.find('wxPreviewFrame') tools.fixTopLevelWindowClass(c) c.find('wxPreviewFrame.preview').type = 'wxPrintPreview*' c.find('wxPreviewFrame.preview').transfer = True c.find('CreateCanvas').isVirtual = True c.find('CreateControlBar').isVirtual = True c.find('Initialize').isVirtual = True c.find('InitializeWithModality').isVirtual = True c = module.find('wxPrintPreview') c.mustHaveApp() for ctor in [c.find('wxPrintPreview').findOverload('wxPrintDialogData'), c.find('wxPrintPreview').findOverload('wxPrintData')]: ctor.find('printout').transfer = True ctor.find('printoutForPrinting').transfer = True c.addPrivateCopyCtor() c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();") c.addCppMethod('int', '__bool__', '()', "return self->IsOk();") c.addPyCode("PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.')") c = module.find('wxPrinter') c.addPrivateCopyCtor() c = module.find('wxPrintout') c.mustHaveApp() c.addPrivateCopyCtor() c.find('GetPPIPrinter.w').out = True c.find('GetPPIPrinter.h').out = True c.find('GetPPIScreen.w').out = True c.find('GetPPIScreen.h').out = True c.find('GetPageSizePixels.w').out = True c.find('GetPageSizePixels.h').out = True c.find('GetPageSizeMM.w').out = True c.find('GetPageSizeMM.h').out = True c.find('GetPageInfo.minPage').out = True c.find('GetPageInfo.maxPage').out = True c.find('GetPageInfo.pageFrom').out = True c.find('GetPageInfo.pageTo').out = True c = module.find('wxPrintAbortDialog') tools.fixTopLevelWindowClass(c) module.find('wxPrinter').mustHaveApp() # deprecated classes module.addPyCode("PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview instead.')") module.addPyCode("PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame instead.')") module.addPyCode("PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar instead.')") module.addPyCode("PyPrintout = wx.deprecated(Printout, 'Use Printout instead.')") #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxPreviewControlBar') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateButtons').isVirtual = True c.find('GetZoomControl').isVirtual = True c.find('SetZoomControl').isVirtual = True #c.find('GetPrintPreview').isVirtual = True c.find('GetPrintPreview').type = 'wxPrintPreview*' c.find('GetPrintPreview').setCppCode( "return static_cast<wxPrintPreview*>(self->GetPrintPreview());") c = module.find('wxPreviewCanvas') tools.fixWindowClass(c) c.bases = ['wxScrolledWindow'] c = module.find('wxPreviewFrame') tools.fixTopLevelWindowClass(c) c.find('wxPreviewFrame.preview').type = 'wxPrintPreview*' c.find('wxPreviewFrame.preview').transfer = True c.find('CreateCanvas').isVirtual = True c.find('CreateControlBar').isVirtual = True c.find('Initialize').isVirtual = True c = module.find('wxPrintPreview') c.mustHaveApp() for ctor in [ c.find('wxPrintPreview').findOverload('wxPrintDialogData'), c.find('wxPrintPreview').findOverload('wxPrintData') ]: ctor.find('printout').transfer = True ctor.find('printoutForPrinting').transfer = True c.addPrivateCopyCtor() c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();") c.addCppMethod('int', '__bool__', '()', "return self->IsOk();") c.addPyCode( "PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.')" ) c = module.find('wxPrinter') c.addPrivateCopyCtor() c = module.find('wxPrintout') c.mustHaveApp() c.addPrivateCopyCtor() c.find('GetPPIPrinter.w').out = True c.find('GetPPIPrinter.h').out = True c.find('GetPPIScreen.w').out = True c.find('GetPPIScreen.h').out = True c.find('GetPageSizePixels.w').out = True c.find('GetPageSizePixels.h').out = True c.find('GetPageSizeMM.w').out = True c.find('GetPageSizeMM.h').out = True c.find('GetPageInfo.minPage').out = True c.find('GetPageInfo.maxPage').out = True c.find('GetPageInfo.pageFrom').out = True c.find('GetPageInfo.pageTo').out = True c = module.find('wxPrintAbortDialog') tools.fixTopLevelWindowClass(c) module.find('wxPrinter').mustHaveApp() # deprecated classes module.addPyCode( "PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview instead.')" ) module.addPyCode( "PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame instead.')" ) module.addPyCode( "PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar instead.')" ) module.addPyCode( "PyPrintout = wx.deprecated(Printout, 'Use Printout instead.')") #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMultiChoiceDialog') assert isinstance(c, etgtools.ClassDef) tools.fixTopLevelWindowClass(c) c = module.find('wxSingleChoiceDialog') tools.fixTopLevelWindowClass(c) # Make a new class so we can ignore the clientData parameter in the ctor c.addHeaderCode("""\ class wxPySingleChoiceDialog : public wxSingleChoiceDialog { public: wxPySingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) : wxSingleChoiceDialog(parent, message, caption, choices, (void**)NULL, style, pos) {} }; """) for item in c.allItems(): if item.name == 'wxSingleChoiceDialog': item.name = 'wxPySingleChoiceDialog' c.renameClass('SingleChoiceDialog') # ignore this ctor c.find('wxPySingleChoiceDialog').findOverload('int n').ignore() # and ignore the clientData param in this one ctor = c.find('wxPySingleChoiceDialog').findOverload('wxArrayString') ctor.find('clientData').ignore() c.find('GetSelectionData').ignore() # ignore a bunch of the standalone functions for f in module.find('wxGetSingleChoiceIndex').all(): f.ignore() for f in module.find('wxGetSingleChoiceData').all(): f.ignore() for f in module.find('wxGetSelectedChoices').all(): # TODO, it might be nice to keep this one f.ignore() # keep just the overloads of this function that use wxArrayString, and # ignore the ones that have "int n" for func in module.find('wxGetSingleChoice').all(): for p in func: if p.type == 'int' and p.name == 'n': func.ignore() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMessageDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxMessageBoxCaptionStr', c) # Several of the wxMessageDIalog methods take a # wxMessageDialog::ButtonLabel parameter, which enables either a string or # a Stock ID to be passed. To facilitate this same ability for Python the # SIP types are changed to a custom type which is a MappedType which # handles converting from the two types for us. See msgdlg_btnlabel.sip c.find('ButtonLabel').ignore() for item in c.allItems(): if isinstance(item, ParamDef) and item.type == 'const ButtonLabel &': item.type = 'const wxMessageDialogButtonLabel &' tools.fixTopLevelWindowClass(c) # Make a copy of wxMessageDialog so we can generate code for # wxGenericMessageDialog too. gmd = copy.deepcopy(c) assert isinstance(gmd, etgtools.ClassDef) gmd.name = 'wxGenericMessageDialog' gmd.find('wxMessageDialog').name = 'wxGenericMessageDialog' # the ctor m = gmd.addItem( etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogCheckBox', briefDoc= "Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) m = gmd.addItem( etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogDetails', briefDoc= "Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) module.addItem(gmd) module.find('wxMessageBox').releaseGIL() c = module.find('wxMessageBox') c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMessageDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxMessageBoxCaptionStr', c) # These argument types are actually ButtonLabel, but the class is a private # helper. We will always be passing in strings, and ButtonLabel will implicitly # convert. c.find('SetHelpLabel.help').type = 'const wxString&' c.find('SetOKCancelLabels.ok').type = 'const wxString&' c.find('SetOKCancelLabels.cancel').type = 'const wxString&' c.find('SetOKLabel.ok').type = 'const wxString&' c.find('SetYesNoCancelLabels.yes').type = 'const wxString&' c.find('SetYesNoCancelLabels.no').type = 'const wxString&' c.find('SetYesNoCancelLabels.cancel').type = 'const wxString&' c.find('SetYesNoLabels.yes').type = 'const wxString&' c.find('SetYesNoLabels.no').type = 'const wxString&' tools.fixTopLevelWindowClass(c) # Make a copy of wxMessageDialog so we can generate code for # wxGenericMessageDialog too. gmd = copy.deepcopy(c) assert isinstance(gmd, etgtools.ClassDef) gmd.name = 'wxGenericMessageDialog' gmd.find('wxMessageDialog').name = 'wxGenericMessageDialog' # the ctor m = gmd.addItem( etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogCheckBox', briefDoc= "Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) m = gmd.addItem( etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogDetails', briefDoc= "Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) module.addItem(gmd) module.find('wxMessageBox').releaseGIL() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
def run(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING, check4unittest=False) etgtools.parseDoxyXML(module, ITEMS) module.check4unittest = False #----------------------------------------------------------------- # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. c = module.find('wxTopLevelWindow') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxFrameNameStr', c) c.find('wxTopLevelWindow.title').default = 'wxEmptyString' c.find('Create.title').default = 'wxEmptyString' c.find('HandleSettingChange').ignore() c.find('SetLeftMenu').ignore() c.find('SetRightMenu').ignore() c.find('IsUsingNativeDecorations').ignore() c.find('UseNativeDecorations').ignore() c.find('UseNativeDecorationsByDefault').ignore() c.find('MSWGetSystemMenu').ignore() # what is this? c.addCppMethod('void', 'MacSetMetalAppearance', '(bool on)', """\ int style = self->GetExtraStyle(); if ( on ) style |= wxFRAME_EX_METAL; else style &= ~wxFRAME_EX_METAL; self->SetExtraStyle(style); """) c.addCppMethod('bool', 'MacGetMetalAppearance', '()', """\ return self->GetExtraStyle() & wxFRAME_EX_METAL; """) c.addCppMethod('bool', 'MacGetUnifiedAppearance', '()', 'return true;') c.addCppMethod('void*', 'MacGetTopLevelWindowRef', '()', """\ #ifdef __WXMAC__ return (void*)(self->MacGetTopLevelWindowRef()); #else return 0; #endif """) c.addProperty('DefaultItem GetDefaultItem SetDefaultItem') c.addProperty('Icon GetIcon SetIcon') c.addProperty('Title GetTitle SetTitle') c.addProperty('TmpDefaultItem GetTmpDefaultItem SetTmpDefaultItem') c.addProperty('OSXModified OSXIsModified OSXSetModified') c.addProperty('MacMetalAppearance MacGetMetalAppearance MacSetMetalAppearance') tools.fixTopLevelWindowClass(c) c.find('ShouldPreventAppExit').isVirtual = True #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)
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('wxMessageDialog') assert isinstance(c, etgtools.ClassDef) module.addGlobalStr('wxMessageBoxCaptionStr', c) # These argument types are actually ButtonLabel, but the class is a private # helper. We will always be passing in strings, and ButtonLabel will implicitly # convert. # # TODO: Add a mapped type for ButtonLabel that converts from a string or stock ID. See #276 c.find('SetHelpLabel.help').type = 'const wxString&' c.find('SetOKCancelLabels.ok').type = 'const wxString&' c.find('SetOKCancelLabels.cancel').type = 'const wxString&' c.find('SetOKLabel.ok').type = 'const wxString&' c.find('SetYesNoCancelLabels.yes').type = 'const wxString&' c.find('SetYesNoCancelLabels.no').type = 'const wxString&' c.find('SetYesNoCancelLabels.cancel').type = 'const wxString&' c.find('SetYesNoLabels.yes').type = 'const wxString&' c.find('SetYesNoLabels.no').type = 'const wxString&' tools.fixTopLevelWindowClass(c) # Make a copy of wxMessageDialog so we can generate code for # wxGenericMessageDialog too. gmd = copy.deepcopy(c) assert isinstance(gmd, etgtools.ClassDef) gmd.name = 'wxGenericMessageDialog' gmd.find('wxMessageDialog').name = 'wxGenericMessageDialog' # the ctor m = gmd.addItem(etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogCheckBox', briefDoc="Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) m = gmd.addItem(etgtools.MethodDef( protection='protected', type='void', name='AddMessageDialogDetails', briefDoc="Can be overridden to provide more contents for the dialog", className=gmd.name)) m.addItem(etgtools.ParamDef(type='wxSizer*', name='sizer')) module.addItem(gmd) module.find('wxMessageBox').releaseGIL() c = module.find('wxMessageBox') c.mustHaveApp() #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)