コード例 #1
0
    def __init__(self):
        SimplePanel.__init__(self)

        contents = HTML("""<h3>The Zen of Python, by Tim Peters</h3>
<p>Beautiful is better than ugly.<br />
Explicit is better than implicit.<br />
Simple is better than complex.<br />
Complex is better than complicated.<br />
Flat is better than nested.<br />
Sparse is better than dense.<br />
Readability counts.<br />
Special cases aren't special enough to break the rules.<br />
Although practicality beats purity.<br />
Errors should never pass silently.<br />
Unless explicitly silenced.<br />
In the face of ambiguity, refuse the temptation to guess.<br />
There should be one-- and preferably only one --obvious way to do it.<br />
Although that way may not be obvious at first unless you're Dutch.<br />
Now is better than never.<br />
Although never is often better than *right* now.<br />
If the implementation is hard to explain, it's a bad idea.<br />
If the implementation is easy to explain, it may be a good idea.<br />
Namespaces are one honking great idea -- let's do more of those!</p>
""")

        panel = CaptionPanel("Caption-Panel", contents,
                             Width="300px")

        self.add(panel)
コード例 #2
0
ファイル: checkBox.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        self.box = CheckBox("Print Results?")
        self.box.addClickListener(getattr(self, "onClick"))

        self.add(self.box)
コード例 #3
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'))
コード例 #4
0
    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'))
コード例 #5
0
    def __init__(self):
        SimplePanel.__init__(self)

        panel = VerticalPanel()
        panel.setBorderWidth(1)

        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)

        part1 = Label("Part 1")
        part2 = Label("Part 2")
        part3 = Label("Part 3")
        part4 = Label("Part 4")

        panel.add(part1)
        panel.add(part2)
        panel.add(part3)
        panel.add(part4)

        panel.setCellHeight(part1, "10%")
        panel.setCellHeight(part2, "70%")
        panel.setCellHeight(part3, "10%")
        panel.setCellHeight(part4, "10%")

        panel.setCellHorizontalAlignment(part3, HasAlignment.ALIGN_RIGHT)

        panel.setWidth("50%")
        panel.setHeight("300px")

        self.add(panel)
コード例 #6
0
ファイル: fileUpload.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)

        self.form = FormPanel()
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)
        self.form.setAction("http://nonexistent.com")
        self.form.setTarget("results")

        vPanel = VerticalPanel()

        hPanel = HorizontalPanel()
        hPanel.setSpacing(5)
        hPanel.add(Label("Upload file:"))

        self.field = FileUpload()
        self.field.setName("file")
        hPanel.add(self.field)

        hPanel.add(Button("Submit", getattr(self, "onBtnClick")))

        vPanel.add(hPanel)

        results = NamedFrame("results")
        vPanel.add(results)

        self.form.add(vPanel)
        self.add(self.form)
コード例 #7
0
ファイル: flexTable.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)

        self._table = FlexTable(BorderWidth=1, Width="100%")

        cellFormatter = self._table.getFlexCellFormatter()
        rowFormatter = self._table.getRowFormatter()

        self._table.setHTML(0, 0, "<b>Mammals</b>")
        self._table.setText(1, 0, "Cow")
        self._table.setText(1, 1, "Rat")
        self._table.setText(1, 2, "Dog")

        cellFormatter.setColSpan(0, 0, 3)
        cellFormatter.setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER)

        self._table.setWidget(2, 0, Button("Hide", getattr(self, "hideRows")))
        self._table.setText(2, 1, "1,1")
        self._table.setText(2, 2, "2,1")
        self._table.setText(3, 0, "1,2")
        self._table.setText(3, 1, "2,2")

        cellFormatter.setRowSpan(2, 0, 2)
        cellFormatter.setVerticalAlignment(2, 0, HasAlignment.ALIGN_MIDDLE)

        self._table.setWidget(4, 0, Button("Show", getattr(self, "showRows")))

        cellFormatter.setColSpan(4, 0, 3)

        rowFormatter.setVisible(4, False)

        self.add(self._table)
