示例#1
0
# RCS-ID:       $Id: core.py 47823 2007-07-29 19:24:35Z ROL $

from wx.tools.XRCed import component, images, attribute, params
from wx.tools.XRCed.globals import TRACE
import _bitmaps as bitmaps

TRACE('*** creating control components')

# Set panel images
component.Manager.panelImages['Controls'] = images.ToolPanel_Controls.GetImage(
)

### wxStaticText

c = component.Component('wxStaticText', ['control', 'tool'],
                        ['pos', 'size', 'label', 'wrap'],
                        defaults={'label': 'LABEL'},
                        image=images.TreeStaticText.GetImage())
c.addStyles('wxALIGN_LEFT', 'wxALIGN_RIGHT', 'wxALIGN_CENTRE',
            'wxST_NO_AUTORESIZE')
component.Manager.register(c)
component.Manager.setMenu(c, 'control', 'label', 'wxStaticText', 10)
component.Manager.setTool(c, 'Controls', pos=(0, 0))

### wxStaticLine

c = component.Component('wxStaticLine', ['control', 'tool'], ['pos', 'size'],
                        image=images.TreeStaticLine.GetImage())
c.addStyles('wxLI_HORIZONTAL', 'wxLI_VERTICAL')
component.Manager.register(c)
component.Manager.setMenu(c, 'control', 'line', 'wxStaticLine', 20)
component.Manager.setTool(c, 'Controls', pos=(0, 3))
示例#2
0
    ('ImageTextToggleButton', xh_delmic.ImageTextToggleButtonHandler,
     'New button', 'Icon Text Toggle Button', True),
    ('GraphicRadioButton', xh_delmic.GraphicRadioButtonHandler, 'New button',
     'Icon Text Toggle Group Button', True),
    ('TabButton', xh_delmic.TabButtonHandler, 'New button', 'Tab Button',
     True),
    ('ViewButton', xh_delmic.ViewButtonHandler, 'New button', 'View Button',
     True),
]

for btn in buttons:
    attrs = ['pos', 'size', 'icon', 'icon_on', 'height', 'face_colour']
    attrs += ['label'] if btn[4] else []

    c = component.Component(btn[0], ['control', 'tool'],
                            attrs,
                            image=images.TreeBitmapButton.GetImage())
    c.addStyles('wxALIGN_LEFT', 'wxALIGN_RIGHT', 'wxALIGN_CENTRE')
    c.setSpecial('icon', attribute.BitmapAttribute)
    c.setParamClass('icon', params.ParamBitmap)
    c.setSpecial('icon_on', attribute.BitmapAttribute)
    c.setParamClass('icon_on', params.ParamBitmap)
    c.setParamClass('height', ButtonSizesParam)
    c.setParamClass('face_colour', ButtonFaceColourParam)

    c.addEvents('EVT_BUTTON')
    component.Manager.register(c)
    component.Manager.addXmlHandler(btn[1])
    component.Manager.setMenu(c, btn[2], btn[3], btn[0], 2)
    component.Manager.setTool(c, 'Controls', pos=(1, 1))
示例#3
0
    ('AngularResolvedViewport', xh_delmic.AngularResolvedViewportXmlHandler),
]

for i, (name, handler) in enumerate(msvps):
    c = component.Container(name, ['window', 'top_level', 'control'],
                            ['pos', 'size'],
                            image=images.TreePanel.GetImage())
    c.addStyles('wxTAB_TRAVERSAL')
    component.Manager.register(c)
    component.Manager.addXmlHandler(handler)
    component.Manager.setMenu(c, 'Delmic Viewport', name, name, 10 + i)

### wx.lib.buttons.GenBitmapButton

c = component.Component(
    'wx.lib.buttons.GenBitmapButton', ['control', 'tool'],
    ['pos', 'size', 'default', 'bitmap', 'selected', 'focus', 'disabled'],
    image=images.TreeBitmapButton.GetImage())
#c.addStyles()
c.setParamClass('default', params.ParamBool)
c.setSpecial('bitmap', attribute.BitmapAttribute)

c.setSpecial('selected', attribute.BitmapAttribute)
c.setParamClass('selected', params.ParamBitmap)

c.setSpecial('focus', attribute.BitmapAttribute)
c.setParamClass('focus', params.ParamBitmap)

c.setSpecial('disabled', attribute.BitmapAttribute)
c.setParamClass('disabled', params.ParamBitmap)

c.addEvents('EVT_BUTTON')
示例#4
0
                             ['book', 'window', 'control'], ['pos', 'size'],
                             implicit_klass='foldpanel',
                             implicit_page='FoldPanel',
                             implicit_attributes=['label', 'collapsed'],
                             implicit_params={'collapsed': params.ParamBool})
c.addStyles('FPB_DEFAULT_STYLE', 'FPB_SINGLE_FOLD', 'FPB_COLLAPSE_TO_BOTTOM',
            'FPB_EXCLUSIVE_FOLD', 'FPB_HORIZONTAL', 'FPB_VERTICAL')
component.Manager.register(c)
component.Manager.addXmlHandler(xh_wxlib.FoldPanelBarXmlHandler)
component.Manager.setMenu(c, 'bar', 'fold panel bar', 'FoldPanelBar', 1000)

# wx.lib.ticker.Ticker


class ParamDirection(params.RadioBox):
    choices = {'right to left': 'rtl', 'left to right': 'ltr'}
    default = 'rtl'


c = component.Component(
    'wxTicker', ['control'],
    ['pos', 'size', 'start', 'text', 'ppf', 'fps', 'direction'],
    params={
        'ppf': params.ParamInt,
        'fps': params.ParamInt,
        'direction': ParamDirection
    })
component.Manager.register(c)
component.Manager.addXmlHandler(wxTickerXmlHandler)
component.Manager.setMenu(c, 'control', 'ticker', 'Ticker', 1000)