예제 #1
0
 def __init__(self, parent, cms, palette=None, onclick=None):
     self.cms = cms
     self.callback = onclick
     wal.VPanel.__init__(self, parent)
     if wal.is_wx3(): self.pack((172, 1))
     options = wal.ExpandedPanel(self, _('Palette preview:'))
     changer = wal.HToggleKeeper(options,
                                 PREVIEW_MODES,
                                 MODE_ICON,
                                 MODE_NAME,
                                 on_change=self.set_mode)
     options.pack(changer)
     self.pack(options, fill=True)
     border = wal.VPanel(self, border=True)
     if wal.is_wx3():
         color = wal.GRAY
         if wal.is_gtk(): color = wal.UI_COLORS['pressed_border']
         border.set_bg(color)
     self.pack(border, expand=True, fill=True)
     self.win = ScrolledPalette(border, self.cms, onclick=self.select_color)
     if wal.is_wx3():
         if wal.is_gtk():
             inner_border = wal.VPanel(self)
             inner_border.pack(self.win, expand=True, fill=True)
             border.pack(inner_border,
                         expand=True,
                         fill=True,
                         padding_all=1)
         else:
             border.pack(self.win, expand=True, fill=True, padding_all=1)
     else:
         border.pack(self.win, expand=True, fill=True)
     changer.set_mode(AUTO_MODE)
     if palette: self.draw_palette(palette)
예제 #2
0
	def __init__(self, parent, cms, palette=None, onclick=None):
		self.cms = cms
		self.callback = onclick
		wal.VPanel.__init__(self, parent)
		options = wal.ExpandedPanel(self, _('Palette preview:'))
		changer = wal.HToggleKeeper(options, PREVIEW_MODES, MODE_ICON,
								MODE_NAME, on_change=self.set_mode)
		options.pack(changer)
		self.pack(options, fill=True)
		border = wal.VPanel(self, border=True)
		self.pack(border, expand=True, fill=True)
		self.win = ScrolledPalette(border, self.cms, onclick=self.select_color)
		border.pack(self.win, expand=True, fill=True)
		changer.set_mode(AUTO_MODE)
		if palette: self.draw_palette(palette)
예제 #3
0
    def __init__(self, parent):
        wal.VPanel.__init__(self, parent)

        exp = wal.ExpandedPanel(self, 'Test options')
        self.pack(exp, fill=True)
        exp.pack(wal.Button(exp, 'Test button'))

        data = []
        root = wal.TreeElement('root')
        prov = wx.ArtProvider_GetBitmap
        icon = prov(wx.ART_CDROM, wx.ART_OTHER, wal.SIZE_16)
        root.icon = icon
        for item in range(5):
            el = wal.TreeElement('Element %d' % item)
            root.childs.append(el)
        data.append(root)
        data.append(root)

        self.tree = wal.TreeWidget(self, data, on_select=self.selected)
        self.pack(self.tree, expand=True, fill=True, padding=2)
        self.tree.expand_all()