コード例 #1
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)
コード例 #2
0
    def __init__(self):
        VerticalPanel.__init__(self)
        self.remoteproxy = JsonTaoggregatorService()
        self.totalitemcount = 0
        self.idToCallbackMap = {}

        createToolbar = lambda: HorizontalToolbar(self.onRequestMore, self.onCollapseAll, self.onExpandAll)
        topbar = createToolbar()
        self.add(topbar)

        self.contentpanel = ContentPanel(self.onCIPublish,
                                         lambda sen, ci: self.onCIAdjustLike(sen, ci, 1),
                                         lambda sen, ci: self.onCIAdjustLike(sen, ci, -1),
                                         self.onSort,
                                         self.onFilter)
        self.add(self.contentpanel)

        botbar = createToolbar()
        self.add(botbar)

        self.horiztoolbars = [topbar, botbar]

        self.lastOnSortArgs = None
        self.lastOnFilterArgs = None
        self.requestDownloadedContentCount()
        self.onRequestMore(None)
コード例 #3
0
ファイル: userlist.py プロジェクト: jdunck/Tickery
 def __init__(self, userListPanel, tabPanel, topPanel):
     VerticalPanel.__init__(self, StyleName='large-avatar-panel')
     self.userListPanel = userListPanel
     self.tabPanel = tabPanel
     self.topPanel = topPanel
     upperPanel = HorizontalPanel(StyleName='large-avatar-upper-panel',
                                  Spacing=8)
     self.image = Image(StyleName='large-avatar')
     self.upperText = HTML(StyleName='large-avatar-upper-text')
     upperPanel.add(self.image)
     upperPanel.add(self.upperText)
     self.add(upperPanel)
     self.lowerText = HTML(StyleName='large-avatar-lower-text')
     self.add(self.lowerText)
     self.followButton = None
     self.user = None
     insertPanel = HorizontalPanel(Spacing=3)
     insertPanel.add(Label('Use name: '))
     if tabPanel.tabName == 'simple':
         b1 = Button('upper', SimpleInserter(self, 'upper'))
         b2 = Button('lower', SimpleInserter(self, 'lower'))
         insertPanel.add(b1)
         insertPanel.add(b2)
     else:
         b1 = Button('or', QueryInserter(self, 'or'))
         b2 = Button('and', QueryInserter(self, 'and'))
         b3 = Button('except', QueryInserter(self, 'except'))
         insertPanel.add(b1)
         insertPanel.add(b2)
         insertPanel.add(b3)
     self.add(insertPanel)
コード例 #4
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
コード例 #5
0
ファイル: AccountListSink.py プロジェクト: fedenko/clientbank
 def __init__(self, hendler = None):
     VerticalPanel.__init__(self,
                            #HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                            #VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
                            Width="100%",
                            #Height="100%",
                            Spacing=5)
                            
     self.remote = DataService(['getaccounts'])        
                            
     self.grid = Grid(1, 3,
                 BorderWidth=1,
                 CellPadding=4,
                 CellSpacing=1,
                 StyleName="grid")
     self.grid.setText(0, 0, u"Number")
     self.grid.setText(0, 1, u"Type")
     self.grid.setText(0, 2, u"Balance")
     
     formatter = self.grid.getRowFormatter()
     formatter.setStyleName(0, "grid-header")
     
     self.add(Label(u"Accounts"))
     
     self.add(self.grid)
コード例 #6
0
ファイル: IntroSink.py プロジェクト: fedenko/clientbank
 def __init__(self):
     VerticalPanel.__init__(self,
                            HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                            VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
                            Width="100%",
                            Height="100%",
                            Spacing=5)
     self.add(Label(JS('gettext("Hello, \%username\%!")')))
コード例 #7
0
ファイル: pyjamas_driver.py プロジェクト: labase/jeppeto
 def __init__(self):
     """ Standard initialiser.
     """
     VerticalPanel.__init__(self)
     self.canvas = Raphael(900,700)
     self.add(self.canvas)
     x = DOM.getAbsoluteLeft(self.canvas.getElement())
     y = DOM.getAbsoluteTop(self.canvas.getElement())
     self.offset = (x,y)
