Beispiel #1
0
 def __init__(self, SW, SH):
     HorizontalPanel.__init__(self)
     self.SW = SW
     self.SH = SH
     self.context = GWTCanvas(SW, SH, SW, SH)
     self.context.addStyleName("gwt-canvas")
     self.add(self.context)
 def __init__(self, labelname, contenthtml, labelnamesuffix=': ', ensure_labelnamesuffix=True):
     HorizontalPanel.__init__(self)
     if ensure_labelnamesuffix and not labelname.endswith(labelnamesuffix):
         labelname += labelnamesuffix
     self.add(Label(labelname, StyleName=Styles.CONTENTITEM_COMPONENT_LABEL))
     self.add(HTML(contenthtml, StyleName=Styles.CONTENTITEM_COMPONENT_CONTENT))
     return
 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()
Beispiel #4
0
 def __init__(self, token_index, target_word):
     HorizontalPanel.__init__(self)
     self.token_index = token_index
     self.table = FlexTable()
     self.label = Label(target_word)
     self.textbox = TextBox()
     self.add(self.label)
     self.add(self.textbox)
Beispiel #5
0
    def __init__(self):
        HorizontalPanel.__init__(self)

        History.newItem("test")
        show = Button("Show deep link", self.showDL)
        setDL = Button("Set deep link to 'pyjamas'", self.setDL)
        self.add(setDL)
        self.add(show)
Beispiel #6
0
    def __init__(self):
        HorizontalPanel.__init__(self)

        History.newItem("test")
        show = Button("Show deep link", self.showDL)
        setDL = Button("Set deep link to 'pyjamas'", self.setDL)
        self.add(setDL)
        self.add(show)
Beispiel #7
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Directly add in bulk:', StyleName='section'))
     self.names = TextArea(VisibleLines=5)
     self.add(self.names)
     self.update = Button('Add', self)
     self.add(self.update)
     self.err = HTML()
     self.add(self.err)
Beispiel #8
0
 def __init__(self, token_index, target_word, options):
     HorizontalPanel.__init__(self)
     self.token_index = token_index
     self.table = FlexTable()
     self.label = Label(target_word + ":\t")
     self.dropdown = ListBox()
     for option in options:
         self.dropdown.addItem(option)
     self.add(self.label)
     self.add(self.dropdown)
Beispiel #9
0
 def __init__(self, query, nUsers, tabName, topPanel):
     HorizontalPanel.__init__(self)
     self.button = Button('Compose tweet', self,
                          StyleName='compose-tweet-button')
     self.add(self.button)        
     self.link = HTML()
     self.add(self.link)
     self.popup = TweetPopup(self.__class__.__name__,
                             query, nUsers, tabName, self, topPanel)
     self.popup.setText('Compose a tweet')
Beispiel #10
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Cancel:', StyleName='section'))
     self.name = TextBox()
     self.name.setMaxLength(18)
     self.name.setVisibleLength(18)
     self.add(self.name)
     self.cancel = Button('Do it', self)
     self.add(self.cancel)
     self.err = Label()
     self.add(self.err)
Beispiel #11
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Directly add:', StyleName='section'))
     self.name = TextBox()
     self.name.setMaxLength(18)
     self.name.setVisibleLength(18)
     self.add(self.name)
     self.update = Button('Add', self)
     self.add(self.update)
     self.err = Label()
     self.add(self.err)
Beispiel #12
0
 def __init__(self, chart, **kwargs):
     self.chart = chart
     HorizontalPanel.__init__(self, **kwargs)
     self.bzoomIn = Button("<big>+</big>", self)
     self.bzoomOut = Button("<big>-</big>", self)
     self.bzoomIn.setTitle(
     "Zoom in (expands selected region so it fills plot area)")
     self.bzoomOut.setTitle(
     "Zoom out (shrinks plot area so it fits in selected region)")
     self.add(self.bzoomIn)
     self.add(self.bzoomOut)
Beispiel #13
0
    def __init__(self):
        HorizontalPanel.__init__(self)
        #self.setSpacing('10px')

        pool = StudentContainer(1, 20, 'pool_1')
        for item in [['Fred', 12], ['Jane', 10], ['Sam', 18], ['Ginger', 8],
                     ['Mary', 4]]:
            pool.addStudent(name=item[0], age=item[1])
        self.append(pool)
        self.append(StudentContainer(6, 13, 'pool_2'))
        self.append(StudentContainer(11, 20, 'pool_3'))
        self.setSpacing('10px')
