예제 #1
0
    def __init__(self,
                 title,
                 titleStyle=None,
                 imgStyle=None,
                 rowStyles=None,
                 containerIndex=2,
                 titleIndex=1,
                 **kwargs):
        if rowStyles is None:
            rowStyles = ["top", "top2", "middle", "bottom"]

        if titleStyle is None:
            titleStyle = "title"

        DecoratorPanel.__init__(self, rowStyles, containerIndex, **kwargs)

        inner = self.getCellElement(titleIndex, 1)
        if imgStyle:
            img = DOM.createDiv()
            DOM.setAttribute(img, "className", imgStyle)
            DOM.appendChild(inner, img)
        tdiv = DOM.createDiv()
        DOM.setAttribute(tdiv, "className", titleStyle)
        DOM.setInnerText(tdiv, title)
        DOM.appendChild(inner, tdiv)
예제 #2
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()
예제 #3
0
    def __init__(self, **kwargs):
        """ Creates an empty vertical split panel.
        """
        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-VerticalSplitPanel"
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createDiv()
        SplitPanel.__init__(self, element,
                            DOM.createDiv(),
                            self.preventBoxStyles(DOM.createDiv()),
                            self.preventBoxStyles(DOM.createDiv()),
                            **kwargs)

        self.container = self.preventBoxStyles(DOM.createDiv())
        self.buildDOM()

        self.impl = ImplVerticalSplitPanel(self)

        self.setSplitPosition("50%")

        # Captures the height of the top container when drag resizing starts.
        self.initialTopHeight = 0

        # Captures the offset of a user's mouse pointer during drag resizing.
        self.initialThumbPos = 0

        self.lastSplitPosition = ""
예제 #4
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)
예제 #5
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)
예제 #6
0
    def __init__(self, **kwargs):
        """ Creates an empty vertical split panel.
        """
        if not kwargs.has_key('StyleName'):
            kwargs['StyleName'] = "gwt-VerticalSplitPanel"
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createDiv()
        SplitPanel.__init__(self, element, DOM.createDiv(),
                            self.preventBoxStyles(DOM.createDiv()),
                            self.preventBoxStyles(DOM.createDiv()), **kwargs)

        self.container = self.preventBoxStyles(DOM.createDiv())
        self.buildDOM()

        self.impl = ImplVerticalSplitPanel(self)

        self.setSplitPosition("50%")

        # Captures the height of the top container when drag resizing starts.
        self.initialTopHeight = 0

        # Captures the offset of a user's mouse pointer during drag resizing.
        self.initialThumbPos = 0

        self.lastSplitPosition = ""
예제 #7
0
    def __init__(self, **kwargs):
        """ Creates an empty horizontal split panel.
        """

        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-HorizontalSplitPanel"

        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = DOM.createDiv()
        SplitPanel.__init__(self, element,
                            DOM.createDiv(),
                            self.preventBoxStyles(DOM.createDiv()),
                            self.preventBoxStyles(DOM.createDiv()),
                            **kwargs)

        self.container = self.preventBoxStyles(DOM.createDiv())

        self.buildDOM()

        self.impl = ImplHorizontalSplitPanel(self)

        # By default the panel will fill its parent vertically and horizontally.
        # The horizontal case is covered by the fact that the top level div is
        # block display.
        self.setHeight("100%")

        self.lastSplitPosition = "50%"
        self.initialLeftWidth = 0
        self.initialThumbPos = 0
예제 #8
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')
예제 #9
0
파일: Map.py 프로젝트: rjw57/foldbeam
    def __init__(self, options=None, *args, **kwargs):
        element = DOM.createDiv()
        if not 'StyleName' in kwargs:
            kwargs['StyleName'] = 'leaflet-Map'
        FocusWidget.__init__(self, element, *args, **kwargs)

        map_element = DOM.createDiv()
        DOM.setStyleAttribute(map_element, 'width', '100%')
        DOM.setStyleAttribute(map_element, 'height', '100%')
        DOM.appendChild(element, map_element)
        JS('this._map = new $wnd.L.Map(map_element, pyjslib.toJSObjects(options));')

        self._layers = []
