예제 #1
0
파일: backtree.py 프로젝트: ogbash/astvis
    def __init__(self, root, astTree=None):
        BaseWidget.__init__(self, 'back_call_tree', outerWidgetName='back_call_tree_outer',
                            menuName='backtree-popup')

        self.root = root
        self.view = self.widget
        self._object = None

        column = gtk.TreeViewColumn("Name")
        cell = gtk.CellRendererPixbuf()
        column.pack_start(cell, False)
        column.add_attribute(cell, "pixbuf", 2)
        cell = gtk.CellRendererText()
        column.pack_start(cell, True)
        column.add_attribute(cell, "text", 0)
        column.add_attribute(cell, "foreground-gdk", 3)
        
        self.view.append_column(column)

        self.model = gtk.TreeStore(str, object, gtk.gdk.Pixbuf, gtk.gdk.Color)
        self.view.set_model(self.model)

        # create refs list
        self.refsList = ReferencesList(self, self.wTree)
        self.view.get_selection().connect('changed', self.__selectionChanged)
예제 #2
0
    def __init__(self, root, concepts):
        BaseWidget.__init__(self, 'concept_tree', 'concept_tree_outer',
                            menuName='concepttree-popup')
        self.root = root
        self.view = self.widget
        self.concepts = concepts

        self.treeModel = gtk.TreeStore(str,object)
        self.__fillTree()
        
        column = gtk.TreeViewColumn()
        cell = gtk.CellRendererText()
        column.pack_start(cell, True)
        column.add_attribute(cell, 'text', 0)
        self.view.append_column(column)

        self.view.set_model(self.treeModel)
        event.manager.subscribe(self._conceptsChanged, concepts)

        self.view.connect("drag-data-get", self._dragDataGet)
        self.view.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, 
                [(INFO_TEXT.name, 0, INFO_TEXT.number),
                 (INFO_PROJECTS_ATTRPATH.name, 0, INFO_PROJECTS_ATTRPATH.number)],
                gtk.gdk.ACTION_COPY)

        event.manager.subscribeClass(self._notify, concept.Concept)
예제 #3
0
    def __init__(self, projects, root):
        BaseWidget.__init__(self, 'project_tree', 'project_tree_outer',
                            
                            menuName='projecttree-popup')
        self.view = self.widget
        self.projects = projects
        self.root = root

        self.model = gtkx.PythonTreeModel(projects)
        
        gtkx.connectTreeView(self.view, self.model)
예제 #4
0
파일: asttree.py 프로젝트: ogbash/astvis
    def __init__(self, root, astModel):
        LOG.debug('Generating AstTree with %s' % astModel)
        BaseWidget.__init__(self, 'ast_tree', 'ast_tree_outer',
                            menuName='asttree-popup')
        self.root = root
        self.astModel = astModel
        self.model = None #: GTK tree model for the AST tree  
        self.view = self.widget #: GTK tree view
        self.filters = {} #: enabled filters, name->filter
        
        column = gtk.TreeViewColumn("Name")
        cell = gtk.CellRendererPixbuf()
        column.pack_start(cell, False)
        column.add_attribute(cell, "pixbuf", 2)
        cell = gtk.CellRendererText()
        column.pack_start(cell, True)
        column.add_attribute(cell, "text", 0)
        column.add_attribute(cell, "foreground-gdk", 3)
        self.view.append_column(column)

        column = gtk.TreeViewColumn("Tags")
        cell = TagCellRenderer()
        column.pack_start(cell, False)
        column.set_cell_data_func(cell, cell.setCellData)
        self.view.append_column(column)

        self.view.connect("key-press-event", self._keyPress, None)
        self.view.connect("button-press-event", self._buttonPress)
        self.view.get_selection().connect("changed", self._selectionChanged, None)
        
        self.view.connect("drag-data-get", self._dragDataGet)
        self.view.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, 
                [(INFO_TEXT.name, 0, INFO_TEXT.number),
                 (INFO_OBJECT_PATH.name, 0, INFO_OBJECT_PATH.number)],
                gtk.gdk.ACTION_COPY)
        
        self.model = gtk.TreeStore(str, object, gtk.gdk.Pixbuf, gtk.gdk.Color)
        self.view.set_model(self.model)
                
        event.manager.subscribeClass(self._objectChanged, ast.ASTObject)                
        event.manager.subscribeClass(self._objectChanged, project.Project)
        event.manager.subscribeClass(self._tagChanged, project.TagDict)
        event.manager.subscribeClass(self._tagTypeChanged, project.TagType)
        
        self.regenerateSidebarTree()
예제 #5
0
파일: backtree.py 프로젝트: ogbash/astvis
    def __init__(self, backCallTree, wTree):
        BaseWidget.__init__(self, 'back_call_tree_refs', outerWidgetName='back_call_tree_outer',
                            wTree=wTree)

        self.parent = backCallTree
        self.view = self.widget

        self.widget.hide()
        self.widget.connect("button-press-event", self.__buttonPress)

        column = gtk.TreeViewColumn("Location")
        cell = gtk.CellRendererText()
        column.pack_start(cell, True)
        column.add_attribute(cell, "text", 2)
        self.view.append_column(column)

        self.model = gtk.ListStore(str, object, str)
        self.view.set_model(self.model)
예제 #6
0
파일: calltree.py 프로젝트: ogbash/astvis
    def __init__(self, root, astTree=None):
        BaseWidget.__init__(self, 'call_tree', 'call_tree_outer',
                            menuName='calltree-popup')
        self.root = root
        self.view = self.widget
        self.hide()
        
        column = gtk.TreeViewColumn("Name")
        cell = gtk.CellRendererPixbuf()
        column.pack_start(cell, False)
        column.add_attribute(cell, "pixbuf", 2)
        cell = gtk.CellRendererText()
        column.pack_start(cell, True)
        column.add_attribute(cell, "text", 0)
        column.add_attribute(cell, "foreground-gdk", 3)

        self.view.append_column(column)

        # register events
        self.view.connect("key-press-event", self._keyPress, None)
        self.view.connect("button-press-event", self._buttonPress)        
        self.view.connect("drag-data-get", self._dragDataGet)
        self.view.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, 
                [(INFO_TEXT.name, 0, INFO_TEXT.number),
                 (INFO_OBJECT_PATH.name, 0, INFO_OBJECT_PATH.number)],
                gtk.gdk.ACTION_COPY)        

        self.model = gtk.TreeStore(str, object, gtk.gdk.Pixbuf, gtk.gdk.Color)
        self.view.set_model(self.model)
        #self.view.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
        
        event.manager.subscribeClass(self._objectChanged, ast.ASTObject)
        
        if astTree!=None:
            astTree.view.get_selection().connect('changed', self._astTreeChanged)
            self._astTreeChanged(astTree.view.get_selection())