Beispiel #14
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Dispatch:', StyleName='section'))
     self.pause = Button('Pause', self)
     self.add(self.pause)
     self.resume = Button('Resume', self)
     self.add(self.resume)
     self.refresh = Button('Refresh', self, StyleName='refresh')
     self.add(self.refresh)
     self.err = Label()
     self.add(self.err)
     self._refresh()
Beispiel #15
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Queue size:', StyleName='section'))
     self.underway = Label()
     self.add(self.underway)
     self.queued = Label()
     self.add(self.queued)
     self.button = Button('Refresh', self, StyleName='refresh')
     self.add(self.button)
     self.err = Label()
     self.add(self.err)
     self.update()
Beispiel #16
0
    def __init__(self):
        HorizontalPanel.__init__(self)
        #self.setSpacing('10px')

        pool = StudentContainer(1, 20, 'pool_1')
        for item in [['Fred', 12], ['Jane', 10], ['Sam', 18],
                     ['Ginger', 8], ['Mary', 4]]:
            pool.addStudent(name=item[0], age=item[1])
        self.append(pool)
        self.append(StudentContainer(6, 13, 'pool_2'))
        self.append(StudentContainer(11, 20, 'pool_3'))
        self.setSpacing('10px')
Beispiel #17
0
 def __init__(self, chart):
     self.chart = chart
     HorizontalPanel.__init__(self)
     # y-changing, x,y coordinate displaying, widget
     self.incrementY = Button("Increment Y")
     self.coordinates = HTML(""); # x,y of selected point
     self.decrementY = Button("Decrement Y")
     self.incrementY.addClickListener(self)
     self.decrementY.addClickListener(self)
     self.add(self.incrementY)
     self.add(self.coordinates)
     self.add(self.decrementY)
Beispiel #18
0
 def __init__(self, chart):
     self.chart = chart
     HorizontalPanel.__init__(self)
     # y-changing, x,y coordinate displaying, widget
     self.incrementY = Button("Increment Y")
     self.coordinates = HTML("")
     # x,y of selected point
     self.decrementY = Button("Decrement Y")
     self.incrementY.addClickListener(self)
     self.decrementY.addClickListener(self)
     self.add(self.incrementY)
     self.add(self.coordinates)
     self.add(self.decrementY)
 def __init__( self ):
     HorizontalPanel.__init__( self )
     self.setWidth( W_FRAME )
     self.nameListBox = NameListBox()
     self.nameTag = HTML( "<b>Choose User:</b>" )
     self.numPointsListBox = NumPointsListBox()
     self.npTag = HTML( "<b>Number of Points:</b>" )
     self.statusHTML = HTML( "" )
     self.add( self.nameTag )
     self.add( self.nameListBox )
     self.add( self.npTag )
     self.add( self.numPointsListBox )
     self.add( self.statusHTML )
Beispiel #20
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label("Queued:", StyleName="section"))
     s = ScrollPanel()
     self.add(s)
     v = VerticalPanel()
     s.add(v)
     self.queued = Grid(StyleName="users")
     v.add(self.queued)
     self.button = Button("Refresh", self, StyleName="refresh")
     self.add(self.button)
     self.err = Label()
     self.add(self.err)
     self.update()
Beispiel #21
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Underway:', StyleName='section'))
     s = ScrollPanel()
     self.add(s)
     v = VerticalPanel()
     s.add(v)
     self.queued = Grid(StyleName='users')
     v.add(self.queued)
     self.button = Button('Refresh', self, StyleName='refresh')
     self.add(self.button)
     self.err = Label()
     self.add(self.err)
     self.update()
Beispiel #22
0
    def __init__(self, **kwargs):
        GMWevents.events.addPatientSelectedListener(self)
        HorizontalPanel.__init__(self, **kwargs)

        self.patientphoto = Image("images/empty-face-in-bust.png")
        self.searchbox = TextBox(Text="<search patient here>")
        self.search_button = Button("Search", self)
        self.lblcave = Label()
        self.lblcave.setText("cave")
        self.allergybox = TextBox(Text="allergies")
        self.add(self.patientphoto)
        self.add(self.searchbox)
        self.add(self.search_button)
        self.add(self.lblcave)
        self.add(self.allergybox)
    def __init__(self, contentitem, onPublish, onLike, onDislike):
        """Create a ContentItemToolbar.

        Event handlers should be methods that take: sender
        """
        HorizontalPanel.__init__(self)
        self.contentitem = contentitem
        self.publishBtn = Button('Publish', listener=onPublish, StyleName=Styles.TOOLBAR_BUTTON)
        self.add(self.publishBtn)
        self.likeBtn = Button('FOO', listener=onLike, StyleName=Styles.TOOLBAR_BUTTON)
        self.add(self.likeBtn)
        self.dislikeBtn = Button('Dislike', listener=onDislike, StyleName=Styles.TOOLBAR_BUTTON)
        self.add(self.dislikeBtn)
        self.updateStatusFromItem()
        return
