Ejemplo n.º 1
0
    def draw(self):
        if self.classIcon != "":
            self.icon = Element(Element=DOM.createElement("i"),
                                StyleName=self.classIcon)
            self.add(self.icon)

        if self.rootPanel is None:
            self.popup = PopupPanel(autoHide=True,
                                    modal=False,
                                    rootpanel=self,
                                    StyleName='dropdown_btn')
            DOM.setStyleAttribute(self.popup.element, "position", "static")
        else:  #o poup nao esta fechando!
            self.popup = PopupPanel(autoHide=True,
                                    modal=False,
                                    rootpanel=self.rootPanel,
                                    StyleName='dropdown_btn')

        self.dropdown_arrow = Element(Element=DOM.createElement('div'),
                                      StyleName='dropdown_arrow')
        self.title = Element(Element=DOM.createSpan(), StyleName='title')
        DOM.setInnerHTML(self.title.getElement(), self.text)
        self.add(self.title)
        self.add(Widget(Element=DOM.createDiv(), StyleName='r'))
        self.add(Widget(Element=DOM.createDiv(), StyleName='coverup'))
        self.popup.add(self.dropdown_arrow)
Ejemplo n.º 2
0
 def onLoad(self):
     self.tabs = TabPanel(FlowTabBar())
     self.tabs.getTabBar().addStyleName('shortcuts')
     self.tabs.getDeckPanel().addStyleName('blockDrawer')
     #------------------------------------------------------------------------------------------
     self.input = CategoriesHardware.Input()
     self.tabs.add(self.input,
                   CategoriesHardware.TabTitle(_('Input'), 'input_btn'))
     #------------------------------------------------------------------------------------------
     self.output = CategoriesHardware.Output()
     self.tabs.add(self.output,
                   CategoriesHardware.TabTitle(_('Output'), 'output_btn'))
     #------------------------------------------------------------------------------------------
     self.tabs.selectTab(0)
     panel = Element(Element=DOM.createDiv(), Width='100%', Height='100%')
     panel.append(self.tabs)
     #------------------------------------------------------------------------------------------
     self.trashCan = Widget(Element=DOM.createDiv(),
                            StyleName='trashCanClose')
     panel.append(self.trashCan)
     self.add(panel)
     #------------------------------------------------------------------------------------------
     bottom = Element(Element=DOM.createDiv(), StyleName='drawer_bottom')
     resize = ResizeWidget(self.parent, 200, 600)
     resize.addStyleName('float_right')
     bottom.append(resize)
     self.add(bottom)
     self.setCellHeight(bottom, '20px')
Ejemplo n.º 3
0
    def __init__(self, ws):

        VerticalPanel.__init__(self, Width='100%', Height='100%')

        self.codeTextArea = Element(Element=DOM.createDiv(),
                                    StyleName='codePanel')
        self.codeTextArea.setID('clip_text')
        #self.codeTextArea.setReadonly(True)
        #self.codeTextArea.addClickListener(listener=lambda:self.codeTextArea.selectAll())
        ws.setCodePanel(self.codeTextArea)

        self.header = Header(self.changeLanguage)
        getWorkspace().setHeaderPanel(self.header)

        self.blockList = BlockList()
        self.hardwareList = HardwareList()
        self.hardwareList.addStyleName('invisible')
        self.left = Element(Element=DOM.createDiv(),
                            Width='100%',
                            Height='100%')
        ws.setBlockList(self.blockList)
        ws.setHardwaresList(self.hardwareList)

        self.serialMonitor = Element(Element=DOM.createDiv(),
                                     StyleName='serialMonitor')

        self.blocksPad = BlocksPad()
        self.hardwaresPad = HardwaresPad()
        self.hardwaresPad.addStyleName('invisible')
        self.middle = Element(Element=DOM.createDiv(),
                              Width='100%',
                              Height='100%')
        ws.setBlocksPad(self.blocksPad)
        ws.setHardwaresPad(self.hardwaresPad)