예제 #10
0
    def __init__(self, vertical=False, **kwargs):
        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-MenuBar"

        self.body = None
        self.items = []
        self.parentMenu = None
        self.popup = None
        self.selectedItem = None
        self.shownChildMenu = None
        self.vertical = False
        self.autoOpen = False

        if kwargs.has_key('Element'):
            table = kwargs.pop('Element')
            fc = DOM.getFirstChild(table)
            if fc:
                self.body = fc
            else:
                self.body = DOM.createTBody()
                DOM.appendChild(table, self.body)
        else:
            table = DOM.createTable()
        self.body = DOM.createTBody()
        DOM.appendChild(table, self.body)

        if not vertical:
            tr = DOM.createTR()
            DOM.appendChild(self.body, tr)

        self.vertical = vertical

        outer = DOM.createDiv()
        DOM.appendChild(outer, table)
        self.setElement(outer)
        Widget.__init__(self, **kwargs)
예제 #11
0
    def __init__(self, width=0, height=0):
        Widget.__init__(self)
        self.context = None
        
        self.setElement(DOM.createDiv())
        canvas = DOM.createElement("canvas")
        self.setWidth(width)
        self.setHeight(height)
        
        canvas.width=width
        canvas.height=height
        
        DOM.appendChild(self.getElement(), canvas)
        self.setStyleName("gwt-Canvas")
        
        self.init()
        
        self.context.fillStyle = "black"
        self.context.strokeStyle = "black"

        self.focusable = None
        self.focusable = Focus.createFocusable()
        
        self.focusListeners = []
        self.clickListeners = []
        self.mouseListeners = []
        self.keyboardListeners = []
        
        DOM.appendChild(self.getElement(), self.focusable)
        DOM.sinkEvents(canvas, Event.ONCLICK | Event.MOUSEEVENTS | DOM.getEventsSunk(canvas))
        DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS | Event.KEYEVENTS)
