def __init__(self, name, qty=1, color='orange', loop=False):
        Block.__init__(self, name, Block.STATEMENT_BLOCK)
        self.mb = 52 + (qty - 1) * 52
        self.setStyleAttribute('marginBottom', self.mb)
        self.height = 20
        self.maxA = 0
        self.qty = qty
        self.color = color

        drawStatementBlock(self, color)
        self.holderSiblingUp = BlockHolder(
            StatementArgument(StatementArgument.UP_ARG), self, True)
        self.tl.append(self.holderSiblingUp)
        Block.drawBlock(self)

        statement = self
        for i in range(qty):
            drawCompoundStatementBlock(statement,
                                       color,
                                       loop=(loop and i == qty - 1))

            statement.holderChild = BlockHolder(
                StatementArgument(StatementArgument.CHILD_ARG, i), self)
            statement.code.append(statement.holderChild)
            self.holderChildren.append(statement.holderChild)

            statement = statement.block
            if i != qty - 1: statement.setStyleAttribute('marginBottom', '0px')

        self.holderSiblingDown = BlockHolder(
            StatementArgument(StatementArgument.DOWN_ARG), self)
        statement.bl.append(self.holderSiblingDown)
 def __init__(self, color='blue', hasBn=True):
     self.color = color
     Element.__init__(self, Element=DOM.createDiv(), StyleName=self.color)
     drawStatementBlock(self, color, hasBn)
     self.ge = GroupElement()
     self.append(self.ge)
     self.holderArguments = []
示例#3
0
 def __init__(self, name, color='orange'):
     Block.__init__(self, name, Block.STATEMENT_BLOCK, StyleName='hat')
     self.color = color
     drawStatementBlock(self, color)
     self.holderSiblingDown = BlockHolder(
         StatementArgument(StatementArgument.DOWN_ARG), self)
     self.bl.append(self.holderSiblingDown)
     Block.drawBlock(self)
     DOM.setAttribute(self.getElement(), 'draggable', False)
示例#4
0
 def __init__(self, name, qty=1, color='orange', loop=False):
     FakeBlock.__init__(self, name, color)
     drawStatementBlock(self, color)
     statement = self
     for i in range(qty):
         drawCompoundStatementBlock(statement,
                                    color,
                                    loop=(loop and i == qty - 1))
         statement = statement.block
     FakeBlock.drawBlock(self)
     self.setStyleAttribute('marginBottom', 52 + (qty - 1) * 52)
示例#5
0
    def __init__(self, name, color='orange'):
        Block.__init__(self, name, Block.END_BLOCK)
        self.mb = 52
        self.setStyleAttribute('marginBottom', self.mb)
        self.height = 20
        self.maxA = 0
        self.qty = 1
        self.color = color

        drawStatementBlock(self, color)
        self.holderSiblingUp = BlockHolder(
            StatementArgument(StatementArgument.UP_ARG), self, True)
        self.tl.append(self.holderSiblingUp)

        drawCompoundStatementBlock(self, color, hasBn=False, loop=True)
        self.holderChild = BlockHolder(
            StatementArgument(StatementArgument.CHILD_ARG, 0), self)
        self.code.append(self.holderChild)
        self.holderChildren.append(self.holderChild)

        Block.drawBlock(self)
示例#6
0
 def __init__(self, name, color='orange'):
     FakeBlock.__init__(self, name, color)
     drawStatementBlock(self, color)
     FakeBlock.drawBlock(self)
     drawCompoundStatementBlock(self, color, hasBn=False)
     self.setStyleAttribute('marginBottom', 52)
示例#7
0
 def __init__(self, name, color='blue'):
     FakeBlock.__init__(self, name, color)
     drawStatementBlock(self, color)
     FakeBlock.drawBlock(self)