Beispiel #1
0
    def onModuleLoad(self):
        h = HTML("<b />Contest: ")
        self.contest.add(h)
        l = HTML("<b />Selection: ")
        self.selection.add(l)
#        self.mainPanel.add(self.button)
        self.mainPanel.add(self.contest)
        self.mainPanel.add(self.selection)
        
        panel = FocusPanel(Widget=self.mainPanel)
        gp = RootPanelListener(panel)
        manageRootPanel(gp)
        RootPanel().add(panel)
        panel.setFocus(True)
Beispiel #2
0
 def onModuleLoad(self):
     print "inside onModuleLoad"
     self.remote_py = JSONService()
     self.mainPanel.add(sampleBallot.title)
     self.mainPanel.add(sampleBallot.instructions)
     self.mainPanel.add(sampleBallot.contest)
     self.mainPanel.add(sampleBallot.candidate)
     self.mainPanel.add(sampleBallot.selection)
     self.mainPanel.add(sampleBallot.status)
     panel = FocusPanel(Widget=self.mainPanel)
     gp = RootPanelListener(panel)
     manageRootPanel(gp)
     RootPanel().add(panel)
     panel.setFocus(True)
     self.remote_py.passBallot(self)
Beispiel #3
0
    def onModuleLoad(self):
        self.remote_py = JSONService()
        h = HTML("<b />Contest: ")
        self.contest.add(h)
        l = HTML("<b />Selection: ")
        self.selection.add(l)
#        self.mainPanel.add(self.button)
        self.mainPanel.add(self.contest)
        self.mainPanel.add(self.selection)
        self.mainPanel.add(self.status)
        panel = FocusPanel(Widget=self.mainPanel)
        gp = RootPanelListener(panel)
        manageRootPanel(gp)
        RootPanel().add(panel)
        panel.setFocus(True)
#        self.remote_py.uppercase('yay', self)
        self.remote_py.passBallot(self)
Beispiel #4
0
    # as this is replacing the 'normal' usage of RootPanel(),
    # it is necessary to add this in 'by hand' so that the
    # window-close notification is 'hooked into', and so when
    # the browser window is closed, cleanups (onDetach) will
    # be triggered.
    #
    # calling manageRootPanel (with the default arg id=None)
    # also has the advantage that RootPanel(id=None) will
    # 'pick up' the above RootPanelListener instance, meaning
    # that you don't need to have a silly global variable
    # all over the place, you can just use the standard pyjamas
    # API as normal.
    #
    # kinda cute.

    manageRootPanel(gp)

    info = """Click anywhere in the Root (grey) to activate key input;
            click again to disable it.  Note the focus highlighting
            that occurs on the "Hello World" HTML box.
    <br /> <br />
    The CSS style has been set to 100% width
    and the margin to 100px.  Even though it is the "body" - root
    element, clicking outside the margin (indicated by the black border)
    will NOT activate key input.
    <br /><br />
    Note that many browsers screw up the sizes of the window when the
    margin is set as well as width or height to 100%, as evidenced by
    the black border being off the screen.  (Normally, you would add a
    WindowResize Listener which received the window size and then
    directly adjusted the CSS width and height of the body element
Beispiel #5
0
    # as this is replacing the 'normal' usage of RootPanel(),
    # it is necessary to add this in 'by hand' so that the
    # window-close notification is 'hooked into', and so when
    # the browser window is closed, cleanups (onDetach) will
    # be triggered.
    #
    # calling manageRootPanel (with the default arg id=None)
    # also has the advantage that RootPanel(id=None) will
    # 'pick up' the above RootPanelListener instance, meaning
    # that you don't need to have a silly global variable
    # all over the place, you can just use the standard pyjamas
    # API as normal.
    #
    # kinda cute.

    manageRootPanel(gp)

    info = """Click anywhere in the Root (grey) to activate key input;
            click again to disable it.  Note the focus highlighting
            that occurs on the "Hello World" HTML box.
    <br /> <br />
    The CSS style has been set to 100% width
    and the margin to 100px.  Even though it is the "body" - root
    element, clicking outside the margin (indicated by the black border)
    will NOT activate key input.
    <br /><br />
    Note that many browsers screw up the sizes of the window when the
    margin is set as well as width or height to 100%, as evidenced by
    the black border being off the screen.  (Normally, you would add a
    WindowResize Listener which received the window size and then
    directly adjusted the CSS width and height of the body element
            DOM.setStyleAttribute(self.resizeMonitor.getElement(), "display",
                                  "")
        else:
            DOM.setStyleAttribute(
                DOM.getParent(self.center.getWidgetTd(self.serialMonitor)),
                "display", "none")
            self.showHideMonitor.setStyleName('collapse close_up')
            DOM.setStyleAttribute(self.resizeMonitor.getElement(), "display",
                                  "none")

    def showHidePanelRight(self):
        if DOM.getStyleAttribute(self.mainPanel.getWidgetTd(self.cod),
                                 'display') == 'none':
            DOM.setStyleAttribute(self.mainPanel.getWidgetTd(self.cod),
                                  "display", "")
            self.showHideRight.setStyleName('control_bar close_right')
        else:
            DOM.setStyleAttribute(self.mainPanel.getWidgetTd(self.cod),
                                  "display", "none")
            self.showHideRight.setStyleName('control_bar open_left')


if __name__ == '__main__':
    pyjd.setup("./public/DuinoBlocks.html")
    manageRootPanel(RootPanelListener(StyleName='rootstyle'))
    RootPanel().add(ContainerUCA(getWorkspace()))
    pyjd.run()

    #C:\pyjs.git\trunk\pyjs\src\pyjs\boilerplate\all.cache.html alterado no comentario //rafael
    #..\scripts\bootstrap_progress.js alterado