예제 #12
0
    def __init__(self,
                 min_value,
                 max_value,
                 start_value=None,
                 step=None,
                 **kwargs):

        if not kwargs.has_key("StyleName"):
            kwargs['StyleName'] = "gwt-VerticalSlider"

        if kwargs.has_key('Element'):
            # XXX FIXME: Focus.createFocusable is here for a reason...
            element = kwargs.pop('Element')
        else:
            element = Focus.createFocusable()
        DOM.setStyleAttribute(element, "position", "relative")
        DOM.setStyleAttribute(element, "overflow", "hidden")

        self.handle = DOM.createDiv()
        DOM.appendChild(element, self.handle)

        DOM.setStyleAttribute(self.handle, "border", "1px")
        DOM.setStyleAttribute(self.handle, "width", "100%")
        DOM.setStyleAttribute(self.handle, "height", "10px")
        DOM.setStyleAttribute(self.handle, "backgroundColor", "#808080")

        Control.__init__(self, element, min_value, max_value, start_value,
                         step, **kwargs)

        self.addClickListener(self)
        self.addFocusListener(self)
        self.addMouseListener(self)
    def __init__(self,
                 autoHide=False,
                 modal=True,
                 rootpanel=None,
                 glass=False,
                 **kwargs):

        self.popupListeners = []
        self.showing = False
        self.autoHide = autoHide
        kwargs['Modal'] = kwargs.get('Modal', modal)

        if rootpanel is None:
            rootpanel = RootPanel()
        self.rootpanel = rootpanel

        self.glass = glass
        if self.glass:
            self.glass = DOM.createDiv()
            if not 'GlassStyleName' in kwargs:
                kwargs['GlassStyleName'] = "gwt-PopupPanelGlass"

        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = self.createElement()
        DOM.setStyleAttribute(element, "position", "absolute")

        SimplePanel.__init__(self, element, **kwargs)

        if glass:
            self.setGlassEnabled(True)
            if 'GlassStyleName' in kwargs:
                self.setGlassStyleName(kwargs.pop('GlassStyleName'))
 def setGlassEnabled(self, enabled):
     if enabled:
         if self.glass is None:
             self.glass = DOM.createDiv()
             self.setGlassStyleName()
     elif self.glass is not None:
         self.hideGlass()
 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 = []
 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()
    def __init__(self, **ka):
        ka['StyleName'] = ka.get('StyleName', "gwt-Tree")

        self.root = None
        self.childWidgets = Set()
        self.curSelection = None
        self.focusable = None
        self.focusListeners = []
        self.mouseListeners = []
        self.imageBase = pygwt.getModuleBaseURL()
        self.keyboardListeners = []
        self.listeners = []
        self.lastEventType = ""

        element = ka.pop('Element', None) or DOM.createDiv()
        self.setElement(element)
        DOM.setStyleAttribute(self.getElement(), "position", "relative")
        self.focusable = Focus.createFocusable()
        # Hide focus outline in Mozilla/Webkit/Opera
        DOM.setStyleAttribute(self.focusable, "outline", "0px")
        # Hide focus outline in IE 6/7
        DOM.setElemAttribute(self.focusable, "hideFocus", "true")

        DOM.setStyleAttribute(self.focusable, "fontSize", "0")
        DOM.setStyleAttribute(self.focusable, "position", "absolute")
        DOM.setIntStyleAttribute(self.focusable, "zIndex", -1)
        DOM.appendChild(self.getElement(), self.focusable)

        self.root = RootTreeItem()
        self.root.setTree(self)

        Widget.__init__(self, **ka)

        self.sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS)
        DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS)
예제 #18
0
 def setHTML(self, html):
     """Set the face's contents as html."""
     self.face = DOM.createDiv()
     UIObject.setStyleName(self.button, self.face, self.STYLENAME_HTML_FACE,
                           True)
     DOM.setInnerHTML(self.face, html)
     self.button.updateButtonFace()
    def __init__(self,
                 min_value,
                 max_value,
                 start_value=None,
                 step=None,
                 **ka):

        ka["StyleName"] = ka.get('StyleName', "gwt-VerticalSlider")

        # XXX FIXME: Focus.createFocusable is here for a reason...
        element = ka.pop('Element', None) or Focus.createFocusable()
        DOM.setStyleAttribute(element, "position", "relative")
        DOM.setStyleAttribute(element, "overflow", "hidden")

        self.handle = DOM.createDiv()
        DOM.appendChild(element, self.handle)

        self.setHandleStyle("1px", "100%", "10px", "#808080")

        Control.__init__(self, element, min_value, max_value, start_value,
                         step, **ka)

        self.addClickListener(self)
        self.addFocusListener(self)
        self.addMouseListener(self)
예제 #20
0
    def __init__(self, **kwargs):
        element = DOM.createDiv()
        self.setElement(element)

        self.object_id = 'FlashObject'
        """ id of the object-tag. Default: FlashObject """
        self.object_class = None
        """ The class-name of the object-tag. Default: None"""
        self.object_width = None
        """ The width-parameter of the object-tag. Default: None"""
        self.object_height = None
        """ The height-parameter of the object-tag. Default: None"""
        self.flash_url = None
        """ The Flash-Movie url. Default: None"""
        self.wmode = None #'window'
        """ The flashmovie wmode parameter. Default: None"""
        self.quality = 'high'
        """ The flashmovie quality parameter. Default: high"""
        self.menu = None # 'false'
        """ The flashmovie wmode parameter. Default: None"""
        self.allowScriptAccess = 'always'
        """ The flashmovie allowscriptaccess parameter. Default: always"""
        self.allowFullscreen = 'false'
        """ The flashmovie allowfullscreen parameter. Default: False"""
        self.bgColor = '#FFFFFF'
        """ The flashmovie bgcolor parameter. Default: #FFFFFF (white)"""
        self.flashvars = ''
        self.browser = browser()
        #log.debug('FlashPanel loaded on %s' % self.browser)

        Panel.__init__(self, **kwargs)