コード例 #8
0
ファイル: ProviderInboxPanel.py プロジェクト: sk/gnumed
 def __init__(self, **kwargs):
     SimplePanel.__init__(self, **kwargs)
     self.pp = None
     self.messages = []
     self.active_patient_id = None
     self.TEXT_WAITING = "Waiting for response..."
     HTTPUILoader(self).load("gnumedweb.xml")  # calls onUILoaded when done
コード例 #9
0
    def __init__(self):
        # We need to use old form of inheritance because of pyjamas
        SimplePanel.__init__(self)
        self.hpanel = HorizontalPanel(Width='475px')
        self.hpanel.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM)
        
        self.name = TextBox()
        self.name.setStyleName('form-control')
        
        self.status = ListBox()
        self.status.addItem('Active')
        self.status.addItem('Inactive')
        self.status.setVisibleItemCount(0)
        self.status.setStyleName('form-control input-lg')
        self.status.setSize('100px', '34px')
        
        lbl = Label('', Width='10px')

        self.add_btn = Button('Add')
        self.add_btn.setStyleName('btn btn-primary')
        self.del_btn = Button('Delete')
        self.del_btn.setStyleName('btn btn-danger')

        self.hpanel.add(self.name)
        self.hpanel.add(lbl)
        self.hpanel.add(self.status)
        self.hpanel.add(self.add_btn)
        self.hpanel.add(self.del_btn)
コード例 #10
0
ファイル: Upload.py プロジェクト: brodybits/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        self.form = FormPanel()
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)
        self.url =  "http://localhost/pyjamas_upload_demo"
        self.form.setAction(self.url)
        self.form.setTarget("results")

        vPanel = VerticalPanel()

        hPanel = HorizontalPanel()
        hPanel.setSpacing(5)
        hPanel.add(Label("Upload file:"))

        self.field = FileUpload()
        self.field.setName("file")
        hPanel.add(self.field)

        hPanel.add(Button("Submit", getattr(self, "onBtnClick")))
        vPanel.add(hPanel)
        
        self.simple = CheckBox("Simple mode?  ")
        #self.simple.setChecked(True)
        vPanel.add(self.simple)
        self.progress = Label('0%')

        results = NamedFrame("results")
        vPanel.add(results)
        vPanel.add(self.progress)

        self.form.add(vPanel)
        self.add(self.form)
コード例 #11
0
ファイル: fileUpload.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        self.form = FormPanel()
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)
        self.form.setAction("http://nonexistent.com")
        self.form.setTarget("results")

        vPanel = VerticalPanel()

        hPanel = HorizontalPanel()
        hPanel.setSpacing(5)
        hPanel.add(Label("Upload file:"))

        self.field = FileUpload()
        self.field.setName("file")
        hPanel.add(self.field)

        hPanel.add(Button("Submit", getattr(self, "onBtnClick")))

        vPanel.add(hPanel)

        results = NamedFrame("results")
        vPanel.add(results)

        self.form.add(vPanel)
        self.add(self.form)
コード例 #12
0
ファイル: horizontalPanel.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        panel = HorizontalPanel(BorderWidth=1,
                                HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                                VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
                                Width="100%",
                                Height="200px")

        part1 = Label("Part 1")
        part2 = Label("Part 2")
        part3 = Label("Part 3")
        part4 = Label("Part 4")

        panel.add(part1)
        panel.add(part2)
        panel.add(part3)
        panel.add(part4)

        panel.setCellWidth(part1, "10%")
        panel.setCellWidth(part2, "70%")
        panel.setCellWidth(part3, "10%")
        panel.setCellWidth(part4, "10%")

        panel.setCellVerticalAlignment(part3, HasAlignment.ALIGN_BOTTOM)

        self.add(panel)