コード例 #8
0
ファイル: userlist.py プロジェクト: jdunck/Tickery
 def __init__(self, tabPanel, topPanel, **kwargs):
     VerticalPanel.__init__(self, StyleName='user-list-panel', **kwargs)
     self.tabPanel = tabPanel
     self.topPanel = topPanel
     self.iconAdder = None
     self.iconPanel = None
     self.nSelected = 0
     self.leftPanelWidth = 340
     self.widthFudgeFactor = 25
コード例 #9
0
ファイル: jQuerySelect2.py プロジェクト: gonvaled/pyjs
 def __init__ (self, tags = None, width = 300, selected = None, myid = None):
     VerticalPanel.__init__(self)
     self.s2 = Select2TaggingComponent(tags, width, selected, myid)
     self.reset_button = Button("Reset", self)
     self.show_values_button = Button("Show", self)
     self.add(self.s2)
     self.add(self.reset_button)
     self.add(self.show_values_button)
     self.s2.change = self.change
コード例 #10
0
ファイル: CodeSwitch.py プロジェクト: ryancotterell/Choban
    def __init__(self):
        VerticalPanel.__init__(self, Width="500px", Height="300px")

        table = FlexTable()

        for i, sentence in enumerate(["The dog is red", "The cat is blue", "The bear is green"]):
            table.setWidget(i, 0, CodeSwitchingSentence(sentence))

        self.add(table)
コード例 #11
0
ファイル: unknown.py プロジェクト: fluidinfo/Tickery
 def __init__(self, names):
     VerticalPanel.__init__(self, Spacing=8, StyleName='userlist-error-box')
     self.add(Label(self.msg, StyleName='userlist-error-title'))
     s = []
     for name in names:
         if self.link:
             s.append(utils.screennameToTwitterLink(name))
         else:
             s.append(name)
     self.add(HTML('<br/>'.join(s), StyleName='userlist-error-text'))
コード例 #12
0
ファイル: banner.py プロジェクト: jdunck/Tickery
 def __init__(self):
     VerticalPanel.__init__(self,
                            HorizontalAlignment=HasAlignment.ALIGN_LEFT,
                            StyleName='banner-panel')
     self.add(Image('tickery.png', StyleName='banner-image'))
     strapline = HTML(
         '''Explore <a href="http://twitter.com">Twitter</a> with
         <a href="http://fluidinfo.com/fluiddb">FluidDB</a>''',
         StyleName='strapline')
     self.add(strapline)
コード例 #13
0
ファイル: tickerytab.py プロジェクト: jdunck/Tickery
 def __init__(self, topPanel, **kwargs):
     VerticalPanel.__init__(self,
                            HorizontalAlignment=HasAlignment.ALIGN_LEFT,
                            StyleName='tickery-tab',
                            **kwargs)
     self.topPanel = topPanel # don't add this yet!
     self.topGrid = Grid(1, 2, StyleName='tickery-tab-top-grid',
                         HorizontalAlignment=HasAlignment.ALIGN_LEFT)
     self.add(self.topGrid)
     self.autoActivate = False
コード例 #14
0
ファイル: textArea.py プロジェクト: ygyangguang/pyjs
    def __init__(self):
        VerticalPanel.__init__(self)
        self.setSpacing("10px")

        field = TextArea()
        field.setCharacterWidth(20)
        field.setVisibleLines(4)
        self.add(field)

        self.add(AutoTextArea(self))
コード例 #15
0
ファイル: textArea.py プロジェクト: Afey/pyjs
    def __init__(self):
        VerticalPanel.__init__(self)
        self.setSpacing("10px")

        field = TextArea()
        field.setCharacterWidth(20)
        field.setVisibleLines(4)
        self.add(field)

        self.add(AutoTextArea(self))
