def __init__(self, parent, *args, **kwargs):
        TreeListCtrl.__init__(self,
                              parent,
                              *args,
                              style=wx.TR_DEFAULT_STYLE
                              | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HIDE_ROOT,
                              **kwargs)

        self.root = None
        self.resource_labels = []

        self.col_name = 0
        self.AddColumn('Name', 200)
        self.col_r = 1
        self.AddColumn('R', 24)
        self.col_w = 2
        self.AddColumn('W', 24)
        self.col_units = 3
        self.AddColumn('Units', 50)
        self.col_label = 4
        self.AddColumn('Label', 200, edit=True)
        self.col_value = 5
        self.AddColumn('Value', 400, edit=True)

        # Extra 50 for nesting.
        self.SetMinSize((950, -1))

        self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded)
        self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
        self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit)
        self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnActivated)
Exemplo n.º 2
0
	def __init__(self, parent, *args, **kwargs):
		TreeListCtrl.__init__(self, parent, *args,
				style=wx.TR_DEFAULT_STYLE|wx.TR_FULL_ROW_HIGHLIGHT|wx.TR_HIDE_ROOT,
				**kwargs)

		self.root = None
		self.resource_labels = []

		self.col_name = 0
		self.AddColumn('Name', 200)
		self.col_r = 1
		self.AddColumn('R', 24)
		self.col_w = 2
		self.AddColumn('W', 24)
		self.col_units = 3
		self.AddColumn('Units', 50)
		self.col_label = 4
		self.AddColumn('Label', 200, edit=True)
		self.col_value = 5
		self.AddColumn('Value', 400, edit=True)

		# Extra 50 for nesting.
		self.SetMinSize((950, -1))

		self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded)
		self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
		self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit)
		self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnActivated)
Exemplo n.º 3
0
 def __init__(self, parent, pos=wx.DefaultPosition):
     """!List of layers to be imported (dxf, shp...)"""
     self.parent = parent
     
     TreeListCtrl.__init__(self, parent, wx.ID_ANY,
                           style = wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT |
                           wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_MULTIPLE)
     
     # setup mixins
     listmix.ListCtrlAutoWidthMixin.__init__(self)
     
     self.AddColumn(_('Layer / Style'))
     self.AddColumn(_('Title'))
     self.SetMainColumn(0) # column with the tree
     self.SetColumnWidth(0, 175)
     
     self.root = None
Exemplo n.º 4
0
    def __init__(self, scene, *args, **kwargs):
        """__init__(scene, *args, **kwargs) 
        
Special kwargs:
    style: style applied to the wx.gizmos.TreeListCtrl. Default is 
                      wx.TR_HIDE_ROOT \
                    | wx.TR_DEFAULT_STYLE \
                    | wx.TR_HAS_BUTTONS  \
                    | wx.TR_FULL_ROW_HIGHLIGHT \
                    | wx.TR_SINGLE \
                    | wx.TR_NO_LINES
"""
        style = kwargs.pop('style',-1)
        if style is -1:
            style = wx.TR_HIDE_ROOT \
                    | wx.TR_DEFAULT_STYLE \
                    | wx.TR_HAS_BUTTONS  \
                    | wx.TR_FULL_ROW_HIGHLIGHT \
                    | wx.TR_SINGLE \
                    | wx.TR_NO_LINES
            # can't figure out how to make the list single selection
            # hacked below
        TreeListCtrl.__init__(self, style=style, *args, **kwargs)
        # columns
        self.Indent = 0 # doesn't seem to work
        self.AddColumn("gname")
        self.AddColumn("class")
        self.AddColumn("layer")
        self.SetColumnWidth(0,80)
        self.set_object(scene)
        self.refresh_tree()
        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.on_sel_changed)
        self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_activated)
        self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.on_right_click)
        self.menu_up = wx.NewId()
        self.menu_down = wx.NewId()
        self.menu_top = wx.NewId()
        self.menu_bottom = wx.NewId()
        self.Bind(wx.EVT_MENU, self.move_up, id=self.menu_up)
        self.Bind(wx.EVT_MENU, self.move_down, id=self.menu_down)
        self.Bind(wx.EVT_MENU, self.move_top, id=self.menu_top)
        self.Bind(wx.EVT_MENU, self.move_bottom, id=self.menu_bottom)
        self.right_clicked = None
        wx.GetApp().register_selection_watcher(self)
        from pug.syswx.pugframe import PugFrame
        self.PugFrame = PugFrame