예제 #21
0
    def __init__(self,
                 text="",
                 asHTML=False,
                 targetHistoryToken="",
                 Element=None,
                 **kwargs):

        self.targetHistoryToken = ""

        if not Element:
            Element = DOM.createDiv()
        self.anchorElem = DOM.createAnchor()
        self.setElement(Element)
        DOM.appendChild(self.getElement(), self.anchorElem)

        if not kwargs.has_key('StyleName'):
            kwargs['StyleName'] = "gwt-Hyperlink"
        if text:
            if asHTML:
                kwargs['HTML'] = text
            else:
                kwargs['Text'] = text
        if targetHistoryToken:
            kwargs['TargetHistoryToken'] = targetHistoryToken

        Widget.__init__(self, **kwargs)
        ClickHandler.__init__(self)
예제 #22
0
    def __init__(self, min_value, max_value,
                 start_value=None, step=None,
                 **kwargs):

        if not kwargs.has_key("StyleName"):
            kwargs['StyleName'] = "gwt-VerticalSlider"

        if kwargs.has_key('Element'):
            # XXX FIXME: Focus.createFocusable is here for a reason...
            element = kwargs.pop('Element')
        else:
            element = Focus.createFocusable()
        DOM.setStyleAttribute(element, "position", "relative")
        DOM.setStyleAttribute(element, "overflow", "hidden")

        self.handle = DOM.createDiv()
        DOM.appendChild(element, self.handle)

        self.setHandleStyle("1px", "100%", "10px", "#808080")

        # must use DoubleControl; otherwise, this init is = Vertical init,
        # plus a change in the handle style
        # this should be refactored, so that the AreaSlider
        # can be built on VerticalSlider
        DoubleControl.__init__(self, element, min_value, max_value,
                               start_value, step,
                               **kwargs)

        self.addClickListener(self)
        self.addFocusListener(self)
        self.addMouseListener(self)

        #Redefine VDS's styles for handle
        self.setHandleStyle("1px", "10px", "10px", "#808080")
예제 #23
0
파일: Controls.py 프로젝트: emk/pyjamas
    def __init__(self, min_value, max_value, start_value=None, step=None,
                       **kwargs):

        if not kwargs.has_key("StyleName"): kwargs['StyleName'] = "gwt-VerticalSlider"

        if kwargs.has_key('Element'):
            # XXX FIXME: Focus.createFocusable is here for a reason...
            element = kwargs.pop('Element')
        else:
            element = Focus.createFocusable()
        DOM.setStyleAttribute(element, "position", "relative")
        DOM.setStyleAttribute(element, "overflow", "hidden")

        self.handle = DOM.createDiv()
        DOM.appendChild(element, self.handle)

        DOM.setStyleAttribute(self.handle, "border", "1px")
        DOM.setStyleAttribute(self.handle, "width", "100%")
        DOM.setStyleAttribute(self.handle, "height", "10px")
        DOM.setStyleAttribute(self.handle, "backgroundColor", "#808080")

        Control.__init__(self, element, min_value, max_value, start_value, step,
                               **kwargs)

        self.addClickListener(self)
        self.addFocusListener(self)
        self.addMouseListener(self)
예제 #24
0
파일: FlowPanel.py 프로젝트: emk/pyjamas
 def __init__(self, **kwargs):
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     else:
         element = DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **kwargs)