Ejemplo n.º 4
0
 def draw(self):
     if self.classIcon != "":
         self.icon = Element(Element=DOM.createElement("i"), StyleName=self.classIcon)
         self.add(self.icon)
     self.title = Element(Element=DOM.createSpan(), StyleName='title')
     DOM.setInnerHTML(self.title.getElement(), self.text)
     self.add(self.title)     
     self.add(Widget(Element=DOM.createDiv(), StyleName='r'))
Ejemplo n.º 5
0
    def draw(self):
        DOM.setAttribute(self.getElement(), 'border', 0)
        DOM.setAttribute(self.getElement(), 'cellPadding', 0)
        DOM.setAttribute(self.getElement(), 'cellSpacing', 0)

        body = Element(Element=DOM.createTBody())
        self.row = Element(Element=DOM.createTR(), StyleName='code_row')

        body.append(self.row)
        self.append(body)
 def draw(self):
     self.title = Element(Element=DOM.createSpan(), StyleName='title')
     DOM.setInnerHTML(self.title.getElement(), self.text)
     self.add(self.title)
     self.tip = PopupPanel(Element=DOM.createElement('code'), autoHide=True, modal=False, rootpanel=self)
     div = Element(Element=DOM.createElement('div'), StyleName='joyride-tip-guide')
     div.add(Widget(Element=DOM.createSpan(), StyleName='joyride-nub left'))
     self.tipItens = Element(Element=DOM.createElement('div'), StyleName='tip-itens')
     div.add(self.tipItens)
     self.tip.add(div)
Ejemplo n.º 7
0
def addArgument(s, arg):
    mode = 'input' if s.mode == INPUT else 'output'
    row = Element(Element=DOM.createTR(), StyleName='simple_hardware_pin')
    td = Element(Element=DOM.createTD(), StyleName='simple_hardware_pin_left')
    row.append(td)
    td = Element(Element=DOM.createTD(),
                 StyleName='simple_hardware_pin_label simple_' + mode + '_pin')
    DOM.setInnerText(td.getElement(), arg.label)
    row.append(td)
    td = Element(Element=DOM.createTD(),
                 StyleName='dropdown_holder simple_' + mode + '_pin')
    td.add(arg)
    row.append(td)
    s.bodyArguments.append(row)
Ejemplo n.º 8
0
    def __init__(self, feedBack, value, classIcon, **kw):
        Element.__init__(self, Element=DOM.createElement('li'), **kw)
        ClickHandler.__init__(self)
        self.classIcon = classIcon
        self.value = value

        self.icon = Element(Element=DOM.createElement("i"),
                            StyleName=classIcon)
        self.add(self.icon)
        self.title = Element(Element=DOM.createSpan(), StyleName='title')

        DOM.setInnerHTML(self.title.getElement(), self.value)
        self.add(self.title)

        self.addClickListener(self)
        self.feedBack = feedBack
Ejemplo n.º 9
0
def drawDropdownStringArgument(s, v, b, i):
    s.dropdown = Element(Element=DOM.createDiv(), StyleName='dropdown')
    for value in v:
        s.dropdown.append(MenuItenListener(i, value, StyleName='dropdownItem'))
    s.btn = MenuButtonListener(b, StyleName='dropdown_btn')
    s.btn.append(s.dropdown)
    s.append(s.btn)
Ejemplo n.º 10
0
 def __init__(self,
              subCategoryName='',
              subCategoryClassName='',
              openList=True):
     self.list = VerticalPanel(StyleName='block_list')
     self.list.setStyleAttribute("display", "block")
     VerticalPanel.__init__(self, StyleName='SubCategoryPanel')
     self.subCategoryName = subCategoryName
     if subCategoryName != '':
         self.title = Element(Element=DOM.createElement('dt'),
                              StyleName=subCategoryClassName)
         DOM.setInnerHTML(self.title.getElement(), self.subCategoryName)
         self.collapse = FocusWidget(Element=DOM.createDiv(),
                                     StyleName='collapse close_up')
         self.collapse.addClickListener(self.showHide)
         self.title.add(self.collapse)
         self.add(self.title)
         if openList:
             self.list.setStyleAttribute("display", "block")
             self.collapse.setStyleName('collapse close_up')
         else:
             self.list.setStyleAttribute("display", "none")
             self.collapse.setStyleName('collapse open_down')
     self.add(self.list)
     self.blocks = []
     self.count = 0