Exemplo n.º 5
0
    def __init__(self, scene, *args, **kwargs):
        """__init__(scene, *args, **kwargs) 
        
Special kwargs:
    style: style applied to the wx.gizmos.TreeListCtrl. Default is 
                      wx.TR_HIDE_ROOT \
                    | wx.TR_DEFAULT_STYLE \
                    | wx.TR_HAS_BUTTONS  \
                    | wx.TR_FULL_ROW_HIGHLIGHT \
                    | wx.TR_SINGLE \
                    | wx.TR_NO_LINES
"""
        style = kwargs.pop('style', -1)
        if style is -1:
            style = wx.TR_HIDE_ROOT \
                    | wx.TR_DEFAULT_STYLE \
                    | wx.TR_HAS_BUTTONS  \
                    | wx.TR_FULL_ROW_HIGHLIGHT \
                    | wx.TR_SINGLE \
                    | wx.TR_NO_LINES
            # can't figure out how to make the list single selection
            # hacked below
        TreeListCtrl.__init__(self, style=style, *args, **kwargs)
        # columns
        self.Indent = 0  # doesn't seem to work
        self.AddColumn("gname")
        self.AddColumn("class")
        self.AddColumn("layer")
        self.SetColumnWidth(0, 80)
        self.set_object(scene)
        self.refresh_tree()
        self.Bind(wx.EVT_TREE_SEL_CHANGED, self.on_sel_changed)
        self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_activated)
        self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.on_right_click)
        self.menu_up = wx.NewId()
        self.menu_down = wx.NewId()
        self.menu_top = wx.NewId()
        self.menu_bottom = wx.NewId()
        self.Bind(wx.EVT_MENU, self.move_up, id=self.menu_up)
        self.Bind(wx.EVT_MENU, self.move_down, id=self.menu_down)
        self.Bind(wx.EVT_MENU, self.move_top, id=self.menu_top)
        self.Bind(wx.EVT_MENU, self.move_bottom, id=self.menu_bottom)
        self.right_clicked = None
        wx.GetApp().register_selection_watcher(self)
        from pug.syswx.pugframe import PugFrame
        self.PugFrame = PugFrame
Exemplo n.º 6
0
    def __init__(self, parent, web_service, style, pos=wx.DefaultPosition):
        """List of layers and styles available in capabilities file
        """
        self.parent = parent
        self.ws = web_service

        TreeListCtrl.__init__(self, parent=parent, id=wx.ID_ANY, style=style)

        # setup mixins
        listmix.ListCtrlAutoWidthMixin.__init__(self)
        if self.ws != 'OnEarth':
            self.AddColumn(_('Name'))
            self.AddColumn(_('Type'))
        else:
            self.AddColumn(_('Layer name'))

        self.SetMainColumn(0)  # column with the tree
        self.setResizeColumn(0)

        self.root = None
        self.Bind(wx.EVT_TREE_SEL_CHANGING, self.OnListSelChanging)

        self.layerSelected = Signal('LayersList.layerSelected')
Exemplo n.º 7
0
    def __init__(self, parent, web_service, style, pos=wx.DefaultPosition):
        """List of layers and styles available in capabilities file
        """
        self.parent = parent
        self.ws = web_service

        TreeListCtrl.__init__(self, parent = parent, id = wx.ID_ANY, style = style)

        # setup mixins
        listmix.ListCtrlAutoWidthMixin.__init__(self)
        if self.ws != 'OnEarth':
            self.AddColumn(_('Name'))
            self.AddColumn(_('Type'))
        else:
            self.AddColumn(_('Layer name'))

        self.SetMainColumn(0) # column with the tree
        self.setResizeColumn(0)

        self.root = None
        self.Bind(wx.EVT_TREE_SEL_CHANGING, self.OnListSelChanging)

        self.layerSelected = Signal('LayersList.layerSelected')