예제 #25
0
 def show(self):
     if self.hasBackground:
         self.background = Widget(Element=DOM.createDiv(), StyleName='diaglog_coverup')
         self.background.setHeight(RootPanel().getOffsetHeight())
         RootPanel().add(self.background)
     DialogBox.show(self)
     
예제 #26
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)
예제 #27
0
    def __init__(self, vertical=False, **kwargs):
        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-MenuBar"

        self.body = None
        self.items = []
        self.parentMenu = None
        self.popup = None
        self.selectedItem = None
        self.shownChildMenu = None
        self.vertical = False
        self.autoOpen = False

        if kwargs.has_key('Element'):
            table = kwargs.pop('Element')
            fc = DOM.getFirstChild(table)
            if fc:
                self.body = fc
            else:
                self.body = DOM.createTBody()
                DOM.appendChild(table, self.body)
        else:
            table = DOM.createTable()
        self.body = DOM.createTBody()
        DOM.appendChild(table, self.body)

        if not vertical:
            tr = DOM.createTR()
            DOM.appendChild(self.body, tr)

        self.vertical = vertical

        outer = DOM.createDiv()
        DOM.appendChild(outer, table)
        self.setElement(outer)
        Widget.__init__(self, **kwargs)
예제 #28
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
예제 #29
0
파일: PopupPanel.py 프로젝트: Afey/pyjs
    def __init__(self, autoHide=False, modal=True, rootpanel=None, glass=False,
                **kwargs):

        self.popupListeners = []
        self.showing = False
        self.autoHide = autoHide
        kwargs['Modal'] = kwargs.get('Modal', modal)

        if rootpanel is None:
            rootpanel = RootPanel()
        self.rootpanel = rootpanel

        self.glass = glass
        if self.glass:
            self.glass = DOM.createDiv()
            if not 'GlassStyleName' in kwargs:
                kwargs['GlassStyleName'] = "gwt-PopupPanelGlass"

        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')
        else:
            element = self.createElement()
        DOM.setStyleAttribute(element, "position", "absolute")

        SimplePanel.__init__(self, element, **kwargs)

        if glass:
            self.setGlassEnabled(True)
            if 'GlassStyleName' in kwargs:
                self.setGlassStyleName(kwargs.pop('GlassStyleName'))
예제 #30
0
    def __init__(self, vertical=False, **kwargs):
        self.setVertical(kwargs.pop('Vertical', vertical))
        if 'StyleName' not in kwargs or kwargs['StyleName'] == 'gwt-MenuBar':
            kwargs['StyleName'] = self.getDefaultStyleName()
        self.body = None
        self.items = []
        self.parentMenu = None
        self.popup = None
        self.selectedItem = None
        self.shownChildMenu = None
        self.autoOpen = False
        self.itemsPerRow = None

        if kwargs.has_key('Element'):
            table = kwargs.pop('Element')
            fc = DOM.getFirstChild(table)
            if fc:
                self.body = fc
            else:
                self.body = DOM.createTBody()
                DOM.appendChild(table, self.body)
        else:
            table = DOM.createTable()
            DOM.setAttribute(table, "cellPadding", "0")
            DOM.setAttribute(table, "cellSpacing", "0")
        self.body = DOM.createTBody()
        DOM.appendChild(table, self.body)

        outer = DOM.createDiv()
        DOM.appendChild(outer, table)
        self.setElement(outer)
        Widget.__init__(self, **kwargs)
예제 #31
0
파일: PopupPanel.py 프로젝트: Afey/pyjs
 def setGlassEnabled(self, enabled):
     if enabled:
         if self.glass is None:
             self.glass = DOM.createDiv()
             self.setGlassStyleName()
     elif self.glass is not None:
         self.hideGlass()
