예제 #1
0
	def __init__(self, parent, data=[], border=True, header=False,
				single_sel=True, virtual=False, alt_color=False,
				even_color=const.EVEN_COLOR, odd_color=const.ODD_COLOR,
				on_select=None, on_activate=None):
		self.data = data
		self.alt_color = alt_color
		self.odd_color = odd_color
		self.even_color = even_color
		style = wx.LC_REPORT | wx.LC_VRULES
		if border and not const.is_wx3(): style |= wx.BORDER_MASK
		if not header: style |= wx.LC_NO_HEADER
		if single_sel: style |= wx.LC_SINGLE_SEL
		if virtual: style |= wx.LC_VIRTUAL
		wx.ListCtrl.__init__(self, parent, wx.ID_ANY, style=style)
		listmix.ListCtrlAutoWidthMixin.__init__(self)
		if self.data: self.update(self.data)
		if on_select:
			self.select_cmd = on_select
			self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.on_select, self)
		if on_activate:
			self.activate_cmd = on_activate
			self.Bind(wx.wx.EVT_LIST_ITEM_ACTIVATED, self.on_activate, self)
예제 #2
0
    def __init__(
        self, parent, data=[], border=True, alt_color=True, use_icons=True, on_select=None, highlight_row=True
    ):
        style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT
        if const.is_msw():
            highlight_row = False
        if highlight_row:
            style |= wx.TR_FULL_ROW_HIGHLIGHT
        if not highlight_row:
            alt_color = False
        if border and not const.is_wx3():
            style |= wx.BORDER_MASK
        wx.TreeCtrl.__init__(self, parent, wx.ID_ANY, style=style)
        self.alt_color = alt_color
        self.use_icons = use_icons
        self.select_cmd = on_select

        self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.recolor_items, self)
        self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.recolor_items, self)
        if self.select_cmd:
            self.Bind(wx.EVT_TREE_SEL_CHANGED, self.sel_changed, self)

        self.update(data)
예제 #3
0
    def __init__(self,
                 parent,
                 data=[],
                 border=True,
                 alt_color=True,
                 use_icons=True,
                 on_select=None,
                 highlight_row=True):
        style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_HIDE_ROOT
        if const.is_msw(): highlight_row = False
        if highlight_row: style |= wx.TR_FULL_ROW_HIGHLIGHT
        if not highlight_row: alt_color = False
        if border and not const.is_wx3(): style |= wx.BORDER_MASK
        wx.TreeCtrl.__init__(self, parent, wx.ID_ANY, style=style)
        self.alt_color = alt_color
        self.use_icons = use_icons
        self.select_cmd = on_select

        self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.recolor_items, self)
        self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.recolor_items, self)
        if self.select_cmd:
            self.Bind(wx.EVT_TREE_SEL_CHANGED, self.sel_changed, self)

        self.update(data)
예제 #4
0
파일: basic.py 프로젝트: uckermann/sk1-wx
 def __init__(self, parent, border=False):
     style = wx.NO_BORDER
     if border and not const.is_wx3(): style = wx.BORDER_MASK
     wx.ScrolledWindow.__init__(self, parent, wx.ID_ANY, style=style)
     self.set_scroll_rate()
     self.set_double_buffered()
예제 #5
0
파일: basic.py 프로젝트: uckermann/sk1-wx
 def __init__(self, parent, border=False, allow_input=False):
     style = wx.TAB_TRAVERSAL
     if allow_input: style |= wx.WANTS_CHARS
     if border and not const.is_wx3(): style |= wx.BORDER_MASK
     wx.Panel.__init__(self, parent, wx.ID_ANY, style=style)
예제 #6
0
파일: basic.py 프로젝트: sk1project/sk1-wx
	def __init__(self, parent, border=False):
		style = wx.NO_BORDER
		if border and not const.is_wx3():style = wx.BORDER_MASK
		wx.ScrolledWindow.__init__(self, parent, wx.ID_ANY, style=style)
		self.set_scroll_rate()
		self.set_double_buffered()
예제 #7
0
파일: basic.py 프로젝트: sk1project/sk1-wx
	def __init__(self, parent, border=False, allow_input=False):
		style = wx.TAB_TRAVERSAL
		if allow_input: style |= wx.WANTS_CHARS
		if border and not const.is_wx3():style |= wx.BORDER_MASK
		wx.Panel.__init__(self, parent, wx.ID_ANY, style=style)