コード例 #16
0
ファイル: DNDTest.py プロジェクト: anandology/pyjamas
 def __init__(self):
     VerticalPanel.__init__(self)
     self.width = '100%'
     self.setID('content')
     self.add(TopVerbage())
     self.add(NewSchool())
     self.add(Delegated())
     self.add(ImageDrop())
     self.add(DataTransferDemo())
     self.add(DragEffects())
     self.add(AbsolutePosition())
     self.add(MultiTargetDemo())
コード例 #17
0
ファイル: DNDTest.py プロジェクト: anandology/pyjamas
 def __init__(self, min_age, max_age, id):
     self.min_age = min_age
     self.max_age = max_age
     VerticalPanel.__init__(self)
     DropWidget.__init__(self)
     DragContainer.__init__(self)
     self.setID(id)
     self.setWidth(200)
     self.setHeight(300)
     self.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP)
     self.setStyleName('drophere2')
     self.addTitle()
コード例 #18
0
ファイル: DNDTest.py プロジェクト: trb116/pythonanalyzer
 def __init__(self, min_age, max_age, id):
     self.min_age = min_age
     self.max_age = max_age
     VerticalPanel.__init__(self)
     DropWidget.__init__(self)
     DragContainer.__init__(self)
     self.setID(id)
     self.setWidth(200)
     self.setHeight(300)
     self.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP)
     self.setStyleName('drophere2')
     self.addTitle()
コード例 #19
0
ファイル: DNDTest.py プロジェクト: trb116/pythonanalyzer
 def __init__(self):
     VerticalPanel.__init__(self)
     self.width = '100%'
     self.setID('content')
     self.add(TopVerbage())
     self.add(NewSchool())
     self.add(Delegated())
     self.add(ImageDrop())
     self.add(DataTransferDemo())
     self.add(DragEffects())
     self.add(AbsolutePosition())
     self.add(MultiTargetDemo())
コード例 #20
0
ファイル: unknown.py プロジェクト: fluidinfo/Tickery
 def __init__(self, names, limit):
     VerticalPanel.__init__(self, Spacing=8, StyleName='userlist-error-box')
     self.add(Label(
         "The following people have too many friends! The current "
         "supported limit is %s." % utils.splitthousands(limit),
         StyleName='userlist-error-title'))
     s = []
     for name, friends in names:
         n = utils.splitthousands(friends)
         s.append('%s (%s friends)' % (
             utils.screennameToTwitterLink(name),
             utils.screennameToTwitterFriendsLink(name, n)))
     self.add(HTML('<br/>'.join(s), StyleName='userlist-error-text'))
コード例 #21
0
ファイル: BIO.py プロジェクト: stevenbedrick/Choban
    def __init__(self, tokens):
        """
        Note that here tokens must be a list of lists
        """
        VerticalPanel.__init__(self)

        table = FlexTable()
        self.bio_widgets = []
        for i, token_list in enumerate(tokens):
            self.bio_widgets.append(BIOhighlighter(i, token_list))
            table.setWidget(i, 0, self.bio_widgets[i])

        self.add(table)
コード例 #22
0
ファイル: NERLocal.py プロジェクト: lukeorland/Choban
    def __init__(self):
        VerticalPanel.__init__(self,Width="500px",Height="300px")


        title = "<p><h3>Named Entity Annotator</h3></p>"


        self.commit = Button("Submit",self)
        self.current_block = NERBlock()

        self.add(HTML(title))
        self.add(self.current_block)
        self.add(self.commit)
