Example #1
0
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)
Example #2
0
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('wxStatusBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    module.addGlobalStr('wxStatusBarNameStr', c)

    # 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'))

    # Same thing for SetStatusStyles
    m = c.find('SetStatusStyles')
    m.find('n').ignore()
    m.find('styles').type = 'const wxArrayInt&'
    m.argsString = '(int n, const wxArrayInt& styles)'
    m.setCppCode("""\
        const int* ptr = &styles->front();
        self->SetStatusStyles(styles->size(), ptr);
        """)
    
    # For SetFieldsCount just accept the number arg, and let the user set the
    # widths with SetStatusWidths like in Classic
    # TODO:
    #c.find('SetFieldsCount.widths').ignore()

    m = c.find('SetFieldsCount')
    m.find('widths').type = 'const wxArrayInt*'
    m.argsString = '(int number = 1, const wxArrayInt* widths = NULL)'
    m.setCppCode("""\
        if (widths) {
            const int* ptr = &widths->front();
            self->SetFieldsCount(number, ptr);
            }
        else {
            self->SetFieldsCount(number);
            }
        """)
    
    # Change GetFieldRect to return the rectangle (for Pythonicity and Classic compatibility)
    c.find('GetFieldRect').ignore()
    c.addCppMethod('wxRect*', 'GetFieldRect', '(int i)',
        doc="Returns the size and position of a field's internal bounding rectangle.",
        body="""\
            wxRect* r = new wxRect;
            self->GetFieldRect(i, *r);
            return r;
            """)
    
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
Example #3
0
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)
Example #4
0
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)
Example #5
0
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)
Example #6
0
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('wxStatusBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    module.addGlobalStr('wxStatusBarNameStr', c)

    # 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'))

    # Same thing for SetStatusStyles
    m = c.find('SetStatusStyles')
    m.find('n').ignore()
    m.find('styles').type = 'const wxArrayInt&'
    m.argsString = '(int n, const wxArrayInt& styles)'
    m.setCppCode("""\
        const int* ptr = &styles->front();
        self->SetStatusStyles(styles->size(), ptr);
        """)

    # For SetFieldsCount just accept the number arg, and let the user set the
    # widths with SetStatusWidths like in Classic
    # TODO:
    #c.find('SetFieldsCount.widths').ignore()

    m = c.find('SetFieldsCount')
    m.find('widths').type = 'const wxArrayInt*'
    m.argsString = '(int number = 1, const wxArrayInt* widths = NULL)'
    m.setCppCode("""\
        if (widths) {
            const int* ptr = &widths->front();
            self->SetFieldsCount(number, ptr);
            }
        else {
            self->SetFieldsCount(number);
            }
        """)

    # Change GetFieldRect to return the rectangle (for Pythonicity and Classic compatibility)
    c.find('GetFieldRect').ignore()
    c.addCppMethod(
        'wxRect*',
        'GetFieldRect',
        '(int i)',
        doc=
        "Returns the size and position of a field's internal bounding rectangle.",
        body="""\
            wxRect* r = new wxRect;
            self->GetFieldRect(i, *r);
            return r;
            """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)