예제 #32
0
파일: Tree.py 프로젝트: anandology/pyjamas
    def __init__(self, **ka):
        ka['StyleName'] = ka.get('StyleName', "gwt-Tree")

        self.root = None
        self.childWidgets = Set()
        self.curSelection = None
        self.focusable = None
        self.focusListeners = []
        self.mouseListeners = []
        self.imageBase = pygwt.getModuleBaseURL()
        self.keyboardListeners = []
        self.listeners = []
        self.lastEventType = ""

        element = ka.pop('Element', None) or DOM.createDiv()
        self.setElement(element)
        DOM.setStyleAttribute(self.getElement(), "position", "relative")
        self.focusable = Focus.createFocusable()
        # Hide focus outline in Mozilla/Webkit/Opera
        DOM.setStyleAttribute(self.focusable, "outline", "0px")
        # Hide focus outline in IE 6/7
        DOM.setElemAttribute(self.focusable, "hideFocus", "true");

        DOM.setStyleAttribute(self.focusable, "fontSize", "0")
        DOM.setStyleAttribute(self.focusable, "position", "absolute")
        DOM.setIntStyleAttribute(self.focusable, "zIndex", -1)
        DOM.appendChild(self.getElement(), self.focusable)

        self.root = RootTreeItem()
        self.root.setTree(self)

        Widget.__init__(self, **ka)

        self.sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS)
        DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS)
예제 #33
0
파일: CustomButton.py 프로젝트: Afey/pyjs
 def setHTML(self, html):
     """Set the face's contents as html."""
     self.face = DOM.createDiv()
     UIObject.setStyleName(self.button, self.face, self.STYLENAME_HTML_FACE,
                           True)
     DOM.setInnerHTML(self.face, html)
     self.button.updateButtonFace()
예제 #34
0
    def __init__(self, vertical=False, **kwargs):
        self.setVertical(kwargs.pop('Vertical', vertical))
        if 'StyleName' not in kwargs or kwargs['StyleName'] == 'gwt-MenuBar':
            kwargs['StyleName'] = self.getDefaultStyleName()
        self.body = None
        self.items = []
        self.parentMenu = None
        self.popup = None
        self.selectedItem = None
        self.shownChildMenu = None
        self.autoOpen = False

        if kwargs.has_key('Element'):
            table = kwargs.pop('Element')
            fc = DOM.getFirstChild(table)
            if fc:
                self.body = fc
            else:
                self.body = DOM.createTBody()
                DOM.appendChild(table, self.body)
        else:
            table = DOM.createTable()
        self.body = DOM.createTBody()
        DOM.appendChild(table, self.body)

        outer = DOM.createDiv()
        DOM.appendChild(outer, table)
        self.setElement(outer)
        Widget.__init__(self, **kwargs)
예제 #35
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'))
 def showInfo(self, sender):
     if sender.block.name in ['commandType', 'numericType', 'logicType', 'alphaNumericType']:
         createdBlocks[sender.block.varName].show()
     else:
         popup = Popup('<b>Ajuda</b>', None, None)
         popup.center.append(Widget(Element=DOM.createDiv(), StyleName=sender.classHelp))
         popup.caption.setStyleAttribute('text-align', 'center')
         popup.show()
예제 #37
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')
예제 #38
0
 def __init__(self, **kwargs):
     self.visibleWidget = None
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     else:
         element = DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **kwargs)
예제 #39
0
 def __init__(self, **kwargs):
     self.visibleWidget = None
     if kwargs.has_key("Element"):
         element = kwargs.pop("Element")
     else:
         element = DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **kwargs)
 def __addLogElement(self):
     """Add a container in the DOM where logging output will be written to.
     This cannot be done in the constructor as it must happen late enough
     to ensure a document body (to add an element to) does already exist."""
     if self.div == None:
         self.div = DOM.createDiv()
         self.div.setAttribute('id', self.div_id)
         DOM.appendChild(doc().body, self.div)
 def __addLogElement(self):
     """Add a container in the DOM where logging output will be written to.
     This cannot be done in the constructor as it must happen late enough
     to ensure a document body (to add an element to) does already exist."""
     if self.div == None:
         self.div = DOM.createDiv()
         self.div.setAttribute('id', self.div_id)
         DOM.appendChild(doc().body, self.div)