Ejemplo n.º 11
0
    def draw(self):
        Popup.draw(self)

        namePanel = HorizontalPanel()
        namePanel.add(Label(_('Name') + ':'))
        self.textBox = TextBox()
        self.textBox.setMaxLength(15)
        self.textBox.setStyleAttribute('marginLeft', 10)
        namePanel.add(self.textBox)
        self.center.add(namePanel)

        self.choose = ChooseTypeVarPanel()
        self.center.add(self.choose)

        self.textBox.addInputListener(self)

        self.message = Element(Element=DOM.createDiv())
        self.message.add(Widget(Element=DOM.createDiv(),
                                StyleName='not_image'))
        self.message.add(
            Label(text=_('Name already used'),
                  wordWrap=False,
                  StyleName='not_message'))

        self.onInput()
 def __init__(self):
     HorizontalPanel.__init__(self, StyleName="type_block select_block")
     self.add(Label('Tipo:'))       
     
     fake = Element(Element=DOM.createDiv())
     
     self.booleanBlock = getattr(ArduinoBlocks, 'logicType')('logica', 'red', off=True)
     fake.append(self.booleanBlock)
     self.logicType = RadioButton("group1", fake.getElement().innerHTML, True)
     self.logicType.addClickListener(getattr(self, "onClickLogicType"))
     self.add(self.logicType)
     fake.removeAll()
     
     self.numberBlock = getattr(ArduinoBlocks, 'numericType')('numerica', 'red', off=True)
     fake.append(self.numberBlock)
     self.numericType = RadioButton("group1", fake.getElement().innerHTML, True)
     self.numericType.setChecked(True)
     self.numericType.addClickListener(getattr(self, "onClickNumericType"))
     self.add(self.numericType)
     fake.removeAll()
     
     self.stringBlock = getattr(ArduinoBlocks, 'alphaNumericType')('alfanumerica', 'red', off=True)
     fake.append(self.stringBlock)
     self.alphaNumericType = RadioButton("group1", fake.getElement().innerHTML, True)
     self.alphaNumericType.addClickListener(getattr(self, "onClickAlphanumericType"))
     self.add(self.alphaNumericType)
     
     self.onClickNumericType()
Ejemplo n.º 13
0
 def onLoad(self):
     self.tabs = TabPanel(FlowTabBar())
     # self.tabs.getTabBar().addStyleName('shortcuts') === gwt-TabBar
     # self.tabs.getDeckPanel().addStyleName('blockDrawer') === gwt-TabPanelBottom{
     #------------------------------------------------------------------------------------------
     self.control = CategoriesBlock.Control()
     self.tabs.add(self.control,
                   CategoriesBlock.TabTitle(_('Control'), 'control_btn'))
     #------------------------------------------------------------------------------------------
     self.operators = CategoriesBlock.Operators()
     self.tabs.add(
         self.operators,
         CategoriesBlock.TabTitle(_('Operators'), 'operators_btn'))
     #------------------------------------------------------------------------------------------
     self.input = CategoriesBlock.Input()
     self.tabs.add(self.input,
                   CategoriesBlock.TabTitle(_('Input'), 'input_btn'))
     #------------------------------------------------------------------------------------------
     self.output = CategoriesBlock.Output()
     self.tabs.add(self.output,
                   CategoriesBlock.TabTitle(_('Output'), 'output_btn'))
     #------------------------------------------------------------------------------------------
     self.utilities = CategoriesBlock.Setup()
     self.tabs.add(self.utilities,
                   CategoriesBlock.TabTitle(_('Utilities'), 'config_btn'))
     #------------------------------------------------------------------------------------------
     self.variables = CategoriesBlock.Variables()
     self.tabs.add(
         self.variables,
         CategoriesBlock.TabTitle(_('Variables'), 'variables_btn'))
     #------------------------------------------------------------------------------------------
     self.tabs.selectTab(0)
     panel = Element(Element=DOM.createDiv(), Width='100%', Height='100%')
     panel.append(self.tabs)
     #------------------------------------------------------------------------------------------
     self.trashCan = Widget(Element=DOM.createDiv(),
                            StyleName='trashCanClose')
     panel.append(self.trashCan)
     self.add(panel)
     #------------------------------------------------------------------------------------------
     bottom = Element(Element=DOM.createDiv(), StyleName='drawer_bottom')
     resize = ResizeWidget(self.parent, 200, 510)
     resize.addStyleName('float_right')
     bottom.append(resize)
     self.add(bottom)
     self.setCellHeight(bottom, '20px')
