예제 #1
0
def build_window(res):
    "Create a gui2py window based on the python resource"
    
    # windows specs (parameters)
    kwargs = dict(res.items())
    wintype = kwargs.pop('type')
    menubar = kwargs.pop('menubar', None)
    components = kwargs.pop('components')
    panel = kwargs.pop('panel', {})
    
    from gui import registry
    import gui
    
    winclass = registry.WINDOWS[wintype]
    win = winclass(**kwargs)

    # add an implicit panel by default (as pythoncard had)
    if False and panel is not None:
        panel['name'] = 'panel'
        p = gui.Panel(win, **panel)
    else:
        p = win
        
    if components:
        for comp in components:
            build_component(comp, parent=p)

    if menubar:
        mb = gui.MenuBar(name="menu", parent=win)
        for menu in menubar:
            build_component(menu, parent=mb)
    return win
예제 #2
0

# --- gui2py designer generated code starts ---
with gui.Window(name='buscapadron',
                title=u'Aplicativo Facturaci\xf3n Electr\xf3nica',
                resizable=True,
                height='636px',
                left='181',
                top='52',
                width='794px',
                image=''):
    with gui.Panel(
            label=u'',
            name='panelbusqueda',
            image='',
            sizer_border=5,
            height='500',
            left='8',
            top='6',
            width='633',
    ):

        nTop = '10'
        with gui.Panel(
                label=u'Criterios de B\xfasqueda:',
                name='criterios',
                height='80',
                left='6',
                top=nTop,
                width='778',
                bgcolor=u'#F9F9F8',
                fgcolor=u'#4C4C4C',
예제 #3
0
# --- gui2py designer generated code starts ---

with gui.Window(name='abmproductos',
                title=u'Aplicativo Facturaci\xf3n Electr\xf3nica',
                resizable=True,
                height='636px',
                left='181',
                top='52',
                width='794px',
                image=''):
    gui.StatusBar(
        name='statusbar_15_91',
        text=u'Servicio Web Factura Electr\xf3nica mercado interno (WSFEv1)',
    )
    with gui.Panel(label=u'', name='ppal'):
        with gui.Panel(
                label=u'',
                name='record',
                image='',
                sizer_border=5,
                height='500',
                left='8',
                top='6',
                width='633',
        ):
            nTop = '10'
            gui.Label(name='lblID',
                      text=u'Código de Producto:',
                      width='96',
                      top=nTop)
예제 #4
0
        height='636px',
        left='181',
        top='52',
        width='794px',
        image='',
):
    with gui.MenuBar(name='menubar_83_155', ):
        with gui.Menu(name='menu_114', ):
            gui.MenuItemSeparator(name='menuitemseparator_130', )
    gui.StatusBar(
        name='statusbar_15_91',
        text=u'Servicio Web Factura Electr\xf3nica mercado interno (WSFEv1)',
    )
    with gui.Panel(
            label=u'',
            name='panel',
            image='',
    ):
        gui.Image(
            name='image_507_571',
            height='36',
            left='17',
            top='545',
            width='238',
            filename='sistemas-agiles.png',
        )
        gui.Image(
            name='image_33_540',
            height='50',
            left='665',
            top='532',
예제 #5
0
파일: panel.py 프로젝트: thaolt/gui2py
            self.wx_obj.SetLabel(new_text)
    
    label = InitSpec(_get_label, _set_label, doc="Title", type='string')


# update metadata for the add context menu at the designer:

Panel._meta.valid_children = [ctr for ctr in registry.CONTROLS.values()
                                 if ctr._image]   # TODO: better filter
Panel._meta.container = True
 

if __name__ == "__main__":
    import sys
    # basic test until unit_test
    import gui
    app = wx.App(redirect=False)    
    w = gui.Window(title="hello world", name="frmTest", tool_window=False, 
               resizable=True, visible=False, pos=(180, 0))

    p = gui.Panel(w, name="panel", label="hello!")
    b = gui.Button(p, name="test", label="click me!")
    
    w.show()
    
    from gui.tools.inspector import InspectorTool
    InspectorTool().show(w)
    print wx.version()
    app.MainLoop()