예제 #42
0
 def __init__(self, **kwargs):
     element = None
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     if element is None:
         element = DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **kwargs)
예제 #43
0
 def __init__(self, name, color):
     Element.__init__(self, Element=DOM.createDiv())
     self.addStyleName('block')
     self.holderArguments = []
     self.ge = GroupElement()
     self.varName = name
     self.color = color
     self.dropDownVarName = None
예제 #44
0
    def __init__(self, name, **kwargs):
        if kwargs.has_key('Element'):
            div = kwargs.pop('Element')
        else:
            div = DOM.createDiv()
        DOM.setInnerHTML(div, "<iframe name='" + name + "'>")

        iframe = DOM.getFirstChild(div)
        Frame.__init__(self, None, iframe, **kwargs)
예제 #45
0
 def setText(self, text):
     """
     Sets the face's contents as text.
     @param text text to set as face's contents
     """
     self.face = DOM.createDiv()
     UIObject.setStyleName(self.button, self.face, self.STYLENAME_HTML_FACE, True)
     DOM.setInnerText(self.face, text)
     self.button.updateButtonFace()
예제 #46
0
파일: wordbox.py 프로젝트: davelab6/telaro
 def createBoxes(self):
     while self.table.getWidgetCount():
         self.table.remove(0)
     for w in self.words:
         el = DOM.createDiv()
         DOM.setStyleAttribute(el, "float", "left")
         wid = HTML(w, Element=el, 
                     StyleName="flowpanelword")
         self.table.add(wid)
예제 #47
0
 def __init__(self, **kwargs):
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     else:
         element = DOM.createDiv()
     self.setElement(element)
     DOM.setStyleAttribute(self.getElement(), "position", "relative")
     DOM.setStyleAttribute(self.getElement(), "overflow", "hidden")
     ComplexPanel.__init__(self, **kwargs)
예제 #48
0
파일: HTMLPanel.py 프로젝트: Afey/pyjs
 def __init__(self, html, **ka):
     # NOTE! don't set a default style on this panel, because the
     # HTML might expect to have one already.  Explicitly add a StyleName
     # if one is needed.
     #if not ka.has_key('StyleName'): ka['StyleName']="gwt-HTMLPanel"
     if html: ka['HTML'] = html
     element = ka.pop('Element', None) or DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **ka)
예제 #49
0
 def __init__(self, arg, block, up=False):
     Element.__init__(self, Element=DOM.createDiv(), StyleName='holder')
     self.block = block
     self.up = up  #nao faz sentido aqui, passar para o argumento
     self.subBlock = None
     self.argument = arg
     self.append(self.argument)
     self.argument.addDropListener(self)
     self.argument.block = block
예제 #50
0
파일: CustomButton.py 프로젝트: Afey/pyjs
 def getFace(self):
     """Gets the contents associated with this face."""
     if self.face is not None:
         return self.face
     if self.delegateTo is not None:
         return self.delegateTo.getFace()
     # provide a default face as none was supplied.
     self.face = DOM.createDiv()
     return self.face
예제 #51
0
파일: lightout.py 프로젝트: jaredly/pyjamas
 def __init__(self,i,j):
     self.i = i
     self.j = j
     self.light = True
     element = DOM.createDiv()
     #DOM.setInnerHTML(element,'<b>%i%i</b>' % (i,j))
     FocusWidget.__init__(self, element)
     self.redraw()
     self.addClickListener(self)
예제 #52
0
파일: HTML.py 프로젝트: certik/pyjamas
 def __init__(self, html=None, wordWrap=True, Element=None, **kwargs):
     if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-HTML"
     if html: kwargs['HTML'] = html
     kwargs['WordWrap'] = wordWrap
     if Element is None:
         Element = DOM.createDiv()
     self.setElement(Element)
     Label.__init__(self, **kwargs)
     self.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS)