Beispiel #24
0
    def __init__(self, screennames, nUsers, topPanel):
        HorizontalPanel.__init__(self)
        self.screennames = screennames
        self.nUsers = nUsers
        self.topPanel = topPanel
        
        self.add(HTML(_title, StyleName='result-detail'))
        
        self.withButton = Button(_withAtText, self, StyleName='with-at-button')
        self.add(self.withButton)

        self.withoutButton = Button(_withoutAtText, self,
                                    StyleName='without-at-button')
        self.add(self.withoutButton)
        
        self.link = HTML()
        self.add(self.link)
Beispiel #25
0
    def __init__(self, handle, idx, checkOptions = [False, True]):
        HorizontalPanel.__init__(self)
        self.log = logging.getConsoleLogger(type(self).__name__, lev)
        self.log.disabled = False
        self.log.debug('__init__: Instantiation')
        self.idx = idx
        self._handle = handle
        self._checkOptions = checkOptions
        self.setStyleName('os-mech-checkbox-options')
        #checkbox = CheckBox('symbol')
        #checkbox.setChecked(checkOptions[0])
        #checkbox.addClickListener(self.onClickOption)
        #checkbox.setID('CBSY%d'%idx)
        #self.append(checkbox)
        #checkbox = CheckBox('value')
        #checkbox.setChecked(checkOptions[1])
        #checkbox.addClickListener(self.onClickOption)
        #checkbox.setID('CBVA%d'%idx)
        #self.append(checkbox)
        
        self._textBoxRatio = TextBox('1:1')
        self._ratioCache = self._textBoxRatio.getText()
        self._textBoxRatio.setTitle('Ratio')
        self._ratioCache = self._textBoxRatio.getText()
        
        self._textBoxRatio.addChangeListener(self.onRatioChange) 
        self._textBoxRatio.setID('TXRT%d'%idx)
        self._textBoxRatio.setStyleName('os-mech-textbox-ratio')
        
        self._listBoxSize = ListBox()
        self._listBoxSize.addChangeListener(self.onSizeSet)
        self._listBoxSize.setVisibleItemCount(1)
        self._listBoxSize.setStyleName('os-mech-listbox-size')

        self._listBoxUnit = ListBox()
        self._listBoxUnit.addChangeListener(self.onUnitSet)
        self._listBoxUnit.setVisibleItemCount(1)
        self._listBoxUnit.setStyleName('os-mech-listbox-unit')

        self.append(Label('Ratio'))
        self.append(self._textBoxRatio)
        self.append(Label('Size'))
        self.append(self._listBoxSize)
        self.append(Label('Unit'))
        self.append(self._listBoxUnit)
Beispiel #26
0
    def __init__(self):
        HorizontalPanel.__init__(self)
        left = DropWidget6()
        right = DropWidget6()
        self.setSpacing('10px')

        drag = DragWidget6("Drag1")
        drag2 = DragWidget6("Drag2")
        left.add(drag2)
        drag2.setStyleAttribute('top', 0)
        drag2.setStyleAttribute('left', 0)
        makeDraggable(drag2)
        left.add(drag)
        drag.setStyleAttribute('top', 0)
        drag.setStyleAttribute('left', 100)
        makeDraggable(drag)

        self.add(left)
        self.add(right)
Beispiel #27
0
    def __init__(self):
        HorizontalPanel.__init__(self)
        left = DropWidget6()
        right = DropWidget6()
        self.setSpacing('10px')

        drag = DragWidget6("Drag1")
        drag2 = DragWidget6("Drag2")
        left.add(drag2)
        drag2.setStyleAttribute('top', 0)
        drag2.setStyleAttribute('left', 0)
        makeDraggable(drag2)
        left.add(drag)
        drag.setStyleAttribute('top', 0)
        drag.setStyleAttribute('left', 100)
        makeDraggable(drag)

        self.add(left)
        self.add(right)
Beispiel #28
0
 def __init__(self):
     HorizontalPanel.__init__(self, Spacing=4)
     self.add(Label('Results limit:', StyleName='section'))
     self.value = Label()
     self.add(self.value)
     self.newValue = TextBox()
     self.newValue.setMaxLength(5)
     self.newValue.setVisibleLength(5)
     self.add(self.newValue)
     self.update = Button('Update', ResultsUpdate(self))
     self.add(self.update)
     displayer = ResultsDisplay(self)
     self.refresh = Button('Refresh', displayer, StyleName='refresh')
     self.add(self.refresh)
     self.err = Label()
     self.add(self.err)
     remote = server.AdminService()
     id = remote.getResultsLimit(displayer)
     if id < 0:
         self.err.setText('oops: could not call getResultsLimit')
