def onModuleLoad(self):
        self.curInfo = ''
        self.curSink = None
        self.description = HTML()
        self.sink_list = SinkList()
        self.panel = DockPanel()

        self.loadSinks()
        self.sinkContainer = DockPanel()
        self.sinkContainer.setStyleName("ks-Sink")

        vp = VerticalPanel()
        vp.setWidth("100%")
        vp.add(self.description)
        vp.add(self.sinkContainer)

        self.description.setStyleName("ks-Info")

        self.panel.add(self.sink_list, DockPanel.WEST)
        self.panel.add(vp, DockPanel.CENTER)

        self.panel.setCellVerticalAlignment(self.sink_list,
                                            HasAlignment.ALIGN_TOP)
        self.panel.setCellWidth(vp, "100%")

        History().addHistoryListener(self)
        RootPanel().add(self.panel)
        RootPanel().add(Logger())

        #Show the initial screen.
        initToken = History().getToken()
        if len(initToken):
            self.onHistoryChanged(initToken)
        else:
            self.showInfo()
Ejemplo n.º 2
0
	def onModuleLoad(self):
		slot = RootPanel()
		calendar = SchoolCalendarWidget(15)
		slot.add(calendar)
			
		filterWidget = DayFilterWidget(calendar)
		slot.add(filterWidget)
    def onModuleLoad(self):
        self.singleton = self

        topPanel = TopPanel()
        rightPanel = VerticalPanel()
        self.mailDetail = MailDetail()
        self.shortcuts = Shortcuts()

        topPanel.setWidth("100%")

        # MailList uses Mail.get() in its constructor, so initialize it after
        # 'singleton'.
        mailList = MailList(self.singleton)
        mailList.setWidth("100%")
        
        # Create the right panel, containing the email list & details.
        rightPanel.add(mailList)
        rightPanel.add(self.mailDetail)
        mailList.setWidth("100%")
        self.mailDetail.setWidth("100%")

        # Create a dock panel that will contain the menu bar at the top,
        # the shortcuts to the left, and the mail list & details taking the rest.
        outer = DockPanel()
        outer.add(topPanel, DockPanel.NORTH)
        outer.add(self.shortcuts, DockPanel.WEST)
        outer.add(rightPanel, DockPanel.CENTER)
        outer.setWidth("100%")

        outer.setSpacing(4)
        outer.setCellWidth(rightPanel, "100%")

        # Hook the window resize event, so that we can adjust the UI.
        #FIXME need implementation # Window.addWindowResizeListener(this)
        #Window.addWindowResizeListener(self)

        # Get rid of scrollbars, and clear out the window's built-in margin,
        # because we want to take advantage of the entire client area.
        Window.enableScrolling(False)
        Window.setMargin("0px")
        
        # Finally, add the outer panel to the RootPanel, so that it will be
        # displayed.
        #RootPanel.get().add(outer) # FIXME get#
        RootPanel().add(outer)
        RootPanel().add(Logger())
        
        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        # FIXME - need implementation#
        #     DeferredCommand.add(onWindowResized(Window.getClientWidth(), Window.getClientHeight()))

        self.onWindowResized(Window.getClientWidth(), Window.getClientHeight())
Ejemplo n.º 4
0
 def onModuleLoad(self):
     slot = RootPanel("calendar")
     if slot:
         calendar = SchoolCalendarWidget(15)
         slot.add(calendar)
         
         slot = RootPanel("days")
         if slot:
             filterWidget = DayFilterWidget(calendar)
             slot.add(filterWidget)
Ejemplo n.º 5
0
    def onModuleLoad(self):
        self.page = 0
        self.min_page = 1
        self.max_page = 10

        self.add = Button("Next >", self)
        self.sub = Button("< Prev", self)

        self.g = Grid()
        self.g.resize(5, 5)
        self.g.setHTML(0, 0, "<b>Grid Test</b>")
        self.g.setBorderWidth(2)
        self.g.setCellPadding(4)
        self.g.setCellSpacing(1)

        self.updatePageDisplay()
        RootPanel().add(self.sub)
        RootPanel().add(self.add)
        RootPanel().add(self.g)
    def onModuleLoad(self):
        # Create a FormPanel and point it at a service.
        self.form = FormPanel()
        self.form.setAction("/chat-service/test/")

        # Because we're going to add a FileUpload widget, we'll need to set the
        # form to use the POST method, and multipart MIME encoding.
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)

        # Create a panel to hold all of the form widgets.
        panel = VerticalPanel()
        self.form.setWidget(panel)

        # Create a TextBox, giving it a name so that it will be submitted.
        self.tb = TextBox()
        self.tb.setName("textBoxFormElement")
        panel.add(self.tb)

        # Create a ListBox, giving it a name and some values to be associated with
        # its options.
        lb = ListBox()
        lb.setName("listBoxFormElement")
        lb.addItem("foo", "fooValue")
        lb.addItem("bar", "barValue")
        lb.addItem("baz", "bazValue")
        panel.add(lb)

        # Create a FileUpload widget.
        upload = FileUpload()
        upload.setName("uploadFormElement")
        panel.add(upload)

        # Add a 'submit' button.
        panel.add(Button("Submit", self))

        # Add an event handler to the form.
        self.form.addFormHandler(self)

        RootPanel.get().add(self.form)
 def onModuleLoad(self):
     b = Button("Click me", greet)
     RootPanel().add(b)
     if (1 or 0) and 0:
         RootPanel().add(Label("or FAILED"))
     else:
         RootPanel().add(Label("or OK"))
     if 0 & 1 == 0:
         RootPanel().add(Label("& OK"))
     else:
         RootPanel().add(Label("& FAILED"))
     if 1 | 1 != 1:
         RootPanel().add(Label("| FAILED"))
     else:
         RootPanel().add(Label("| OK"))
Ejemplo n.º 8
0
 def onModuleLoad(self):
     slot = RootPanel("calendar")
     Window.alert("slot:" + slot)
     if slot:
         calendar = SchoolCalendarWidget(15)
         Window.alert(len(slot.children))
         Window.alert(slot.children)
         slot.add(calendar)
         
         slot = RootPanel("days")
         if slot:
             filterWidget = DayFilterWidget(calendar)
             slot.add(filterWidget)
 def onModuleLoad(self):
     self.l = Label()
     RootPanel().add(self.l)
     self.display()
 def onModuleLoad(self):
     self.b = Button("function callback", onButtonClick)
     self.b2 = Button("object callback", self)
     RootPanel().add(self.b)
     RootPanel().add(self.b2)
Ejemplo n.º 11
0
 def onModuleLoad(self):
     b = Button("Click me", greet)
     RootPanel().add(b)