def drawCompoundStatementBlock(s, color='orange', hasBn=True, loop=False):
    s.bn.addStyleName('i')
    s.bl.addStyleName('i')

    c = Element(Element=DOM.createDiv(), StyleName='c ' + color)
    bi = Widget(Element=DOM.createDiv(), StyleName='bi')
    ti = Widget(Element=DOM.createDiv(), StyleName='ti')

    s.code = Element(Element=DOM.createDiv(),
                     StyleName='codeBlockContents ' + color)
    s.block = StatementElement(color, hasBn)
    s.block.addStyleName('codeBlockEnd')

    c.append(ti)
    c.append(s.code)
    s.block.append(bi)
    if loop: s.block.append(Widget(Element=DOM.createDiv(), StyleName='loop'))
    c.append(s.block)
    s.bl.append(c)
Ejemplo n.º 15
0
def drawStatementBlock(s, c, hasBn=True):
    s.addStyleName('statement ' + c)

    s.t = Widget(Element=DOM.createDiv(), StyleName='t')
    l = Widget(Element=DOM.createDiv(), StyleName='l')
    r = Widget(Element=DOM.createDiv(), StyleName='r')
    s.tl = Element(Element=DOM.createDiv(), StyleName='tl')
    s.tr = Widget(Element=DOM.createDiv(), StyleName='tr')  #provisorio pra hat
    b = Widget(Element=DOM.createDiv(), StyleName='b')
    br = Widget(Element=DOM.createDiv(), StyleName='br')
    s.bl = Element(Element=DOM.createDiv(), StyleName='bl')

    s.append(s.t)
    s.append(l)
    s.append(r)
    s.append(s.tl)
    s.append(s.tr)
    s.append(b)
    s.append(br)
    if hasBn:
        s.bn = Widget(Element=DOM.createDiv(), StyleName='bn')
        s.append(s.bn)
    s.append(s.bl)
Ejemplo n.º 16
0
 def draw(self):
     self.setHTML(self.title)
     panelSouth = VerticalPanel(StyleName='dialog_south')
     self.south = Element(Element=DOM.createDiv(), Width='100%')     
     
     if (self.options == CONFIRM_CANCEL):
         cancel = Button(_('Cancel'), self.myCancelClick, classIcon="icon-cancel")
         cancel.addStyleName('float_right')
         self.south.add(cancel)
          
     self.okButton = Button(_('Confirm'), self.myOkClick, classIcon="icon-ok")
     self.okButton.addStyleName('float_right')
     self.south.add(self.okButton)
     
     panelSouth.add(self.south)
     panelSouth.setCellHorizontalAlignment(self.south, HasHorizontalAlignment.ALIGN_RIGHT)
     
     widget = VerticalPanel(Width='100%')
     widget.add(self.center)
     widget.add(panelSouth)
     self.setWidget(widget)
Ejemplo n.º 17
0
def drawComponentBlock(s):
    s.addStyleName('hardware_block block simple_hardware_block')
    table = Element(Element=DOM.createTable())
    body = Element(Element=DOM.createTBody())
    row = Element(Element=DOM.createTR(), StyleName='simple_hardware_row')
    td = Element(Element=DOM.createTD(),
                 StyleName='simple_hardware_icon ' + s.name)
    row.append(td)
    s.td = Element(Element=DOM.createTD(), StyleName='simple_hardware_name')
    DOM.setInnerHTML(s.td.getElement(), s.text)
    row.append(s.td)
    body.append(row)
    table.append(body)
    s.append(table)

    tableArguments = Element(Element=DOM.createTable(),
                             StyleName='simple_hardware_pins')
    s.bodyArguments = Element(Element=DOM.createTBody())
    tableArguments.append(s.bodyArguments)
    s.append(tableArguments)
