예제 #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('wxStatusBar')
    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.
    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);
        """)
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #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("wxPropertyGridPage")
    assert isinstance(c, etgtools.ClassDef)
    tools.ignoreConstOverloads(c)

    module.addGlobalStr("wxPropertyGridManagerNameStr", c)

    c = module.find("wxPropertyGridManager")
    tools.fixWindowClass(c, hideVirtuals=False, ignoreProtected=False)
    tools.ignoreConstOverloads(c)

    # wxPGPropArg is a typedef for "const wxPGPropArgCls&" so having the
    # wrappers treat it as a normal type can be problematic. ("new cannot be
    # applied to a reference type", etc.) Let's just ignore it an replace it
    # everywhere for the real type.
    for item in module.allItems():
        if hasattr(item, "type") and item.type == "wxPGPropArg":
            item.type = "const wxPGPropArgCls &"

    # -----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #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('wxPopupWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    c.find('Position').isVirtual = True
    

    c = module.find('wxPopupTransientWindow')
    tools.fixWindowClass(c)
    c.find('Dismiss').isVirtual = True
    c.find('ProcessLeftDown').isVirtual = True
    c.find('OnDismiss').ignore(False)
    c.find('OnDismiss').isVirtual = True
    
            
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #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.

    module.addHeaderCode("#include <wx/datectrl.h>")

    dpc = module.find('wxDatePickerCtrl')
    assert isinstance(dpc, etgtools.ClassDef)

    # Make a copy and call it wxDatePickerCtrlGeneric so we can generate
    # wrappers for both classes
    gdpc = tools.copyClassDef(dpc, 'wxDatePickerCtrlGeneric')
    assert isinstance(gdpc, etgtools.ClassDef)
    module.insertItemAfter(dpc, gdpc)
    # and give it a new Python name to match Classic
    gdpc.pyName = 'GenericDatePickerCtrl'

    # now back to our regular tweaking
    for c in [dpc, gdpc]:
        tools.fixWindowClass(c)
        c.find('GetRange.dt1').out = True
        c.find('GetRange.dt2').out = True

    gdpc.addHeaderCode("#include <wx/generic/datectrl.h>")

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #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.
    
    module.addHeaderCode('#include <wx/timectrl.h>')
    
    c = module.find('wxTimePickerCtrl')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    
    
    # ignore the return value and set the parameters to be outputs
    c.find('GetTime').type = 'void'
    c.find('GetTime.hour').out = True
    c.find('GetTime.min').out = True
    c.find('GetTime.sec').out = True
    
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #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.
    
    module.addHeaderCode("#include <wx/progdlg.h>")

    c = module.find('wxGenericProgressDialog') 
    assert isinstance(c, etgtools.ClassDef) 
    
    tools.fixWindowClass(c)#, False)
    #tools.removeVirtuals(c)
    
    c.find('Pulse.skip').out = True
    c.find('Update.skip').out = True
    
    
    c = module.find('wxProgressDialog') 
    tools.fixWindowClass(c)
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #7
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('wxCheckBox')
    assert isinstance(c, etgtools.ClassDef)
    c.find('wxCheckBox.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'

    module.addGlobalStr('wxCheckBoxNameStr', c)

    # Workaround warning for the property name starting with a digit
    c.find('Get3StateValue').ignore()
    c.addAutoProperties()
    c.find('Get3StateValue').ignore(False)
    c.addProperty('ThreeStateValue Get3StateValue Set3StateValue')

    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #8
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('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)
예제 #9
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('wxCalendarEvent')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixEventClass(c)

    c.addPyCode("""\
        EVT_CALENDAR =                 wx.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED, 1)
        EVT_CALENDAR_SEL_CHANGED =     wx.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED, 1)
        EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1)
        EVT_CALENDAR_PAGE_CHANGED =    wx.PyEventBinder( wxEVT_CALENDAR_PAGE_CHANGED, 1)
        """)
    
    # These are deprecated, get rid of them later...
    c.addPyCode("""\
        EVT_CALENDAR_DAY =             wx.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED, 1)
        EVT_CALENDAR_MONTH =           wx.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED, 1)
        EVT_CALENDAR_YEAR =            wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1)
        """)
    for name in ['wxEVT_CALENDAR_DAY_CHANGED', 
                 'wxEVT_CALENDAR_MONTH_CHANGED', 
                 'wxEVT_CALENDAR_YEAR_CHANGED']:
        item = etgtools.GlobalVarDef(name=name, pyName=name, type='wxEventType')
        module.insertItemAfter(module.find('wxEVT_CALENDAR_WEEK_CLICKED'), item)   
    
    
    cc = module.find('wxCalendarCtrl')
    gcc = tools.copyClassDef(cc, 'wxGenericCalendarCtrl')
    module.insertItemAfter(cc, gcc)

    for c in [cc, gcc]:
        tools.fixWindowClass(c)
        c.find('GetDateRange.lowerdate').out = True
        c.find('GetDateRange.upperdate').out = True
        c.find('HitTest.date').out = True
        c.find('HitTest.wd').out = True
        c.find('SetAttr.attr').transfer = True
        
        c.addPyCode("""\
            {name}.PyGetDate = wx.deprecated({name}.GetDate, 'Use GetDate instead.')
            {name}.PySetDate = wx.deprecated({name}.SetDate, 'Use SetDate instead.')
            {name}.PySetDateRange = wx.deprecated({name}.SetDateRange, 'Use SetDateRange instead.')        
            """.format(name=c.name[2:]))
    
    cc.find('EnableYearChange').ignore()
    gcc.addHeaderCode("#include <wx/generic/calctrlg.h>")

    module.addGlobalStr('wxCalendarNameStr', cc)
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #10
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.

    module.addHeaderCode('#include <wx/choicebk.h>')

    c = module.find('wxChoicebook')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    tools.fixBookctrlClass(c)

    c.addCppMethod('wxChoice*', 'GetChoiceCtrl', '()',
        doc="Returns the choice control used for selecting pages.",
        body="return(self->GetChoiceCtrl());")


    module.addPyCode("""\
        EVT_CHOICEBOOK_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGED, 1 )
        EVT_CHOICEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_CHOICEBOOK_PAGE_CHANGING, 1 )

        # deprecated wxEVT aliases
        wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED   = wxEVT_CHOICEBOOK_PAGE_CHANGED
        wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING  = wxEVT_CHOICEBOOK_PAGE_CHANGING
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #11
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('wxStaticBox')
    assert isinstance(c, etgtools.ClassDef)
    c.find('wxStaticBox.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    tools.fixWindowClass(c)

    # TODO: The window-label ctor is only available on MSW and GTK so disable
    # for now. Maybe replace it with a factory function that returns None on
    # OSX??
    c.find('wxStaticBox').findOverload('wxWindow *label').ignore()
    c.find('Create').findOverload('wxWindow *label').ignore()

    # "unfix" the 2nd ctor and Create method so the required parameter lists
    # are different enough for them to be overloaded.
    #for name in ['wxStaticBox', 'Create']:
    #    m = c.find(name).findOverload('wxWindow *label')
    #    m.find('id').default = ''




    module.addGlobalStr('wxStaticBoxNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #12
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('wxEditableListBox')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    
    c.find('wxEditableListBox.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    
    module.addHeaderCode('#include <wx/editlbox.h>')
    module.addGlobalStr('wxEditableListBoxNameStr', c)
    
    c.find('GetStrings').ignore()
    c.addCppMethod('wxArrayString*', 'GetStrings', '()', 
        doc="Returns a list of the current contents of the control.",
        body="""\
            wxArrayString* arr = new wxArrayString;
            self->GetStrings(*arr);
            return arr;""",
        factory=True)
    
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #13
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.

    module.addHeaderCode('#include <wx/laywin.h>')

    c = module.find('wxSashLayoutWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)


    c = module.find('wxQueryLayoutInfoEvent')
    tools.fixEventClass(c)


    c = module.find('wxCalculateLayoutEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_QUERY_LAYOUT_INFO = wx.PyEventBinder( wxEVT_QUERY_LAYOUT_INFO )
        EVT_CALCULATE_LAYOUT = wx.PyEventBinder( wxEVT_CALCULATE_LAYOUT )
        """)


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #14
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)
예제 #15
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.

    module.addHeaderCode("#include <wx/tglbtn.h>")

    c = module.find('wxToggleButton')
    c.find('wxToggleButton.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    tools.fixWindowClass(c)

    c = module.find('wxBitmapToggleButton')
    c.find('wxBitmapToggleButton.label').default = 'wxNullBitmap'
    c.find('Create.label').default = 'wxNullBitmap'
    tools.fixWindowClass(c)

    module.addPyCode("""\
        EVT_TOGGLEBUTTON = PyEventBinder(wxEVT_TOGGLEBUTTON, 1)

        # deprecated wxEVT alias
        wxEVT_COMMAND_TOGGLEBUTTON_CLICKED   = wxEVT_TOGGLEBUTTON
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #16
0
파일: treebook.py 프로젝트: swt2c/Phoenix
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/treebook.h>')

    c = module.find('wxTreebook')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    tools.fixBookctrlClass(c, True)

    module.addPyCode("""\
        EVT_TREEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGED, 1 )
        EVT_TREEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_TREEBOOK_PAGE_CHANGING, 1)
        EVT_TREEBOOK_NODE_COLLAPSED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_COLLAPSED, 1 )
        EVT_TREEBOOK_NODE_EXPANDED = wx.PyEventBinder( wxEVT_TREEBOOK_NODE_EXPANDED, 1 )

        # deprecated wxEVT aliases
        wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED    = wxEVT_TREEBOOK_PAGE_CHANGED
        wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING   = wxEVT_TREEBOOK_PAGE_CHANGING
        wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED  = wxEVT_TREEBOOK_NODE_COLLAPSED
        wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED   = wxEVT_TREEBOOK_NODE_EXPANDED
        """)


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #17
0
파일: htmlwin.py 프로젝트: ssbb/Phoenix
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('wxHtmlWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    c.bases = ['wxScrolledWindow']

    c.find('OnCellClicked').ignore(False)
    c.find('OnCellMouseHover').ignore(False)

    for name in ['SetDefaultHTMLCursor', 'GetDefaultHTMLCursor']:
        c.find(name).find('type').type = 'wxHtmlWindowInterface::HTMLCursor'

    tools.fixHtmlSetFonts(c)

    # Pure virtuals inherited from wxHtmlWindowInterface
    c.addItem(etgtools.WigCode("""\
        virtual void SetHTMLWindowTitle(const wxString& title);
        virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link);
        virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type,
                                                     const wxString& url,
                                                     wxString *redirect) const;
        virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell,
                                           const wxPoint& pos) const;
        virtual wxWindow* GetHTMLWindow();
        virtual wxColour GetHTMLBackgroundColour() const;
        virtual void SetHTMLBackgroundColour(const wxColour& clr);
        virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg);
        virtual void SetHTMLStatusText(const wxString& text);
        virtual wxCursor GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor type) const;
        """))

    c = module.find('wxHtmlLinkEvent')
    tools.fixEventClass(c)

    c = module.find('wxHtmlCellEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_HTML_CELL_CLICKED = wx.PyEventBinder( wxEVT_HTML_CELL_CLICKED, 1 )
        EVT_HTML_CELL_HOVER   = wx.PyEventBinder( wxEVT_HTML_CELL_HOVER, 1 )
        EVT_HTML_LINK_CLICKED = wx.PyEventBinder( wxEVT_HTML_LINK_CLICKED, 1 )

        # deprecated wxEVT aliases
        wxEVT_COMMAND_HTML_CELL_CLICKED  = wxEVT_HTML_CELL_CLICKED
        wxEVT_COMMAND_HTML_CELL_HOVER    = wxEVT_HTML_CELL_HOVER
        wxEVT_COMMAND_HTML_LINK_CLICKED  = wxEVT_HTML_LINK_CLICKED
        """)


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #18
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.
    
    module.addHeaderCode("#include <wx/collpane.h>")
    module.addPyCode("""\
        EVT_COLLAPSIBLEPANE_CHANGED = wx.PyEventBinder( wxEVT_COLLAPSIBLEPANE_CHANGED )
        
        # deprecated wxEVT alias
        wxEVT_COMMAND_COLLPANE_CHANGED  = wxEVT_COLLAPSIBLEPANE_CHANGED
        """)
    
    c = module.find('wxCollapsiblePane')
    c.find('wxCollapsiblePane.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    
    tools.fixWindowClass(c)

    module.addGlobalStr('wxCollapsiblePaneNameStr', c)
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #19
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('wxAnimation')
    assert isinstance(c, etgtools.ClassDef)
    
    c = module.find('wxAnimationCtrl')
    tools.fixWindowClass(c)
    module.addGlobalStr('wxAnimationCtrlNameStr', c)
    
    # move this before wxAnimationCtrl so it can be used for default arg values
    item = module.find('wxNullAnimation')
    module.items.remove(item)
    module.insertItemBefore(c, item)
    
    
    # TODO: It would be nice to be able to use the generic verison on all
    # platforms since the native GTK version has some limitations...
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #20
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('wxAuiToolBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)


    c = module.find('wxAuiToolBarEvent')
    tools.fixEventClass(c)

    c.addPyCode("""\
        EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_AUITOOLBAR_TOOL_DROPDOWN, 1 )
        EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_OVERFLOW_CLICK, 1 )
        EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_RIGHT_CLICK, 1 )
        EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_AUITOOLBAR_MIDDLE_CLICK, 1 )
        EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder( wxEVT_AUITOOLBAR_BEGIN_DRAG, 1 )
        """)


    module.addItem(tools.wxArrayWrapperTemplate(
            'wxAuiToolBarItemArray', 'wxAuiToolBarItem', module))


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #21
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.

    module.addHeaderCode("#include <wx/hyperlink.h>")

    c = module.find('wxHyperlinkEvent')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixEventClass(c)
    c.addPyCode("""\
        EVT_HYPERLINK = wx.PyEventBinder( wxEVT_HYPERLINK, 1 )

        # deprecated wxEVT alias
        wxEVT_COMMAND_HYPERLINK  = wxEVT_HYPERLINK
        """)

    c = module.find('wxHyperlinkCtrl')
    tools.fixWindowClass(c)

    c.find('wxHyperlinkCtrl.label').default = 'wxEmptyString'
    c.find('wxHyperlinkCtrl.url').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    c.find('Create.url').default = 'wxEmptyString'

    module.addGlobalStr('wxHyperlinkCtrlNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #22
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.

    def addDefaults(func):
        func.find('value').default = '0'
        func.find('minValue').default = '0'
        func.find('maxValue').default = '100'


    c = module.find('wxSlider')
    assert isinstance(c, etgtools.ClassDef)
    addDefaults(c.find('wxSlider'))
    addDefaults(c.find('Create'))

    module.addGlobalStr('wxSliderNameStr', c)

    c.addPyMethod('GetRange', '(self)', 'return (self.GetMin(), self.GetMax())')

    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #23
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('wxContextHelpButton')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)


    c = module.find('wxHelpProvider')
    c.abstract = True
    c.find('Set').transferBack = True
    c.find('Set.helpProvider').transfer = True


    c = module.find('wxSimpleHelpProvider')
    c.addItem(etgtools.WigCode("virtual wxString GetHelp(const wxWindowBase* window);"))

    c = module.find('wxHelpControllerHelpProvider')
    c.addPrivateCopyCtor()


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #24
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)
예제 #25
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.

    module.addHeaderCode('#include <wx/ribbon/control.h>')

    # Not sure why these are showing up in this module as they are in core, so
    # let's just turn them off here...
    module.find('wxEllipsizeFlags').ignore()
    module.find('wxEllipsizeMode').ignore()


    c = module.find('wxRibbonControl')
    assert isinstance(c, etgtools.ClassDef)
    c.find('DoGetNextSmallerSize').ignore(False)
    c.find('DoGetNextLargerSize').ignore(False)
    tools.fixWindowClass(c)

    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #26
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('wxSpinButton')
    assert isinstance(c, etgtools.ClassDef)

    c.addPyMethod('GetRange', '(self)', 'return (self.GetMin(), self.GetMax())')
    c.addPyMethod('SetMin', '(self, minVal)', 'self.SetRange(minVal, self.GetMax())')
    c.addPyMethod('SetMax', '(self, maxVal)', 'self.SetRange(self.GetMin(), maxVal)')
    c.addPyCode("""\
        EVT_SPIN_UP   = wx.PyEventBinder( wxEVT_SPIN_UP, 1)
        EVT_SPIN_DOWN = wx.PyEventBinder( wxEVT_SPIN_DOWN, 1)
        EVT_SPIN      = wx.PyEventBinder( wxEVT_SPIN, 1)
        """)

    tools.fixWindowClass(c)

    c = module.find('wxSpinEvent')
    tools.fixEventClass(c)


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #27
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('wxTipWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    # We're not going to allow the use of the windowPtr arg in the ctor
    c.find('wxTipWindow.windowPtr').ignore()

    # TODO: find a way to include the rectBounds parameter while still ignoring windowPtr
    c.find('wxTipWindow.rectBounds').ignore()

    # ignore this method too
    c.find('SetTipWindowPtr').ignore()


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #28
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('wxPGValidationInfo')
    assert isinstance(c, etgtools.ClassDef)


    c = module.find('wxPropertyGrid')
    assert isinstance(c, etgtools.ClassDef)
    c.bases.remove('wxScrollHelper')
    tools.fixWindowClass(c)

    # TODO: provide a way to use a Python callable as a sort function
    c.find('GetSortFunction').ignore()
    c.find('SetSortFunction').ignore()
    module.find('wxPGSortCallback').ignore()


    # See note in propgridiface.py
    for item in module.allItems():
        if hasattr(item, 'type') and item.type == 'wxPGPropArg':
            item.type = 'const wxPGPropArgCls &'



    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #29
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.

    module.addHeaderCode('#include <wx/sashwin.h>')

    c = module.find('wxSashWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    c = module.find('wxSashEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_SASH_DRAGGED = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 1 )
        EVT_SASH_DRAGGED_RANGE = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 2 )
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #30
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.

    module.addHeaderCode('#include <wx/ribbon/panel.h>')

    c = module.find('wxRibbonPanel')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    tools.ignoreConstOverloads(c)


    c = module.find('wxRibbonPanelEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_RIBBONPANEL_EXTBUTTON_ACTIVATED = wx.PyEventBinder(wxEVT_RIBBONPANEL_EXTBUTTON_ACTIVATED, 1)
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #31
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.

    module.addHeaderCode('#include <wx/ribbon/gallery.h>')
    module.insertItem(
        0,
        etgtools.WigCode("""\
        // forward declarations
        class wxRibbonGalleryItem;
        """))

    c = module.find('wxRibbonGallery')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    # Ignore the methods setting and fetching client data as a void*.  We have
    # a mapped type for the wxClientData alternatives that work well and are
    # hack free.
    c.find('Append').findOverload('void *').ignore()
    c.find('SetItemClientData').ignore()
    c.find('GetItemClientData').ignore()

    # Methods assigning wxClientData objects need to transfer ownership
    c.find('SetItemClientObject.data').transfer = True
    c.find('Append').findOverload('wxClientData').find(
        'clientData').transfer = True

    # And let's change the names of the "Object" version of the methods
    c.find('SetItemClientObject').pyName = 'SetItemClientData'
    c.find('GetItemClientObject').pyName = 'GetItemClientData'

    c = module.find('wxRibbonGalleryEvent')
    tools.fixEventClass(c)

    c.addPyCode("""\
        EVT_RIBBONGALLERY_HOVER_CHANGED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_HOVER_CHANGED, 1 )
        EVT_RIBBONGALLERY_SELECTED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_SELECTED, 1 )
        EVT_RIBBONGALLERY_CLICKED = wx.PyEventBinder( wxEVT_RIBBONGALLERY_CLICKED, 1 )
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #32
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.

    module.addHeaderCode('#include <wx/notebook.h>')

    c = module.find('wxNotebook')
    c.find('OnSelChange').ignore()

    tools.fixWindowClass(c)

    # Let SIP know about other virtual methods that may be implemented here
    c.addItem(
        etgtools.WigCode("""\
        virtual bool DeleteAllPages();    
        """))

    module.addGlobalStr('wxNotebookNameStr', c)

    module.addPyCode("""\
        EVT_NOTEBOOK_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_NOTEBOOK_PAGE_CHANGED, 1 )
        EVT_NOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_NOTEBOOK_PAGE_CHANGING, 1 )
        """)

    module.addPyCode("""\
        # Aliases for the "best book" control as described in the overview
        BookCtrl =                       Notebook
        wxEVT_BOOKCTRL_PAGE_CHANGED =    wxEVT_NOTEBOOK_PAGE_CHANGED
        wxEVT_BOOKCTRL_PAGE_CHANGING =   wxEVT_NOTEBOOK_PAGE_CHANGING
        EVT_BOOKCTRL_PAGE_CHANGED =      EVT_NOTEBOOK_PAGE_CHANGED
        EVT_BOOKCTRL_PAGE_CHANGING =     EVT_NOTEBOOK_PAGE_CHANGING

        # deprecated wxEVT aliases
        wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED   = wxEVT_BOOKCTRL_PAGE_CHANGED
        wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING  = wxEVT_BOOKCTRL_PAGE_CHANGING
        wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED   = wxEVT_NOTEBOOK_PAGE_CHANGED
        wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING  = wxEVT_NOTEBOOK_PAGE_CHANGING

        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #33
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('wxStaticBox')
    assert isinstance(c, etgtools.ClassDef)
    c.find('wxStaticBox.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    tools.fixWindowClass(c)

    # TODO: The window-label ctor is only available on MSW and GTK so disable
    # for now. Maybe replace it with a factory function that returns None on
    # OSX??
    c.find('wxStaticBox').findOverload('wxWindow *label').ignore()
    c.find('Create').findOverload('wxWindow *label').ignore()

    # "unfix" the 2nd ctor and Create method so the required parameter lists
    # are different enough for them to be overloaded.
    #for name in ['wxStaticBox', 'Create']:
    #    m = c.find(name).findOverload('wxWindow *label')
    #    m.find('id').default = ''

    # This is intentionally not documented, but I think it would be handy to
    # use from wxPython.
    meth = MethodDef(
        name='GetBordersForSizer',
        isConst=True,
        isVirtual=True,
        type='void',
        protection='public',
        briefDoc=
        "Returns extra space that may be needed for borders within a StaticBox.",
        items=[
            ParamDef(name='borderTop', type='int*', out=True),
            ParamDef(name='borderOther', type='int*', out=True),
        ])
    c.addItem(meth)

    module.addGlobalStr('wxStaticBoxNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #34
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('wxRadioBox')
    assert isinstance(c, etgtools.ClassDef)

    module.addGlobalStr('wxRadioBoxNameStr', c)

    c.find('wxRadioBox').findOverload('wxString choices').ignore()
    c.find('Create').findOverload('wxString choices').ignore()

    c.find('wxRadioBox').findOverload('wxArrayString').find(
        'label').default = 'wxEmptyString'
    c.find('Create').findOverload('wxArrayString').find(
        'label').default = 'wxEmptyString'
    c.find('wxRadioBox').findOverload('wxArrayString').find(
        'choices').default = 'wxArrayString()'
    c.find('Create').findOverload('wxArrayString').find(
        'choices').default = 'wxArrayString()'

    # Avoid name clashes with base class methods with different signatures
    c.find('Enable').pyName = 'EnableItem'
    c.find('Show').pyName = 'ShowItem'

    c.addPyMethod('GetItemLabel',
                  '(self, n)',
                  doc="""\
                  GetItemLabel(self, n) -> string\n
                  Return the text of the n'th item in the radio box.""",
                  body='return self.GetString(n)')
    c.addPyMethod('SetItemLabel',
                  '(self, n, text)',
                  doc="""\
                  SetItemLabel(self, n, text)\n
                  Set the text of the n'th item in the radio box.""",
                  body='self.SetString(n, text)')

    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #35
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('wxCommandLinkButton')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #36
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.

    module.addHeaderCode("#include <wx/spinctrl.h>")

    c = module.find('wxSpinCtrl')
    assert isinstance(c, etgtools.ClassDef)
    c.addPyMethod('GetRange', '(self)',
                  'return (self.GetMin(), self.GetMax())')
    c.addPyMethod('SetMin', '(self, minVal)',
                  'self.SetRange(minVal, self.GetMax())')
    c.addPyMethod('SetMax', '(self, maxVal)',
                  'self.SetRange(self.GetMin(), maxVal)')
    c.find('SetSelection.from').name = 'from_'
    c.find('SetSelection.to').name = 'to_'
    tools.fixWindowClass(c)

    c = module.find('wxSpinCtrlDouble')
    c.addPyMethod('GetRange', '(self)',
                  'return (self.GetMin(), self.GetMax())')
    c.addPyMethod('SetMin', '(self, minVal)',
                  'self.SetRange(minVal, self.GetMax())')
    c.addPyMethod('SetMax', '(self, maxVal)',
                  'self.SetRange(self.GetMin(), maxVal)')
    tools.fixWindowClass(c)

    c = module.find('wxSpinDoubleEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_SPINCTRL = wx.PyEventBinder( wxEVT_SPINCTRL, 1)
        EVT_SPINCTRLDOUBLE = wx.PyEventBinder( wxEVT_SPINCTRLDOUBLE, 1)
        
        # deprecated wxEVT aliases
        wxEVT_COMMAND_SPINCTRL_UPDATED        = wxEVT_SPINCTRL
        wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED  = wxEVT_SPINCTRLDOUBLE
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #37
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('wxComboPopup')
    assert isinstance(c, etgtools.ClassDef)
    c.mustHaveApp()

    c = module.find('wxComboCtrl')
    tools.fixWindowClass(c)

    # These are protected methods that need to be unignored and also add back
    # their virtual flags
    for name in ['AnimateShow', 'DoSetPopupControl', 'DoShowPopup']:
        c.find(name).ignore(False)
        c.find(name).isVirtual = True

    # other methods that need the virtual flag turned back on
    for name in [
            'IsKeyPopupToggle',
            'ShowPopup',
            'HidePopup',
            'OnButtonClick',
            'DoShowPopup',
            'Dismiss',
    ]:  # 'Cut', 'Copy', 'Paste', ?
        c.find(name).isVirtual = True

    c.find('SetPopupControl.popup').transfer = True

    # from is a reserved word
    c.find('Remove.from').name = 'frm'
    c.find('Replace.from').name = 'frm'
    c.find('SetSelection.from').name = 'frm'

    # deprecated and removed
    c.find('GetTextIndent').ignore()
    c.find('SetTextIndent').ignore()

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #38
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('wxPropertyGridPage')
    assert isinstance(c, etgtools.ClassDef)
    tools.ignoreConstOverloads(c)

    module.addGlobalStr('wxPropertyGridManagerNameStr', c)

    c = module.find('wxPropertyGridManager')
    tools.fixWindowClass(c, hideVirtuals=False, ignoreProtected=False)
    tools.ignoreConstOverloads(c)

    c.find('AddPage.pageObj').transfer = True

    # Add some extra Python code to be executed when a wxPropertyGridManager
    # is constructed. In Classic with SWIG we did this with %pythonAppend, is
    # there any better way to do it with sip than monkey-patching?
    c.addPyCode("""\
        _PropertyGridManager__init__orig = PropertyGridManager.__init__
        def _PropertyGridManager__init__(self, *args, **kw):
            _PropertyGridManager__init__orig(self, *args, **kw)
            self.DoDefaultTypeMappings()
            self.edited_objects = {}
            self.DoDefaultValueTypeMappings()
            if not hasattr(self.__class__, '_vt2setter'):
                self.__class__._vt2setter = {}
        PropertyGridManager.__init__ = _PropertyGridManager__init__
        """)

    # wxPGPropArg is a typedef for "const wxPGPropArgCls&" so having the
    # wrappers treat it as a normal type can be problematic. ("new cannot be
    # applied to a reference type", etc.) Let's just ignore it an replace it
    # everywhere for the real type.
    for item in module.allItems():
        if hasattr(item, 'type') and item.type == 'wxPGPropArg':
            item.type = 'const wxPGPropArgCls &'

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #39
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.

    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)
예제 #40
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)

    module.addHeaderCode("#include <wx/splitter.h>")

    #-----------------------------------------------------------------
    # Tweak the parsed meta objects in the module object as needed for
    # customizing the generated code and docstrings.

    c = module.find('wxSplitterWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    # We can do these with events so we may as well save the overhead of
    # virtual methods
    c.find('OnDoubleClickSash').ignore()
    c.find('OnSashPositionChange').ignore()
    c.find('OnUnsplit').ignore()

    c.addAutoProperties()
    c.addProperty('SashInvisible', 'IsSashInvisible', 'SetSashInvisible')


    c = module.find('wxSplitterEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_SPLITTER_SASH_POS_CHANGED = wx.PyEventBinder( wxEVT_SPLITTER_SASH_POS_CHANGED, 1 )
        EVT_SPLITTER_SASH_POS_CHANGING = wx.PyEventBinder( wxEVT_SPLITTER_SASH_POS_CHANGING, 1 )
        EVT_SPLITTER_DOUBLECLICKED = wx.PyEventBinder( wxEVT_SPLITTER_DOUBLECLICKED, 1 )
        EVT_SPLITTER_UNSPLIT = wx.PyEventBinder( wxEVT_SPLITTER_UNSPLIT, 1 )
        EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED

        # deprecated wxEVT aliases
        wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED   = wxEVT_SPLITTER_SASH_POS_CHANGED
        wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING  = wxEVT_SPLITTER_SASH_POS_CHANGING
        wxEVT_COMMAND_SPLITTER_DOUBLECLICKED      = wxEVT_SPLITTER_DOUBLECLICKED
        wxEVT_COMMAND_SPLITTER_UNSPLIT            = wxEVT_SPLITTER_UNSPLIT
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #41
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('wxButton')
    tools.fixWindowClass(c)
    c.find('GetDefaultSize').mustHaveApp()

    module.addGlobalStr('wxButtonNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #42
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.

    module.addHeaderCode('#include <wx/html/webkit.h>')

    tools.generateStubs(
        'wxUSE_WEBKIT',
        module,
        extraHdrCode='extern const char* wxWebKitCtrlNameStr;\n',
        extraCppCode='const char* wxWebKitCtrlNameStr = "";\n')

    c = module.find('wxWebKitCtrl')
    assert isinstance(c, etgtools.ClassDef)
    c.addPrivateCopyCtor()
    tools.fixWindowClass(c)
    c.find('wxWebKitCtrl.strURL').default = '""'
    c.find('Create.strURL').default = '""'

    module.addGlobalStr('wxWebKitCtrlNameStr', c)

    c = module.find('wxWebKitBeforeLoadEvent')
    tools.fixEventClass(c)

    c = module.find('wxWebKitStateChangedEvent')
    tools.fixEventClass(c)

    c = module.find('wxWebKitNewWindowEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_WEBKIT_BEFORE_LOAD = wx.PyEventBinder( wxEVT_WEBKIT_BEFORE_LOAD, 1 )
        EVT_WEBKIT_STATE_CHANGED = wx.PyEventBinder( wxEVT_WEBKIT_STATE_CHANGED, 1 )
        EVT_WEBKIT_NEW_WINDOW = wx.PyEventBinder( wxEVT_WEBKIT_NEW_WINDOW, 1 )
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #43
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('wxInfoBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    # turn the virtualness back on for this method
    c.find('Dismiss').isVirtual = True

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #44
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.
    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);
        """)

    # 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)
예제 #45
0
파일: panel.py 프로젝트: yufi113/Phoenix
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('wxPanel')
    assert isinstance(c, etgtools.ClassDef)
    c.find('OnSysColourChanged').ignore()
    tools.fixWindowClass(c)

    module.addPyCode("PyPanel = wx.deprecated(Panel, 'Use Panel instead.')")

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #46
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('wxStaticText')
    c.find('wxStaticText.label').default = 'wxEmptyString'
    c.find('Create.label').default = 'wxEmptyString'
    tools.fixWindowClass(c)

    module.addGlobalStr('wxStaticTextNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #47
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.

    module.addHeaderCode("#include <wx/statline.h>")

    c = module.find('wxStaticLine')
    tools.fixWindowClass(c)

    module.addGlobalStr('wxStaticLineNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #48
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.

    module.addHeaderCode('#include <wx/ribbon/toolbar.h>')
    module.insertItem(
        0,
        etgtools.WigCode("""\
        // forward declarations
        class wxRibbonToolBarToolBase;
        """))

    c = module.find('wxRibbonToolBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)

    # Use wxPyUserData for the clientData values instead of a plain wxObject
    for item in c.allItems():
        if isinstance(item, etgtools.ParamDef) and item.name == 'clientData':
            item.type = 'wxPyUserData*'
            item.transfer = True
    meth = c.find('GetToolClientData')
    meth.type = 'wxPyUserData*'
    meth.setCppCode(
        'return dynamic_cast<wxPyUserData*>(self->GetToolClientData(tool_id));'
    )

    c = module.find('wxRibbonToolBarEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_RIBBONTOOLBAR_CLICKED = wx.PyEventBinder( wxEVT_RIBBONTOOLBAR_CLICKED, 1 )
        EVT_RIBBONTOOLBAR_DROPDOWN_CLICKED = wx.PyEventBinder( wxEVT_RIBBONTOOLBAR_DROPDOWN_CLICKED, 1 )
        """)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #49
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.

    module.addHeaderCode('#include <wx/simplebook.h>')

    c = module.find('wxSimplebook')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    tools.fixBookctrlClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #50
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.

    module.addHeaderCode('#include <wx/ribbon/bar.h>')

    c = module.find('wxRibbonBar')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    c.find('SetArtProvider.art').transfer = True


    c = module.find('wxRibbonBarEvent')
    tools.fixEventClass(c)

    module.addPyCode("""\
        EVT_RIBBONBAR_PAGE_CHANGED    = wx.PyEventBinder(wxEVT_RIBBONBAR_PAGE_CHANGED, 1)
        EVT_RIBBONBAR_PAGE_CHANGING   = wx.PyEventBinder(wxEVT_RIBBONBAR_PAGE_CHANGING,1)
        EVT_RIBBONBAR_TAB_MIDDLE_DOWN = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN, 1)
        EVT_RIBBONBAR_TAB_MIDDLE_UP   = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_MIDDLE_UP, 1)
        EVT_RIBBONBAR_TAB_RIGHT_DOWN  = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_RIGHT_DOWN, 1)
        EVT_RIBBONBAR_TAB_RIGHT_UP    = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_RIGHT_UP, 1)
        EVT_RIBBONBAR_TAB_LEFT_DCLICK = wx.PyEventBinder(wxEVT_RIBBONBAR_TAB_LEFT_DCLICK, 1)
        EVT_RIBBONBAR_TOGGLED         = wx.PyEventBinder(wxEVT_RIBBONBAR_TOGGLED, 1)
        EVT_RIBBONBAR_HELP_CLICK      = wx.PyEventBinder(wxEVT_RIBBONBAR_HELP_CLICK, 1)
        """)


    module.addItem(
        tools.wxArrayWrapperTemplate('wxRibbonPageTabInfoArray',
                                     'wxRibbonPageTabInfo',
                                     module))


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #51
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.

    module.addHeaderCode('#include <wx/ribbon/control.h>')

    c = module.find('wxRibbonControl')
    assert isinstance(c, etgtools.ClassDef)
    c.find('DoGetNextSmallerSize').ignore(False)
    c.find('DoGetNextLargerSize').ignore(False)
    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #52
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('wxDirDialog')
    module.addGlobalStr('wxDirDialogNameStr', c)
    module.addGlobalStr('wxDirDialogDefaultFolderStr', c)
    
    tools.fixWindowClass(c)

    module.find('wxDirSelectorPromptStr').ignore()
    
    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #53
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('wxListBox')
    c.find('wxListBox').findOverload('wxString choices').ignore()
    c.find('wxListBox').findOverload('wxArrayString').find(
        'choices').default = 'wxArrayString()'

    c.find('Create').findOverload('wxString choices').ignore()
    c.find('Create').findOverload('wxArrayString').find(
        'choices').default = 'wxArrayString()'

    # Just use the Set() method inherited from wxControlWithItems, it has the
    # overload defined that works best for us
    for set in c.findAll('Set'):
        set.ignore()

    c.find('GetSelections').type = 'wxArrayInt*'
    c.find('GetSelections').factory = True  # a new instance is being created
    c.find('GetSelections.selections').ignore()
    c.find('GetSelections').setCppCode("""\
        wxArrayInt* array = new wxArrayInt;
        self->GetSelections(*array);
        return array;
        """)

    c.find('InsertItems').findOverload('wxString *items').ignore()

    tools.fixWindowClass(c)

    module.addGlobalStr('wxListBoxNameStr', c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #54
0
파일: control.py 프로젝트: yufi113/Phoenix
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('wxControl')
    assert isinstance(c, etgtools.ClassDef)
    module.addGlobalStr('wxControlNameStr', c)

    tools.fixWindowClass(c)

    module.addPyCode(
        "PyControl = wx.deprecated(Control, 'Use Control instead.')")

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #55
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('wxVarScrollHelperBase')
    assert isinstance(c, etgtools.ClassDef)
    c.find('OnGetUnitsSizeHint').ignore(False)
    c.find('EstimateTotalSize').ignore(False)
    c.find('OnGetUnitSize').ignore(False)

    # SIP apparently has some issues when generating code for calling
    # virtuals in the base class when there is diamond inheritance going on,
    # it seems to confuse the compiler. By telling SIP that the methods are
    # reimplemented in the branches of the diamond (which they are in this
    # case) then that version of the generated code works better. We'll add
    # this block of declarations to each of the two helper classes below.
    baseVirtuals = """\
    virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const;
    virtual wxCoord EstimateTotalSize() const;
    virtual int GetNonOrientationTargetSize() const;
    virtual wxOrientation GetOrientation() const;
    virtual int GetOrientationTargetSize() const;
    virtual wxCoord OnGetUnitSize(size_t unit) const;
    """

    c = module.find('wxVarVScrollHelper')
    c.find('EstimateTotalHeight').ignore(False)
    c.find('OnGetRowsHeightHint').ignore(False)
    c.find('OnGetRowHeight').ignore(False)
    c.addItem(etgtools.WigCode(baseVirtuals, protection='protected'))
    c.find('RefreshRows.from').name = 'from_'
    c.find('RefreshRows.to').name = 'to_'

    c = module.find('wxVarHScrollHelper')
    c.find('EstimateTotalWidth').ignore(False)
    c.find('OnGetColumnsWidthHint').ignore(False)
    c.find('OnGetColumnWidth').ignore(False)
    c.addItem(etgtools.WigCode(baseVirtuals, protection='protected'))
    c.find('RefreshColumns.from').name = 'from_'
    c.find('RefreshColumns.to').name = 'to_'

    c = module.find('wxVarHVScrollHelper')

    c = module.find('wxVScrolledWindow')
    tools.fixWindowClass(c)

    c = module.find('wxHScrolledWindow')
    tools.fixWindowClass(c)

    c = module.find('wxHVScrolledWindow')
    tools.fixWindowClass(c)

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #56
0
파일: cshelp.py 프로젝트: yufi113/Phoenix
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('wxContextHelpButton')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)


    c = module.find('wxHelpProvider')
    c.abstract = True
    c.find('Set').transferBack = True
    c.find('Set.helpProvider').transfer = True
    c.find('AddHelp.window').type = 'wxWindowBase *'
    c.find('RemoveHelp.window').type = 'wxWindowBase *'
    c.find('ShowHelp.window').type = 'wxWindowBase *'
    c.find('ShowHelpAtPoint.window').type = 'wxWindowBase *'
    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)
예제 #57
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('wxVListBox')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    module.addHeaderCode('#include <wx/vlbox.h>')
    module.addGlobalStr('wxVListBoxNameStr', c)

    c.find('GetFirstSelected.cookie').out = True
    c.find('GetNextSelected.cookie').inOut = True

    for name in [
            'OnDrawItem', 'OnDrawBackground', 'OnDrawSeparator',
            'OnMeasureItem'
    ]:
        c.find(name).ignore(False)
        c.find(name).isVirtual = True

    c.find('OnDrawItem').isPureVirtual = True
    c.find('OnMeasureItem').isPureVirtual = True

    c.find('SelectRange.from').name = 'from_'
    c.find('SelectRange.to').name = 'to_'

    # Let the wrapper generator know that there is an implementation for this
    # pure virtual inherited from the base class.
    c.addItem(
        etgtools.WigCode("virtual wxCoord OnGetRowHeight(size_t n) const;",
                         protection='protected'))

    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #58
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('wxWizardPage')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c, False)
    module.addPyCode("PyWizardPage = wx.deprecated(WizardPage, 'Use WizardPage instead.')")


    c = module.find('wxWizardPageSimple')
    tools.fixWindowClass(c, False)
    c.addItem(etgtools.WigCode("""\
        virtual wxWizardPage* GetNext() const;
        virtual wxWizardPage* GetPrev() const;
        """))


    c = module.find('wxWizard')
    tools.fixWindowClass(c, False)

    # ShowPage is undocumented and labeled "implementation only" but it seems
    # too useful to ignore, so add a MethodDef for it here.
    m = MethodDef(name='ShowPage', type='bool', isVirtual=True,
            briefDoc="Show the given wizard page.",
            detailedDoc=["""\
                Calls TransferDataFromWindow on the current page first, and
                returns false without changing the page if it returned false.
                Returns True/False to indicate if the page was actually
                changed."""],
            items=[ParamDef(name='page', type='wxWizardPage*'),
                   ParamDef(name='goingForward', type='bool', default='true')])
    c.addItem(m)

    # Same for IsRunning
    m = MethodDef(name='IsRunning', type='bool', isConst=True)
    c.addItem(m)


    c = module.find('wxWizardEvent')
    tools.fixEventClass(c)
    module.addPyCode("""\
        EVT_WIZARD_BEFORE_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_WIZARD_BEFORE_PAGE_CHANGED, 1)
        EVT_WIZARD_PAGE_CHANGED  = wx.PyEventBinder( wxEVT_WIZARD_PAGE_CHANGED, 1)
        EVT_WIZARD_PAGE_CHANGING = wx.PyEventBinder( wxEVT_WIZARD_PAGE_CHANGING, 1)
        EVT_WIZARD_CANCEL        = wx.PyEventBinder( wxEVT_WIZARD_CANCEL, 1)
        EVT_WIZARD_HELP          = wx.PyEventBinder( wxEVT_WIZARD_HELP, 1)
        EVT_WIZARD_FINISHED      = wx.PyEventBinder( wxEVT_WIZARD_FINISHED, 1)
        EVT_WIZARD_PAGE_SHOWN    = wx.PyEventBinder( wxEVT_WIZARD_PAGE_SHOWN, 1)
        """)


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #59
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.

    module.addHeaderCode("#include <wx/progdlg.h>")

    c = gpd = module.find('wxGenericProgressDialog')
    assert isinstance(c, etgtools.ClassDef)

    tools.fixWindowClass(c)#, False)
    #tools.removeVirtuals(c)

    c.find('Pulse.skip').out = True
    c.find('Update.skip').out = True


    c = module.find('wxProgressDialog')
    tools.fixWindowClass(c)

    # Copy methods from the generic to the native class. This is needed
    # because none of the methods are declared in the interface files, and
    # since on MSW some non-virtual methods are reimplemented in
    # wxProgressDialogs they will not be called if SIP doesn't know about
    # them. We'll copy all of them and let the C++ compiler sort things out.
    for item in gpd:
        if (isinstance(item, etgtools.MethodDef) and
                not item.isCtor and
                not item.isDtor):
            c.addItem(copy.deepcopy(item))


    #-----------------------------------------------------------------
    tools.doCommonTweaks(module)
    tools.runGenerators(module)
예제 #60
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('wxBannerWindow')
    assert isinstance(c, etgtools.ClassDef)
    tools.fixWindowClass(c)
    module.addHeaderCode('#include <wx/bannerwindow.h>')
    module.addGlobalStr('wxBannerWindowNameStr', c)

    # We can already do with keyword args what this ctor does for C++ people,
    # so ignore it to avoid signature conflicts.
    c.find('wxBannerWindow').findOverload('parent, wxDirection').ignore()

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