예제 #53
0
파일: HTMLPanel.py 프로젝트: certik/pyjamas
 def __init__(self, html, **kwargs):
     # NOTE! don't set a default style on this panel, because the
     # HTML might expect to have one already.
     #if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-HTMLPanel"
     if html: kwargs['HTML'] = html
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     else:
         element = DOM.createDiv()
     self.setElement(element)
     ComplexPanel.__init__(self, **kwargs)
    def __init__(self, title, titleStyle=None, imgStyle=None,
                             rowStyles=None,
                             containerIndex=2, titleIndex=1,
                             **kwargs) :
        if rowStyles is None:
            rowStyles = ["top", "top2", "middle", "bottom"]

        if titleStyle is None:
            titleStyle = "title"

        DecoratorPanel.__init__(self, rowStyles, containerIndex, **kwargs)

        inner = self.getCellElement(titleIndex, 1)
        if imgStyle:
            img = DOM.createDiv()
            DOM.setAttribute(img, "className", imgStyle)
            DOM.appendChild(inner, img)
        tdiv = DOM.createDiv()
        DOM.setAttribute(tdiv, "className", titleStyle)
        DOM.setInnerText(tdiv, title)
        DOM.appendChild(inner, tdiv)
 def createTD(self, styleName) :
     """ Create a new table cell with a specific style name.
      
         @param styleName the style name
         @return the new cell {@link Element}
     """
     tdElem = DOM.createTD()
     inner = DOM.createDiv()
     DOM.appendChild(tdElem, inner)
     self.setStyleName(tdElem, styleName)
     self.setStyleName(inner, styleName + "Inner")
     return tdElem
예제 #56
0
파일: Label.py 프로젝트: Afey/pyjs
    def __init__(self, text=None, wordWrap=True, **kwargs):
        kwargs['StyleName'] = kwargs.get('StyleName', "gwt-Label")
        kwargs['WordWrap'] = kwargs.get('WordWrap', wordWrap)
        kwargs['HorizontalAlignment'] = kwargs.get('HorizontalAlignment', "")
        if text:
            kwargs['Text'] = text
        self.setElement(kwargs.pop('Element', None) or DOM.createDiv())
        self.horzAlign = ""

        Widget.__init__(self, **kwargs)
        MouseHandler.__init__(self)
        ClickHandler.__init__(self)
예제 #57
0
    def __init__(self, min_value, max_value, start_value=None):

        element = DOM.createDiv()
        FocusWidget.__init__(self, element)

        self.min_value = min_value
        self.max_value = max_value
        if start_value is None:
            start_value = min_value
        self.value = start_value
        self.valuechange_listeners = []
        
        DOM.setStyleAttribute(element, "position", "relative")
        DOM.setStyleAttribute(element, "overflow", "hidden")

        self.handle = DOM.createDiv()
        DOM.appendChild(element, self.handle)

        DOM.setStyleAttribute(self.handle, "border", "1px")
        DOM.setStyleAttribute(self.handle, "width", "100%")
        DOM.setStyleAttribute(self.handle, "height", "10px")
        DOM.setStyleAttribute(self.handle, "backgroundColor", "#808080")

        self.addClickListener(self)
예제 #58
0
    def __init__(self):
        RichTextAreaImpl.__init__(self)
        """*
        * Holds a cached copy of any user setHTML/setText actions until the real
        * text area is fully initialized.  Becomes <code>None</code> after init.
        """
        self.beforeInitPlaceholder = DOM.createDiv()

        """*
        * Set to True when the {@link RichTextArea} is attached to the page and
        * {@link #initElement()} is called.  If the {@link RichTextArea} is detached
        * before {@link #onElementInitialized()} is called, this will be set to
        * False.  See issue 1897 for details.
        """
        self.initializing = False