Ejemplo n.º 18
0
    def onLoad(self):
        self.add(self.header)
        self.setCellHeight(self.header, '38px')

        self.left.add(self.blockList)
        self.left.add(self.hardwareList)
        self.mainPanel = HorizontalPanel(Width='100%', Height='100%')
        self.mainPanel.add(self.left)
        self.mainPanel.setCellWidth(self.left, '250')

        self.middle.add(self.blocksPad)
        self.middle.add(self.hardwaresPad)
        self.center = VerticalPanel(Width='100%',
                                    Height='100%',
                                    StyleName="center_panel")
        self.center.add(self.middle)

        #---------------------------------------------------------------------------------------------------------
        bottom = Element(Element=DOM.createDiv(), StyleName='drawer_bottom')

        self.showHideLeft = FocusWidget(Element=DOM.createDiv(),
                                        StyleName='control_bar close_left')
        self.showHideLeft.addClickListener(self.showHidePanelLeft)
        self.showHideLeft.setStyleAttribute('float', 'lef')
        bottom.add(self.showHideLeft)

        self.showHideRight = FocusWidget(Element=DOM.createDiv(),
                                         StyleName='control_bar')
        self.showHideRight.addClickListener(self.showHidePanelRight)
        bottom.add(self.showHideRight)

        self.showHideMonitor = FocusWidget(Element=DOM.createDiv(),
                                           StyleName='control_bar')
        self.showHideMonitor.addClickListener(self.showHidePanelMonitor)
        bottom.add(self.showHideMonitor)

        self.resizeMonitor = ResizeWidget(self.serialMonitor,
                                          100,
                                          400,
                                          invert=True,
                                          horizontal=False)
        DOM.setStyleAttribute(self.resizeMonitor.getElement(), "display",
                              "none")
        bottom.add(self.resizeMonitor)

        self.center.add(bottom)
        self.center.setCellHeight(bottom, '20px')

        usbFlash = FocusWidget(Element=DOM.createDiv())
        usbFlash.setID('cb_cf')
        DOM.setElemAttribute(usbFlash.getElement(), 'data-sections',
                             'usbflash serialmonitor')
        self.serialMonitor.add(usbFlash)

        progress = Element(Element=DOM.createDiv(),
                           StyleName='progress progress-striped active')
        progress.setID('progress')
        DOM.setStyleAttribute(progress.getElement(), "display", "none")
        progress_val = Element(Element=DOM.createDiv(), StyleName='bar')
        progress_val.setID('progress_val')
        progress.add(progress_val)
        self.serialMonitor.add(progress)

        monitor = Element(Element=DOM.createDiv())
        monitor.setID('monitor')
        self.serialMonitor.add(monitor)

        self.center.add(self.serialMonitor)
        self.center.setCellHeight(self.serialMonitor, '100')
        self.showHidePanelMonitor()
        #---------------------------------------------------------------------------------------------------------

        self.mainPanel.add(self.center)

        #---------------------------------------------------------------------------------------------------------
        self.cod = VerticalPanel(Width='100%',
                                 Height='100%',
                                 StyleName="right_panel")

        divCode = Element(Element=DOM.createDiv(),
                          Width='100%',
                          Height='100%',
                          StyleName="download-button-container")
        divCode.add(self.codeTextArea)
        divButtonDownload = FocusWidget(Element=DOM.createDiv(),
                                        StyleName="download-button")
        #divButtonDownload.addClickListener(listener=lambda:exportWiringCode(self.codeTextArea.getText()))
        divButtonDownload.addClickListener(listener=lambda: exportWiringCode())
        DOM.setInnerText(divButtonDownload.getElement(), 'download')
        divCode.add(divButtonDownload)

        self.cod.add(divCode)
        bot = Element(Element=DOM.createDiv(), StyleName='drawer_bottom')
        res = ResizeWidget(self.cod, 100, 500, invert=True)
        res.setStyleAttribute('float', 'left')
        bot.append(res)
        self.cod.add(bot)
        self.cod.setCellHeight(bot, '20px')
        self.mainPanel.add(self.cod)
        self.mainPanel.setCellWidth(self.cod, '200')
        self.showHidePanelRight()

        self.header.buttonBlocks.addClickListener(self.showBlocksList)
        self.header.buttonHarwares.addClickListener(self.showHardwaresList)
        self.header.buttonTranslate.addClickListener(self.showPanelRight)
        #self.header.buttonReload.addClickListener(self.hidePanelRight)

        #---------------------------------------------------------------------------------------------------------

        self.add(self.mainPanel)

        stateChange()

        self.changeLanguage('pt_BR')