コード例 #13
0
ファイル: form.py プロジェクト: mcsquaredjr/Reports
 def __init__(self, start_date, can_delete=True):
     # We need to use old form of inheritance because of pyjamas
     SimplePanel.__init__(self)
     self.vpanel = VerticalPanel()
     desc_panel = VerticalPanel()
     self.desc_box = TextBox()
     self.desc_box.setVisibleLength(44)
     self.desc_box.setStyleName('form-control')
     desc_lbl = Label('impediment description')
     desc_lbl.setStyleName('text-muted')
     desc_panel.add(self.desc_box)
     desc_panel.add(desc_lbl)
     # Set to False if loaded from database
     self.can_delete = can_delete
     
     status_panel = VerticalPanel()
     self.status_lst = ListBox(Height='34px')
     self.status_lst.setStyleName('form-control input-lg')
     self.status_lst.addItem('Open')
     self.status_lst.addItem('Closed')
     # we put date here
     
     self.status_lbl = Label('')
     self.set_start_date(start_date)
     self.status_lbl.setStyleName('text-muted')
     status_panel = VerticalPanel()
     status_panel.add(self.status_lst)
     status_panel.add(self.status_lbl)
     self.comment = Text_Area_Row('', 'why it exists or is being closed')
     hpanel = HorizontalPanel()
     hpanel.add(desc_panel)
     hpanel.add(Label(Width='10px'))
     hpanel.add(status_panel)
     self.vpanel.add(hpanel)
     self.vpanel.add(self.comment.panel())
コード例 #14
0
ファイル: flexTable.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        self._table = FlexTable(BorderWidth=1, Width="100%")

        cellFormatter = self._table.getFlexCellFormatter()
        rowFormatter = self._table.getRowFormatter()

        self._table.setHTML(0, 0, "<b>Mammals</b>")
        self._table.setText(1, 0, "Cow")
        self._table.setText(1, 1, "Rat")
        self._table.setText(1, 2, "Dog")

        cellFormatter.setColSpan(0, 0, 3)
        cellFormatter.setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER)

        self._table.setWidget(2, 0, Button("Hide", getattr(self, "hideRows")))
        self._table.setText(2, 1, "1,1")
        self._table.setText(2, 2, "2,1")
        self._table.setText(3, 0, "1,2")
        self._table.setText(3, 1, "2,2")

        cellFormatter.setRowSpan(2, 0, 2)
        cellFormatter.setVerticalAlignment(2, 0, HasAlignment.ALIGN_MIDDLE)

        self._table.setWidget(4, 0, Button("Show", getattr(self, "showRows")))

        cellFormatter.setColSpan(4, 0, 3)

        rowFormatter.setVisible(4, False)

        self.add(self._table)
コード例 #15
0
    def __init__(self):
        SimplePanel.__init__(self)
        vert = VerticalPanel()
        vert.setSpacing("10px")
        self.add(vert)

        panel = ScrollPanel(Size=("300px", "100px"))

        contents = HTML("<b>Tao Te Ching, Chapter One</b><p>" +
                        "The Way that can be told of is not an unvarying " +
                        "way;<p>The names that can be named are not " +
                        "unvarying names.<p>It was from the Nameless that " +
                        "Heaven and Earth sprang;<p>The named is but the " +
                        "mother that rears the ten thousand creatures, " +
                        "each after its kind.")
        panel.add(contents)
        vert.add(panel)

        container = SimplePanel(Width="400px", Height="200px")
        contents2 = HTML(
            50 *
            "Dont forget to grab the css for SuperScrollPanel in Showcase.css! "
        )
        panel2 = SuperScrollPanel(contents2)
        container.add(panel2)
        vert.add(container)
コード例 #16
0
    def __init__(self):
        SimplePanel.__init__(self)

        self.box = CheckBox("Print Results?")
        self.box.addClickListener(getattr(self, "onClick"))

        self.add(self.box)
コード例 #17
0
ファイル: PatientInboxPanel.py プロジェクト: weeksjm/gnumed
 def __init__(self, **kwargs):
     SimplePanel.__init__(self, **kwargs)
     self.pp = None
     self.active_patient_messages = []
     self.active_patient_id = None
     self.TEXT_WAITING = "Waiting for response..."
     HTTPUILoader(self).load("gnumedweb.xml")  # calls onUILoaded when done
コード例 #18
0
ファイル: textArea.py プロジェクト: praveenmunagapati/pyjamas
    def __init__(self):
        SimplePanel.__init__(self)

        field = TextArea()
        field.setCharacterWidth(20)
        field.setVisibleLines(4)
        self.add(field)