Beispiel #29
0
    def __init__(self, minvalue=0, maxvalue=100, startvalue=10, interval=1, buttonStyleName=None, decrText='<',
                 incrText='>', **kwargs):
        HorizontalPanel.__init__(self, **kwargs)
        self.minvalue = minvalue
        self.maxvalue = maxvalue
        self.interval = interval
        self.changeListeners = []

        self.lessButton = Button(decrText, listener=self._onArrowClick, StyleName=buttonStyleName)
        self.add(self.lessButton)
        self.textbox = TextBox()
        self.textbox.addInputListener(self._onTextboxInput)
        self.add(self.textbox)

        self.moreButton = Button(incrText, listener=self._onArrowClick, StyleName=buttonStyleName)
        self.add(self.moreButton)

        self.value = startvalue + 1
        self.setValue(startvalue)
        return
Beispiel #30
0
    def __init__(self):
        try:
            HorizontalPanel.__init__(self)
            self.time = time.time()

            prevDayBtn = Button(" < ", self.onPrevDay)
            nextDayBtn = Button(" > ", self.onNextDay)
            prevWeekBtn = Button(" << ", self.onPrevWeek)
            nextWeekBtn = Button(" >> ", self.onNextWeek)
            self.dateBox = TextBox()
            self.dateBox.setMaxLength(10)
            self.dateBox.setVisibleLength(10)

            self.add(prevWeekBtn)
            self.add(prevDayBtn)
            self.add(self.dateBox)
            self.add(nextDayBtn)
            self.add(nextWeekBtn)
        except:
            raise
Beispiel #31
0
    def __init__(self):
        try:
            HorizontalPanel.__init__(self)
            self.time = time.time()
            self.date = None

            self.prevDayBtn = Button(" < ", self.onPrevDay)
            self.nextDayBtn = Button(" > ", self.onNextDay)
            self.prevWeekBtn = Button(" << ", self.onPrevWeek)
            self.nextWeekBtn = Button(" >> ", self.onNextWeek)
            self.dateBox = TextBox()
            self.dateBox.setMaxLength(10)
            self.dateBox.setVisibleLength(10)

            self.add(self.prevWeekBtn)
            self.add(self.prevDayBtn)
            self.add(self.dateBox)
            self.add(self.nextDayBtn)
            self.add(self.nextWeekBtn)
        except:
            raise
Beispiel #32
0
    def __init__(self, remote):
        HorizontalPanel.__init__(self, BorderWidth=0,
                                       HorizontalAlignment=HasAlignment.ALIGN_LEFT,
                                       VerticalAlignment=HasAlignment.ALIGN_TOP)

        # A panel to hold the main content
        self.middlePanel = VerticalPanel(BorderWidth=0,
                                         HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                                         VerticalAlignment=HasAlignment.ALIGN_TOP)

        # Some text
        self.heading = Label('An example html5App')
        self.shortExplanation = Label("""
On the right you see a HTML5 Canvas which updates syncronously.
Beneath is an example of communicating between the client and server
using JSON RPC.
""")

        # The text box and button to Add some stuff with JSON
        self.getObjectsButton = Button('Get Example objects!', self.getObjects)

        # A flex table for the example objects
        self.exampleTable = ExampleTable()

        # The JSON proxy service
        self.remote = remote

        # An analog clock demonstrating canvas usage
        self.clockCanvas = ClockCanvas('images/chrome_clock_and_numbers.png')

        # Assemble middlePanel
        self.middlePanel.add(self.heading)
        self.middlePanel.add(self.shortExplanation)
        self.middlePanel.add(self.getObjectsButton)
        self.middlePanel.add(self.exampleTable)

        # Assemble self
        self.add(self.clockCanvas)
        self.add(self.middlePanel)
Beispiel #33
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()
Beispiel #34
0
 def __init__(self):
     HorizontalPanel.__init__(self)
     self.context = GWTCanvas(300,300,300,300)
     self.context.addStyleName("gwt-canvas")
     self.add(self.context)
Beispiel #35
0
 def __init__(self):
     HorizontalPanel.__init__(self)
     self.context = GWTCanvas(300,300,300,300)
     self.context.addStyleName("gwt-canvas")
     self.add(self.context)
Beispiel #36
0
 def __init__(self, grid_size):
     HorizontalPanel.__init__(self)
     board = GameBoard(grid_size)
     self.add(board)
     self.setStyleName("hpanel")