Ejemplo n.º 19
0
    def __init__(self, changeLanguage, **kwargs):
        FlowPanel.__init__(self, **kwargs)
        self.setID('header')

        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(), StyleName='btn-group2')

        self.buttonBlocks = Button(_('Blocks'),
                                   self.showBlocks,
                                   classIcon="icon-selected")
        div.add(self.buttonBlocks)

        self.buttonHarwares = Button(_('Components'),
                                     self.showHardwares,
                                     classIcon="icon-deselected")
        div.add(self.buttonHarwares)

        self.add(div)
        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(),
                      StyleName='btn-group2 groupHidden')

        self.buttonMakeBlock = Button(_('Building Block'),
                                      self.makeBlock,
                                      classIcon="icon-buildBlock")
        div.add(self.buttonMakeBlock)

        #self.dropdownMakeBlock = Dropdown('', None, self.makeBlockItemClick, StyleName='dropdown_btn', rootPanel=div)
        #self.dropdownMakeBlock.addValue('Importar Bloco', 'icon-ImportBlock')
        #self.dropdownMakeBlock.addValue('Exportar Bloco', 'icon-ExportBlock')
        #div.add(self.dropdownMakeBlock)

        self.add(div)

        #---------------------------------------------------------------------------------------------------
        #div = Element(Element=DOM.createDiv(), StyleName='btn-group2')

        #self.buttonReload = Button(_('Reload'), self.reloadClick, classIcon="icon-repeat")
        #div.add(self.buttonReload)

        #self.add(div)

        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(),
                      StyleName='btn-group2 groupHidden')

        self.buttonUndo = Button(_('Undo'), undo, classIcon="icon-undo")
        div.add(self.buttonUndo)

        self.buttonRedo = Button(_('Redo'), redo, classIcon="icon-redo")
        div.add(self.buttonRedo)

        self.add(div)

        #self.buttonUndo2 = Button("Desfazer2", self.undo2)
        #self.add(self.buttonUndo2)

        #self.buttonRedo2 = Button("Refazer2", self.redo2)
        #self.add(self.buttonRedo2)

        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(),
                      StyleName='btn-group2 groupHidden')

        self.buttonOpen = Button(_('Open'), loadState, classIcon="icon-open")
        div.add(self.buttonOpen)

        self.buttonSave = Button(_('Save'),
                                 saveState,
                                 classIcon="icon-download")
        self.buttonSave.setID("btnSave")
        div.add(self.buttonSave)

        self.add(div)

        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(), StyleName='btn-group')

        self.codeGenerator = GenerateCodeButtonListener(
            getWorkspace().getCodePanel())
        self.buttonTranslate = Button(_("Translate"), self.codeGenerator)
        self.buttonTranslate.addMouseListener(self)
        div.add(self.buttonTranslate)

        self.dropdownTranslate = Dropdown('',
                                          None,
                                          self.translateItemClick,
                                          StyleName='dropdown_btn',
                                          rootPanel=div)
        self.isAutomatic = False
        self.dropdownTranslate.addValue(gettext_noop('Manual'),
                                        'icon-selected')
        self.dropdownTranslate.addValue(gettext_noop('Automatic'),
                                        'icon-deselected')
        div.add(self.dropdownTranslate)

        self.add(div)

        #---------------------------------------------------------------------------------------------------
        div = Element(Element=DOM.createDiv(), StyleName='btn-group2')

        self.changeLanguage = changeLanguage
        self.dropdownFlag = Dropdown('',
                                     None,
                                     self.flagItemClick,
                                     StyleName='dropdown_btn flag',
                                     classIcon='icon-pt_BR')
        self.dropdownFlag.addValue('Português', 'icon-pt_BR')
        self.dropdownFlag.addValue('English', 'icon-en_US')
        self.dropdownFlag.addValue('Español', 'icon-es_ES')
        self.dropdownFlag.addValue('Italiano', 'icon-it_IT')
        self.dropdownFlag.addMouseListener(TooltipListener("Idioma"))
        div.add(self.dropdownFlag)

        self.add(div)
        #---------------------------------------------------------------------------------------------------

        self.mainStack = []