コード例 #19
0
ファイル: frame.py プロジェクト: FreakTheMighty/pyjamas
    def __init__(self):
        SimplePanel.__init__(self)

        frame = Frame("http://google.com",
                      Width="100%",
                      Height="200px")
        self.add(frame)
コード例 #20
0
ファイル: frame.py プロジェクト: ygyangguang/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        frame = Frame("http://pyjs.org",
                      Width="100%",
                      Height="200px")
        self.add(frame)
コード例 #21
0
    def __init__(self):
        SimplePanel.__init__(self)

        panel = VerticalPanel(BorderWidth=1,
                              HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                              VerticalAlignment=HasAlignment.ALIGN_MIDDLE,
                              Width="50%",
                              Height="300px")

        part1 = Label("Part 1")
        part2 = Label("Part 2")
        part3 = Label("Part 3")
        part4 = Label("Part 4")

        panel.add(part1)
        panel.add(part2)
        panel.add(part3)
        panel.add(part4)

        panel.setCellHeight(part1, "10%")
        panel.setCellHeight(part2, "70%")
        panel.setCellHeight(part3, "10%")
        panel.setCellHeight(part4, "10%")

        panel.setCellHorizontalAlignment(part3, HasAlignment.ALIGN_RIGHT)

        self.add(panel)
コード例 #22
0
ファイル: textArea.py プロジェクト: FreakTheMighty/pyjamas
    def __init__(self):
        SimplePanel.__init__(self)

        field = TextArea()
        field.setCharacterWidth(20)
        field.setVisibleLines(4)
        self.add(field)
コード例 #23
0
ファイル: verticalPanel.py プロジェクト: pombredanne/pyjamas
    def __init__(self):
        SimplePanel.__init__(self)

        panel = VerticalPanel()
        panel.setBorderWidth(1)

        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)

        part1 = Label("Part 1")
        part2 = Label("Part 2")
        part3 = Label("Part 3")
        part4 = Label("Part 4")

        panel.add(part1)
        panel.add(part2)
        panel.add(part3)
        panel.add(part4)

        panel.setCellHeight(part1, "10%")
        panel.setCellHeight(part2, "70%")
        panel.setCellHeight(part3, "10%")
        panel.setCellHeight(part4, "10%")

        panel.setCellHorizontalAlignment(part3, HasAlignment.ALIGN_RIGHT)

        panel.setWidth("50%")
        panel.setHeight("300px")

        self.add(panel)
コード例 #24
0
    def __init__(self):
        SimplePanel.__init__(self)
        self.setSize('100%', '100%')

        options = MapOptions(
            zoom=4, center=LatLng(-25.363882, 131.044922),
            mapTypeId=MapTypeId.ROADMAP,

            mapTypeControl=True,
            mapTypeControlOptions=MapTypeControlOptions(
                style=MapTypeControlStyle.DROPDOWN_MENU),

            navigationControl=True,
            navigationControlOptions=NavigationControlOptions(
                style=NavigationControlStyle.SMALL))
        # the same, in a extensive way:

        #options = MapOptions()

        #options.zoom = 4
        #options.center = LatLng(-25.363882, 131.044922)
        #options.mapTypeId = MapTypeId.ROADMAP

        #options.mapTypeControl = True
        #options.mapTypeControlOptions = MapTypeControlOptions()
        #options.mapTypeControlOptions.style =
        #   MapTypeControlStyle.DROPDOWN_MENU

        #options.navigationControl = True
        #options.navigationControlOptions = NavigationControlOptions()
        #options.navigationControlOptions.style = \
        #    NavigationControlStyle.SMALL

        self.map = Map(self.getElement(), options)