コード例 #23
0
ファイル: TestPanel.py プロジェクト: weeksjm/gnumed
    def __init__(self, **kwargs):
        VerticalPanel.__init__(self, **kwargs)

        info = """<h2>JSON-RPC Example</h2>
        #<p>This example demonstrates the calling of server services with
        #   <a href="http://json-rpc.org/">JSON-RPC</a>.
        #</p>
        #<p>Choose a service below, and press a the "call service" button to initiate it. An echo service simply sends the exact same text back that it receives.
        #   </p>"""

        self.status = Label()
        self.dockey = TextBox(Text="12")
        self.TEXT_WAITING = "Waiting for response..."

        self.METHOD_ECHO = "Echo"
        self.METHOD_DOCTYPES = "get doc types"
        self.METHOD_UPPERCASE = "get schema"
        self.METHOD_GETINBOX = "get inbox"
        self.METHOD_GETDOCS = "get documents"
        self.methods = [
            self.METHOD_ECHO, self.METHOD_DOCTYPES, self.METHOD_UPPERCASE,
            self.METHOD_GETINBOX, self.METHOD_GETDOCS
        ]

        self.method_list = ListBox()
        self.method_list.setName("hello")
        self.method_list.setVisibleItemCount(1)

        for method in self.methods:
            self.method_list.addItem(method)
        self.method_list.setSelectedIndex(0)

        method_panel = HorizontalPanel()
        method_panel.add(HTML("Remote string method to call: "))
        method_panel.add(self.method_list)
        method_panel.setSpacing(8)

        self.button_action = Button("Call Service", self)

        buttons = HorizontalPanel()
        buttons.add(self.button_action)
        buttons.setSpacing(8)

        panel = VerticalPanel()
        panel.add(HTML(info))
        panel.add(HTML("Primary key of the patient in the database:"))
        panel.add(self.dockey)
        panel.add(method_panel)
        panel.add(buttons)
        panel.add(self.status)
        self.add(panel)
コード例 #24
0
ファイル: TestPanel.py プロジェクト: ncqgm/gnumed
    def __init__(self, **kwargs):
        VerticalPanel.__init__(self, **kwargs)

        info = """<h2>JSON-RPC Example</h2>
        #<p>This example demonstrates the calling of server services with
        #   <a href="http://json-rpc.org/">JSON-RPC</a>.
        #</p>
        #<p>Choose a service below, and press a the "call service" button to initiate it. An echo service simply sends the exact same text back that it receives.
        #   </p>"""

        self.status=Label()
        self.dockey = TextBox(Text="12")
        self.TEXT_WAITING = "Waiting for response..."

        self.METHOD_ECHO = "Echo"
        self.METHOD_DOCTYPES = "get doc types"
        self.METHOD_UPPERCASE = "get schema"
        self.METHOD_GETINBOX = "get inbox"
        self.METHOD_GETDOCS = "get documents"
        self.methods = [self.METHOD_ECHO, self.METHOD_DOCTYPES, 
                     self.METHOD_UPPERCASE, self.METHOD_GETINBOX, 
                        self.METHOD_GETDOCS]

        self.method_list = ListBox()
        self.method_list.setName("hello")
        self.method_list.setVisibleItemCount(1)

        for method in self.methods:
            self.method_list.addItem(method)
        self.method_list.setSelectedIndex(0)

        method_panel = HorizontalPanel()
        method_panel.add(HTML("Remote string method to call: "))
        method_panel.add(self.method_list)
        method_panel.setSpacing(8)

        self.button_action = Button("Call Service", self)

        buttons = HorizontalPanel()
        buttons.add(self.button_action)
        buttons.setSpacing(8)

        panel = VerticalPanel()
        panel.add(HTML(info))
        panel.add(HTML("Primary key of the patient in the database:"))
        panel.add(self.dockey)
        panel.add(method_panel)
        panel.add(buttons)
        panel.add(self.status)
        self.add(panel)
コード例 #25
0
ファイル: NERLocal.py プロジェクト: lukeorland/Choban
    def __init__(self):
        VerticalPanel.__init__(self)
        

        table = FlexTable()

        sentences = self.get_stimuli()
        sentence_widgets = []
   
        
        self.sentence_set = BIO.BIOSentenceSet(sentences,[x.split() for x in sentences])

        table.setWidget(0,0,self.sentence_set)

        self.add(table)
