Example #1
0
 def copy(self, memo):
     c = Block.copy(self, memo)
     diagram = self.diagram().copy(memo)
     diagram.set_parent(c)
     c.__diagram = diagram.tag
     memo[self.__diagram] = c.__diagram
     return c
Example #2
0
 def remove(self, child):
     Block.remove(self, child)
     self.resize()
Example #3
0
 def insert(self, child, index):
     Block.insert(child, index)
     self.resize()
Example #4
0
 def append(self, child):
     Block.append(self, child)
     if self.canvas:
         self.resize()
Example #5
0
 def iter(self, mode=''):
     if mode == 'tree_node':
         return iter([self.diagram()])
     else:
         return Block.iter(self, mode)
Example #6
0
 def accept(self, visitor, mode='DLR'):
     if mode == 'DLR':
         Block.accept(self, visitor, mode)
     self.diagram().accept(visitor, mode)
     if mode == 'LRD':
         Block.accept(self, visitor, mode)
Example #7
0
 def construct(self, parent):
     Block.construct(self, parent)
     diagram = Diagram(self.dict, 'Sub Diagram')
     diagram.construct(self)
     self.__diagram = diagram.tag
     return self
Example #8
0
 def __init__(self, cd=None, name=''):
     Block.__init__(self, cd, name, '用户自定义功能')
     self.__diagram = None