コード例 #25
0
ファイル: form.py プロジェクト: mcsquaredjr/Reports
    def __init__(self, milestone_names, milestone_dates):
        # We need to use old form of inheritance because of pyjamas
        SimplePanel.__init__(self)
        self.milestone_dates = milestone_dates
       
        self.hpanel = HorizontalPanel()
        self.hpanel.setVerticalAlignment(HasAlignment.ALIGN_TOP)
        self.name = ListBox(Height='34px', Width='208px')
        self.name.setStyleName('form-control input-lg')
        self.name.addChangeListener(getattr(self, 'on_milestone_changed'))
       
        for m in milestone_names:
            self.name.addItem(m) 
        if len(self.milestone_dates) > 0:
            self.planned_completion = Label(self.milestone_dates[0])
        else:
            self.planned_completion = Label('Undefined')
            
        self.planned_completion.setStyleName('form-control text-normal')

        self.expected_completion = Report_Date_Field(cal_ID='end')
        self.expected_completion.getTextBox().setStyleName('form-control')
        self.expected_completion.setRegex(DATE_MATCHER)
        self.expected_completion.appendValidListener(self._display_ok)
        self.expected_completion.appendInvalidListener(self._display_error)
        self.expected_completion.validate(None)

        self.hpanel.add(self.name)
        self.hpanel.add(Label(Width='10px'))
        self.hpanel.add(self.planned_completion)
        self.hpanel.add(Label(Width='10px'))
        self.hpanel.add(self.expected_completion)
コード例 #26
0
    def __init__(self):
        SimplePanel.__init__(self)

        self.form = FormPanel()
        self.form.setEncoding(FormPanel.ENCODING_MULTIPART)
        self.form.setMethod(FormPanel.METHOD_POST)
        self.url = "http://localhost/pyjamas_upload_demo"
        self.form.setAction(self.url)
        self.form.setTarget("results")

        vPanel = VerticalPanel()

        hPanel = HorizontalPanel()
        hPanel.setSpacing(5)
        hPanel.add(Label("Upload file:"))

        self.field = FileUpload()
        self.field.setName("file")
        hPanel.add(self.field)

        hPanel.add(Button("Submit", getattr(self, "onBtnClick")))
        vPanel.add(hPanel)

        self.simple = CheckBox("Simple mode?  ")
        #self.simple.setChecked(True)
        vPanel.add(self.simple)
        self.progress = Label('0%')

        results = NamedFrame("results")
        vPanel.add(results)
        vPanel.add(self.progress)

        self.form.add(vPanel)
        self.add(self.form)
コード例 #27
0
ファイル: textBox.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        field = TextBox()
        field.setVisibleLength(20)
        field.setMaxLength(10)

        self.add(field)
コード例 #28
0
    def __init__(self):
        SimplePanel.__init__(self)

        field = TextBox()
        field.setVisibleLength(20)
        field.setMaxLength(10)

        self.add(field)
コード例 #29
0
ファイル: DisclosurePanel.py プロジェクト: anandology/pyjamas
 def __init__(self, disclosurePanel, **kwargs):
     element = kwargs.pop('Element', DOM.createAnchor())
     SimplePanel.__init__(self, element)
     self.disclosurePanel = disclosurePanel
     element = self.getElement()
     DOM.setAttribute(element, "href", "javascript:void(0);");
     DOM.setStyleAttribute(element, "display", "block")
     self.sinkEvents(Event.ONCLICK)
     self.setStyleName("header")
コード例 #30
0
    def __init__(self):
        SimplePanel.__init__(self)

        panel = AbsolutePanel(Width="100%", Height="100px")

        panel.add(self.makeBox("Child 1"), 20, 10)
        panel.add(self.makeBox("Child 2"), 30, 30)

        self.add(panel)
コード例 #31
0
ファイル: FocusPanel.py プロジェクト: anandology/pyjamas
    def __init__(self, **kwargs):
        """ pass in Widget={the widget} so that Applier will call setWidget.  
        """

        SimplePanel.__init__(self, Focus.createFocusable(), **kwargs)
        FocusHandler.__init__(self)
        KeyboardHandler.__init__(self)
        ClickHandler.__init__(self)
        MouseHandler.__init__(self)
コード例 #32
0
ファイル: image.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        # We display the "myImage.jpg" file, stored in the "public/images"
        # directory, where "public" is in the application's source directory.

        img = Image("images/myImage.jpg")
        img.addClickListener(getattr(self, "onImageClicked"))
        self.add(img)