コード例 #26
0
    def __init__(self, width=600, height=300):
        VerticalPanel.__init__(self)
        self.elements = []
        self.desc = []

        self.canvas = Raphael(width, height)
        self.canvas.addListener('mouseup', self.onCanvasMouseup)
        self.canvas.addListener('mousemove', self.onCanvasMousemove)
        self.canvas.addListener('dblclick', self.onCanvasDblClick)
        self.canvas.addListener('contextmenu', self.onCanvasContextmenu)
        self.canvas.addListener('mousedown', self.onCanvasMousedown)

        self.add(self.canvas)
        self.status = Label('Execute any events on the canvas!')
        self.add(self.status)
コード例 #27
0
ファイル: events.py プロジェクト: brodybits/pyjs
 def __init__(self,width=600,height=300):
     VerticalPanel.__init__(self)    
     self.elements=[]
     self.desc=[]
     
     self.canvas = Raphael(width, height)        
     self.canvas.addListener('mouseup',self.onCanvasMouseup)
     self.canvas.addListener('mousemove',self.onCanvasMousemove)
     self.canvas.addListener('dblclick',self.onCanvasDblClick)
     self.canvas.addListener('contextmenu',self.onCanvasContextmenu)
     self.canvas.addListener('mousedown',self.onCanvasMousedown)
     
     self.add(self.canvas)
     self.status=Label('Execute any events on the canvas!')
     self.add(self.status)
コード例 #28
0
ファイル: Override.py プロジェクト: brodybits/pyjs
 def __init__(self):
     """ Standard initialiser.
     """
     global Text
     # There's an issue with javascript reserved words
     # Eigther add the global statement (as above) or
     # define the class Text before this class
     # See issue #574
     VerticalPanel.__init__(self)
     ClickHandler.__init__(self)
     self.addClickListener(self)
     self.title=Text('Board')
     self.title.setzIndex(100)
     self.add(self.title)
     self.setSize("100%", "50%")        
     self.setBorderWidth(1)
コード例 #29
0
ファイル: BIO.py プロジェクト: lukeorland/Choban
    def __init__(self,sentences,tokens):
        """
        Note that here tokens must be a list of lists
        """
        VerticalPanel.__init__(self)
        
        options = ["Not Selected","Person","Location","Organization","Date","Time","Money","Percent","Url","Email","Telephone Number","English (Code Switching)"]

        table = FlexTable()
        self.bio_widgets = []
        for i,pair in enumerate(zip(sentences,tokens)):

            self.bio_widgets.append(BIOHighlighterDropDown(i,pair[0],pair[1],options))
            table.setWidget(i,0,self.bio_widgets[i])
        
        self.add(table)
コード例 #30
0
 def __init__(self):
     """ Standard initialiser.
     """
     global Text
     # There's an issue with javascript reserved words
     # Eigther add the global statement (as above) or
     # define the class Text before this class
     # See issue #574
     VerticalPanel.__init__(self)
     ClickHandler.__init__(self)
     self.addClickListener(self)
     self.title = Text('Board')
     self.title.setzIndex(100)
     self.add(self.title)
     self.setSize("100%", "50%")
     self.setBorderWidth(1)
コード例 #31
0
    def __init__(self, beginVerifyAuth, onClose, baseStyleName='gwt-authdlgbox'):
        """Initialize a new instance.

        beginVerifyAuth: callable that takes (string username, string password).Should call 'endVerifyAuth' when
        finished.
        onClose: callable that takes (AuthDlgBox sender, bool wasAuthorized, string username, string password).  Called
        when Cancel is pressed, or OK is pressed and verification is successful.
        baseStyleName: base css name for type.  baseStyleName + -label, -textbox, and -warninglabel should also be
        defined.
        """
        VerticalPanel.__init__(self, StyleName=baseStyleName)
        self.onClose = onClose
        self.wasAuthorized = False
        self._beginVerifyAuth = beginVerifyAuth
        self.baseStyleName = baseStyleName
        self._createContent()