Ejemplo n.º 20
0
    def __init__(self, categoryChangeListener):
        HorizontalPanel.__init__(self,
                                 StyleName="category_block select_block",
                                 Width='100%')
        self.categoryChangeListener = categoryChangeListener

        self.add(Label('Categoria:'))
        verticalPanel = VerticalPanel(Width='100%')
        self.add(verticalPanel)
        horizontalPanel = HorizontalPanel(Width='100%')
        verticalPanel.add(horizontalPanel)

        fake = Element(Element=DOM.createDiv())

        self.control = getattr(ArduinoBlocks, 'alphaNumericType')('Controle',
                                                                  'orange',
                                                                  off=True)
        fake.append(self.control)
        self.controlType = RadioButton("groupCategory",
                                       fake.getElement().innerHTML, True)
        self.controlType.setChecked(True)
        self.controlType.addClickListener(getattr(self, "onClickControlType"))
        horizontalPanel.add(self.controlType)
        fake.removeAll()

        self.operators = getattr(ArduinoBlocks,
                                 'alphaNumericType')('Operadores',
                                                     'green',
                                                     off=True)
        fake.append(self.operators)
        self.operatorsType = RadioButton("groupCategory",
                                         fake.getElement().innerHTML, True)
        self.operatorsType.addClickListener(
            getattr(self, "onClickOperatorsType"))
        horizontalPanel.add(self.operatorsType)
        horizontalPanel = HorizontalPanel(Width='100%')
        verticalPanel.add(horizontalPanel)
        fake.removeAll()

        self.input = getattr(ArduinoBlocks, 'alphaNumericType')('Entrada',
                                                                'purple',
                                                                off=True)
        fake.append(self.input)
        self.inputType = RadioButton("groupCategory",
                                     fake.getElement().innerHTML, True)
        self.inputType.addClickListener(getattr(self, "onClickInputType"))
        horizontalPanel.add(self.inputType)
        fake.removeAll()

        self.output = getattr(ArduinoBlocks, 'alphaNumericType')('Saida',
                                                                 'blue',
                                                                 off=True)
        fake.append(self.output)
        self.outputType = RadioButton("groupCategory",
                                      fake.getElement().innerHTML, True)
        self.outputType.addClickListener(getattr(self, "onClickOutputType"))
        horizontalPanel.add(self.outputType)
        horizontalPanel = HorizontalPanel(Width='100%')
        verticalPanel.add(horizontalPanel)
        fake.removeAll()

        self.utilities = getattr(ArduinoBlocks,
                                 'alphaNumericType')('Utilitarios',
                                                     'darkblue',
                                                     off=True)
        fake.append(self.utilities)
        self.utilitiesType = RadioButton("groupCategory",
                                         fake.getElement().innerHTML, True)
        self.utilitiesType.addClickListener(
            getattr(self, "onClickUtilitiesType"))
        horizontalPanel.add(self.utilitiesType)
        fake.removeAll()

        self.variables = getattr(ArduinoBlocks,
                                 'alphaNumericType')('Variaveis',
                                                     'red',
                                                     off=True)
        fake.append(self.variables)
        self.variablesType = RadioButton("groupCategory",
                                         fake.getElement().innerHTML, True)
        self.variablesType.addClickListener(
            getattr(self, "onClickVariablesType"))
        horizontalPanel.add(self.variablesType)

        self.onClickControlType()
Ejemplo n.º 21
0
 def enableRadioButton(self, radio, block, enable):
     fake = Element(Element=DOM.createDiv())
     if enable: block.removeStyleName('disabled')
     else: block.addStyleName('disabled')
     fake.append(block)
     radio.setHTML(fake.getElement().innerHTML)
Ejemplo n.º 22
0
 def drawSubElement(self, element):
     td = Element(Element=DOM.createTD())
     td.append(element)
     self.row.append(td)
     self.subElements.append(element)