コード例 #33
0
ファイル: absolutePanel.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        panel = AbsolutePanel(Width="100%", Height="100px")

        panel.add(self.makeBox("Child 1"), 20, 10)
        panel.add(self.makeBox("Child 2"), 30, 30)

        self.add(panel)
コード例 #34
0
    def __init__(self, **kwargs):
        """ pass in Widget={the widget} so that Applier will call setWidget.  
        """

        SimplePanel.__init__(self, Focus.createFocusable(), **kwargs)
        FocusHandler.__init__(self)
        KeyboardHandler.__init__(self)
        ClickHandler.__init__(self)
        MouseHandler.__init__(self)
コード例 #35
0
    def __init__(self):
        SimplePanel.__init__(self)

        # We display the "myImage.jpg" file, stored in the "public/images"
        # directory, where "public" is in the application's source directory.

        img = Image("images/myImage.jpg")
        img.addClickListener(getattr(self, "onImageClicked"))
        self.add(img)
コード例 #36
0
 def __init__(self, disclosurePanel, **kwargs):
     element = kwargs.pop('Element', DOM.createAnchor())
     SimplePanel.__init__(self, element)
     self.disclosurePanel = disclosurePanel
     element = self.getElement()
     DOM.setAttribute(element, "href", "javascript:void(0);")
     DOM.setStyleAttribute(element, "display", "block")
     self.sinkEvents(Event.ONCLICK)
     self.setStyleName("header")
コード例 #37
0
 def __init__( self ):
     SimplePanel.__init__( self )
     self.setSize( W_FRAME, 600 )
     options = MapOptions()
     options.zoom = 4
     options.mapTypeId = MapTypeId.ROADMAP
     self.map = Map( self.getElement(), options )
     southWest = LatLng( 37.887, -122.3 );
     northEast = LatLng( 37.855, -122.22 );
     self.map.fitBounds( LatLngBounds( southWest, northEast ) )
コード例 #38
0
 def __init__(self, splitPanel, **kwargs):
     # keep a ref to our parent panel for event callback
     self._splitpanel = splitPanel
     SimplePanel.__init__(self, **kwargs)
     MouseHandler.__init__(self)
     self.addMouseListener(self)
     # set some constant styles
     elem = self.getElement()
     # the following allows splitter to be small enough in IE
     DOM.setStyleAttribute(elem, "overflow", "hidden")
コード例 #39
0
 def __init__(self, splitPanel, **kwargs):
     # keep a ref to our parent panel for event callback
     self._splitpanel = splitPanel
     SimplePanel.__init__(self, **kwargs)
     MouseHandler.__init__(self)
     self.addMouseListener(self)
     # set some constant styles
     elem = self.getElement()
     # the following allows splitter to be small enough in IE
     DOM.setStyleAttribute(elem, "overflow", "hidden")
コード例 #40
0
ファイル: ScrollPanel.py プロジェクト: anandology/pyjamas
    def __init__(self, child=None, **kwargs):
        self.scrollListeners = []

        if child is not None:
            kwargs['Widget'] = child
        if not kwargs.has_key('AlwaysShowScrollBars'):
             kwargs['AlwaysShowScrollBars'] = False

        SimplePanel.__init__(self, **kwargs)
        self.sinkEvents(Event.ONSCROLL)
コード例 #41
0
    def __init__(self, child=None, **kwargs):
        self.scrollListeners = []

        if child is not None:
            kwargs['Widget'] = child
        if not kwargs.has_key('AlwaysShowScrollBars'):
            kwargs['AlwaysShowScrollBars'] = False

        SimplePanel.__init__(self, **kwargs)
        self.sinkEvents(Event.ONSCROLL)
コード例 #42
0
ファイル: popupPanel.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)

        vPanel = VerticalPanel(Spacing=4)

        self._btn = Button("Click Me", getattr(self, "showPopup"))

        vPanel.add(HTML("Click on the button below to display the popup."))
        vPanel.add(self._btn)

        self.add(vPanel)
コード例 #43
0
ファイル: popupPanel.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)

        vPanel = VerticalPanel(Spacing=4)

        self._btn = Button("Click Me", getattr(self, "showPopup"))

        vPanel.add(HTML("Click on the button below to display the popup."))
        vPanel.add(self._btn)

        self.add(vPanel)