コード例 #32
0
ファイル: LoginPanel.py プロジェクト: fedenko/clientbank
 def __init__(self, listener):
     VerticalPanel.__init__(self, StyleName = "login")
                            
     self.listener = listener
                            
     self.remote = DataService(['login'])                 
                            
     form_panel = VerticalPanel(ID = "container", StyleName = "form")
     
     self.error_message = Label(StyleName = "error-message") 
     
     grid = Grid(2, 2,
                 CellPadding=0,
                 CellSpacing=0,
                 StyleName = "form-grid")
             
     grid.setWidget(0, 0, Label(JS('gettext("Username:"******"label"))
     self.tb = TextBox(Name="username") 
     grid.setWidget(0, 1, self.tb)
     
     grid.setWidget(1, 0, Label(JS('gettext("Password:"******"label"))
     self.ptb = PasswordTextBox(Name="password")
     grid.setWidget(1, 1, self.ptb)
     
     form_panel.add(Label(JS('gettext("User Login")'), StyleName = "form-title"))
     form_panel.add(self.error_message)
     form_panel.add(grid)
     
     button_box = HorizontalPanel(Width="100%")
     
     register_button = PseudoLink(JS('gettext("Create an account")'),
                              self.onRegisterButtonClick)
     submit_button = Button(JS('gettext("Login")'),
                            self.onSubmitButtonClick)
     
     button_box.add(register_button)
     button_box.add(submit_button)        
     
     button_box.setCellHorizontalAlignment(submit_button,
                                       HasAlignment.ALIGN_RIGHT)
     
     form_panel.add(button_box)
          
     self.add(form_panel)
コード例 #33
0
ファイル: index.py プロジェクト: jdunck/Tickery
 def __init__(self):
     VerticalPanel.__init__(self, Spacing=8, StyleName='admin')
     self.setWidth('100%')
     self.add(Image('tickery.png'))
     self.add(Label('Welcome, root user.', StyleName='title'))
     
     self.add(width.QueueWidth())
     self.add(size.QueueSize())
     self.add(requests.MaxRequestsLimit())
     self.add(friends.FriendsLimit())
     self.add(results.ResultsLimit())
     self.add(directadd.DirectAdd())
     self.add(directadd.BulkDirectAdd())
     self.add(cancel.Cancel())
     self.add(pause.PauseResume())
     self.add(underway.Underway())
     self.add(queued.Queued())
コード例 #34
0
ファイル: TurkerInfo.py プロジェクト: lukeorland/Choban
    def __init__(self,questions,unique_id):
        """
        questions is a list of tuples

        the first value is a string repreesnting the question
        the second value is a boolean value that represents whether the question is true/false
`        

        ("Are you a native Spanish speaker?",true)
        ("How old are you",false)

        """
        

        VerticalPanel.__init__(self)

        self.unique_id = unique_id

        self.answers = []

        table = FlexTable()
        for i,question in enumerate(questions):

            table.setWidget(i,0,HTML(question[0]))
            if (question[1] == True):
                radio1 = RadioButton("truefalse","Yes")
                radio2 = RadioButton("truefalse","No")
                
                self.answers.append((question[0],question[1],(radio1,radio2)))
                
                radiotable = FlexTable()
                radiotable.setWidget(0,0,radio1)
                radiotable.setWidget(0,1,radio2)
                table.setWidget(i,1,radiotable)
            else:
                textbox = TextBox()
                
                self.answers.append((question[0],question[1],textbox))
                
                table.setWidget(i,1,textbox)


        if (not self.is_cookie_set()):
            self.add(HTML("<p><strong>Please fill out this quick survey.</strong> (You will only have to do so once)</p>"))
            self.add(table)
コード例 #35
0
ファイル: Sentiment.py プロジェクト: stevenbedrick/Choban
    def __init__(self):
        VerticalPanel.__init__(self,Width="500px",Height="300px")
        
#        mturk_input = MTurk.MTurkInput()

 #       self.mturk_output = MTurk.MTurkOutput(True,mturk_input.assignmentId,mturk_input.hitId,mturk_input.workerId,self.write_data)

        commit = Button("Submit",self)
        table = FlexTable()

   #     sentences = mturk_input.params.values()
        sentence_widgets = []
   
        whatever = ["The quick brown fox jumps over the lazy dog","The quick brown fox jumps over the lazy dog"]
        self.sentence_set = BIO.BIOSentenceSet(map(lambda x: x.split(),whatever))

        table.setWidget(0,0,self.sentence_set)
        table.setWidget(1,0,commit)
        self.add(table)
コード例 #36
0
ファイル: ControlDemo.py プロジェクト: minghuascode/pyj
    def __init__(self, p2):
        VerticalPanel.__init__(self)

        self.setSpacing(10)
        if p2:
            self.b = HorizontalDemoSlider2(0, 100)
        else:
            self.b = HorizontalDemoSlider(0, 100)
        self.add(self.b)

        self.b.setHeight("20px")
        self.b.setWidth("100px")

        self.b.addControlValueListener(self)

        self.label = InputControl(0, 100)
        self.add(self.label)

        self.label.addControlValueListener(self)
コード例 #37
0
ファイル: ControlDemo.py プロジェクト: FreakTheMighty/pyjamas
    def __init__(self, p2):
        VerticalPanel.__init__(self)

        self.setSpacing(10)
        if p2:
            self.b = VerticalDemoSlider2(0, 100)
        else:
            self.b = VerticalDemoSlider(0, 100)
        self.add(self.b)

        self.b.setWidth("20px")
        self.b.setHeight("100px")

        self.b.addControlValueListener(self)

        self.label = InputControl(0, 100)
        self.add(self.label)

        self.label.addControlValueListener(self)
コード例 #38
0
ファイル: CodeSwitch.py プロジェクト: ryancotterell/Choban
    def __init__(self, sentence):
        VerticalPanel.__init__(self)

        self.sentence = sentence

        self.tokens = sentence.split()

        self.table = FlexTable()
        self.table.setStyleName("codeswitchtable")

        self.radiobuttons = []

        for i, token in enumerate(self.tokens):
            self.radiobuttons.append(RadioButton(""))
            tmp = HTML(token)
            tmp.setStyleName("codeswitchtable")
            self.table.setWidget(0, i, tmp)
            self.table.setWidget(1, i, self.radiobuttons[i])

        self.add(self.table)
コード例 #39
0
ファイル: BIO.py プロジェクト: lukeorland/Choban
    def __init__(self,sentenceid, sentence, tokens):
        VerticalPanel.__init__(self)
        self.vertAlign = HasVerticalAlignment.ALIGN_TOP

        self.table = FlexTable()
        self.sentenceid = str(sentenceid)
        self.sentence = sentence
        self.tokens = []
        self.words = []

        prev = None
        for i,token in enumerate(tokens):
            tmp = Word(token,["whitebg","orangebg","yellowbg"],prev,[(0,2)],self.enforce_constraints,self.update_widget)
            self.words.append(tmp)
            prev = tmp
            self.tokens.append(tmp)
            self.table.setWidget(0,i,tmp)
        

        self.add(self.table)
コード例 #40
0
ファイル: Drawing.py プロジェクト: OneSolver/onesolver
 def __init__(self, handle, idx, image, variables = None, code = None, 
              perspective = '', checkOptions = [False, True]):
     VerticalPanel.__init__(self)
     self._handle = handle
     self.idx = idx
     # set style
     self.setStyleName('os-mech-drawing')  
     # create widgets
     self._img = Image(image)
     self._img.setStyleName('os-mech-thumb')
     self._img.addClickListener(self.onClickDrawing)
     self._perspective = '%d - %s'%(idx, perspective.capitalize())
     self._optionPanel = MechOptionPanel(handle, idx, checkOptions)
     textArea  = TextArea(code)
     textArea.setText(code)
     textArea.setStyleName('os-mech-code-locked')
     textArea.setReadonly(self, True)
     # populate drawing
     self.add(self._img)
     self.add(self._optionPanel)
     self.add(textArea)
コード例 #41
0
ファイル: ControlDemo.py プロジェクト: minghuascode/pyj
    def __init__(self, p2):
        VerticalPanel.__init__(self)

        self.setSpacing(10)
        if p2:
            self.b = AreaDemoSlider2([0, 0], [100, 100], [0.2, 0.2])
        else:
            self.b = AreaDemoSlider([0, 0], [100, 100], [0.2, 0.2])
        self.add(self.b)

        self.b.setHeight("100px")
        self.b.setWidth("100px")

        self.b.addControlValueListener(self)

        self.label_x = MouseInputControl(0, 100, 0.2)
        self.add(self.label_x)

        self.label_x.addControlValueListener(self)

        self.label_y = MouseInputControl(0, 100, 0.2)
        self.add(self.label_y)

        self.label_y.addControlValueListener(self)
コード例 #42
0
 def __init__(self):
     VerticalPanel.__init__(self)
     self.myBlocksSubCat = None
     self.label = ''
コード例 #43
0
ファイル: form.py プロジェクト: mcsquaredjr/Reports
    def __init__(self):
        '''Initialize widget'''
        VerticalPanel.__init__(self)
        Abstract_View.__init__(self)
        # Keep list of all milestones, we will add milestones from controller
        # when we create the form
        self.milestone_names = []
        # Corresponding dates
        self.milestone_dates = []
        # These two variables keep track of added milestone and impediments objects
        self.milestones = []
        self.impediments = []
        
        self.status_area = Text_Area_Row('Status', help='status of the project')

        # Keeps milestones
        self.main_mlst_panel = VerticalPanel()

        hp_mlst = HorizontalPanel()
        self.add_milestone_btn = Button('Add',
                                        getattr(self, 'on_add_milestone_btn_click'))
        self.add_milestone_btn.setStyleName('btn btn-info')

        self.remove_milestone_btn = Button('Remove',
                                        getattr(self, 'remove_milestone'))
        self.remove_milestone_btn.setStyleName('btn btn-danger')

        milestone_panel = VerticalPanel()
        self.milestone_row = Form_Row('Milestones', milestone_panel,
                                      help='add milestone and provide expected completion date')
        
        hp_mlst.add(Label(Width='330px'))

        hp_mlst.add(self.add_milestone_btn)
        hp_mlst.add(Label(Width='10px'))
        hp_mlst.add(self.remove_milestone_btn)
        
        self.main_mlst_panel.add(self.milestone_row.panel())
        self.main_mlst_panel.add(hp_mlst)
        
        self.risks_area = Text_Area_Row('Risks', help='short / long term risks')

        # Keeps impediments
        self.main_impd_panel = VerticalPanel()

        hp_impd = HorizontalPanel()
        self.add_impediment_btn = Button('Add',
                                         getattr(self, 'add_impediment'))
        self.add_impediment_btn.setStyleName('btn btn-info')
    
        # Remove button
        self.remove_impediment_btn = Button('Remove',
                                         getattr(self, 'remove_impediment'))
        self.remove_impediment_btn.setStyleName('btn btn-danger')
        
        impediment_panel = VerticalPanel()
        self.impediment_row = Form_Row('Impediments', impediment_panel,
                                       help='add impediments, one per section, please')
        hp_impd.add(Label(Width='330px'))

        hp_impd.add(self.add_impediment_btn)
        hp_impd.add(Label(Width='10px'))
        hp_impd.add(self.remove_impediment_btn)
        self.main_impd_panel.add(self.impediment_row.panel())
        self.main_impd_panel.add(hp_impd)
        # Add those to itself
        self.add(self.status_area.panel())
        self.add(self.risks_area.panel())
        self.add(self.main_mlst_panel)
        self.add(self.main_impd_panel)
コード例 #44
0
 def __init__(self):
     VerticalPanel.__init__(self, StyleName='CategoryPanel')  #bug
     self.myBlocksSubCat = None
     self.label = ''
コード例 #45
0
 def __init__(self):
     VerticalPanel.__init__(self, StyleName='drophere')
     DropWidget.__init__(self)
     DragContainer.__init__(self)