コード例 #44
0
ファイル: tabPanel.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)

        tabs = TabPanel(Width="100%", Height="250px")
        tabs.add(HTML("The quick brown fox jumps over the lazy dog."), "Tab 1")
        tabs.add(HTML("The early bird catches the worm."), "Tab 2")
        tabs.add(HTML("The smart money is on the black horse."), "Tab 3")

        tabs.selectTab(0)

        self.add(tabs)
コード例 #45
0
 def __init__(self, width=800, height=600, colors=('red', 'blue', 'green')):
     SimplePanel.__init__(self)
     GChart.setCanvasFactory(GWTCanvasBasedCanvasFactory())
     self.colors = list(colors)
     self.series = []
     self.canvas = GChart.GChart()
     self.canvas.setChartSize(width, height)
     self.canvas.setBorderStyle("none")
     self.canvas.getXAxis().setHasGridlines(True)
     self.canvas.getYAxis().setHasGridlines(True)
     self.add(self.canvas)  # pylint: disable=E1101
コード例 #46
0
ファイル: EventArguments.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)
        self.setSize('100%', '100%')

        options = MapOptions()
        options.zoom = 4
        options.center = LatLng(-25.363882, 131.044922)
        options.mapTypeId = MapTypeId.ROADMAP

        self.map = Map(self.getElement(), options)

        self.map.addListener("click", self.clicked)
コード例 #47
0
    def __init__(self):
        SimplePanel.__init__(self)

        panel = AbsolutePanel()

        panel.add(self.makeBox("Child 1"), 20, 10)
        panel.add(self.makeBox("Child 2"), 30, 30)

        panel.setWidth("100%")
        panel.setHeight("100px")

        self.add(panel)
コード例 #48
0
    def __init__(self):
        SimplePanel.__init__(self)

        panel = AbsolutePanel()

        panel.add(self.makeBox("Child 1"), 20, 10)
        panel.add(self.makeBox("Child 2"), 30, 30)

        panel.setWidth("100%")
        panel.setHeight("100px")

        self.add(panel)
コード例 #49
0
    def __init__(self):
        SimplePanel.__init__(self)

        stack = StackPanel(Width="100%", Height="300px")

        stack.add(HTML('The quick<br>brown fox<br>jumps over the<br>lazy dog.'),
                  "Stack 1")
        stack.add(HTML('The<br>early<br>bird<br>catches<br>the<br>worm.'),
                  "Stack 2")
        stack.add(HTML('The smart money<br>is on the<br>black horse.'),
                  "Stack 3")

        self.add(stack)
コード例 #50
0
ファイル: grid.py プロジェクト: minghuascode/pyj
    def __init__(self):
        SimplePanel.__init__(self)

        grid = Grid(5, 5, BorderWidth=2, CellPadding=4, CellSpacing=1)
        grid.setHTML(0, 0, '<b>Hello, World!</b>')

        for row in range(1, 5):
            for col in range(1, 5):
                grid.setText(
                    row, col,
                    str(row) + "*" + str(col) + " = " + str(row * col))

        self.add(grid)
コード例 #51
0
ファイル: ControlDisableUI.py プロジェクト: Afey/pyjs
    def __init__(self):
        SimplePanel.__init__(self)
        self.setSize('100%', '100%')

        options = MapOptions()

        options.zoom = 4
        options.center = LatLng(-33, 151)
        options.mapTypeId = MapTypeId.ROADMAP

        options.disableDefaultUI = True

        self.map = Map(self.getElement(), options)
コード例 #52
0
 def __init__(self, caption, widget=None, **kwargs):
     if kwargs.has_key('Element'):
         element = kwargs.pop('Element')
     else:
         element = DOM.createElement("fieldset")
     self.legend = DOM.createElement("legend")
     DOM.appendChild(element, self.legend)
     kwargs['Caption'] = caption
     if widget is not None:
         kwargs['Widget'] = widget
     if not 'StyleName' in kwargs:
         kwargs['StyleName'] = 'gwt-CaptionPanel'
     SimplePanel.__init__(self, element, **kwargs)