• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python ui.VerticalPanel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ui.VerticalPanel的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel类的具体用法?Python VerticalPanel怎么用?Python VerticalPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VerticalPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: SinkList

class SinkList(Composite):
    def __init__(self):
        Composite.__init__(self)
        self.vp_list=VerticalPanel()
        self.sinks=[]
        self.selectedSink=-1
        
        self.initWidget(self.vp_list)
        self.setStyleName("ks-List")

    def addSink(self, info):
        name = info.getName()
        link = Hyperlink(name, False, name)
        link.setStyleName("ks-SinkItem")
        self.vp_list.add(link)
        self.sinks.append(info)

    def find(self, sinkName):
        for info in self.sinks:
            if info.getName()==sinkName:
                return info
        return None

    def setSinkSelection(self, name):
        if self.selectedSink <> -1:
            self.vp_list.getWidget(self.selectedSink).removeStyleName("ks-SinkItem-selected")

        for i in range(len(self.sinks)):
            info = self.sinks[i]
            if (info.getName()==name):
                self.selectedSink = i
                widget=self.vp_list.getWidget(self.selectedSink)
                widget.addStyleName("ks-SinkItem-selected")
                return
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:34,代码来源:SinkList.py


示例2: Contacts

class Contacts(Composite):
    def __init__(self):
        self.contacts = []
        self.contacts.append(Contact("Benoit Mandelbrot", "[email protected]"))
        self.contacts.append(Contact("Albert Einstein", "[email protected]"))
        self.contacts.append(Contact("Rene Descartes", "[email protected]"))
        self.contacts.append(Contact("Bob Saget", "[email protected]"))
        self.contacts.append(Contact("Ludwig von Beethoven", "[email protected]"))
        self.contacts.append(Contact("Richard Feynman", "[email protected]"))
        self.contacts.append(Contact("Alan Turing", "[email protected]"))
        self.contacts.append(Contact("John von Neumann", "[email protected]"))

        self.panel = VerticalPanel()

        # Add all the contacts to the list.
        i = 0
        while (i < len(self.contacts)):
            self.addContact(self.contacts[i])
            i =  i + 1

        self.setWidget(self.panel)
        self.setStyleName("mail-Contacts")

    def addContact(self, contact):
        link = HTML("<a href='javascript:;'>" + contact.name + "</a>")
        self.panel.add(link)
        
        # Add a click listener that displays a ContactPopup when it is clicked.
        listener = ContactListener(contact, link)
        link.addClickListener(listener)
开发者ID:AwelEshetu,项目名称:cwm,代码行数:30,代码来源:Contacts.py


示例3: __init__

    def __init__(self):
        colour_grid = ColourGridCanvas()
        rotated = RotatedCanvas()       
        spheres = SpheresCanvas()
        pattern = PatternCanvas()
        spiro = SpiroCanvas()
        self.solar = SolarCanvas()
        
        row0 = HorizontalPanel()
        row0.setSpacing(8)
        row0.add(colour_grid)
        row0.add(rotated)
        row0.add(spheres)
        row0.add(pattern)
        
        row1 = HorizontalPanel()
        row1.setSpacing(8)
        row1.add(self.solar)
        row1.add(spiro)

        panel = VerticalPanel()
        panel.add(row0)
        panel.add(row1)

        self.setWidget(panel)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:25,代码来源:CanvasTab.py


示例4: onModuleLoad

    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())
开发者ID:AwelEshetu,项目名称:cwm,代码行数:55,代码来源:Mail.py


示例5: onModuleLoad

    def onModuleLoad(self):
        self.TEXT_WAITING = "Waiting for response..."
        self.TEXT_ERROR = "Server Error"

        self.remote_php = EchoServicePHP()
        self.remote_py = EchoServicePython()

        self.status=Label()
        self.text_area = TextArea()
        self.text_area.setText(r"{'Test'} [\"String\"]")
        self.text_area.setCharacterWidth(80)
        self.text_area.setVisibleLines(8)
        
        self.button_php = Button("Send to PHP Service", self)
        self.button_py = Button("Send to Python Service", self)

        buttons = HorizontalPanel()
        buttons.add(self.button_php)
        buttons.add(self.button_py)
        buttons.setSpacing(8)
        
        info = r"<h2>JSON-RPC Example</h2><p>This example demonstrates the calling of server services with <a href=\"http://json-rpc.org/\">JSON-RPC</a>."
        info += "<p>Enter some text below, and press a button to send the text to an Echo service on your server. An echo service simply sends the exact same text back that it receives."
        
        panel = VerticalPanel()
        panel.add(HTML(info))
        panel.add(self.text_area)
        panel.add(buttons)
        panel.add(self.status)
        
        RootPanel().add(panel)
开发者ID:AwelEshetu,项目名称:cwm,代码行数:31,代码来源:JSONRPCExample.py


示例6: __init__

    def __init__(self):
        Composite.__init__(self)
        self.signOutLink = HTML("<a href='javascript:;'>Sign Out</a>")
        self.aboutLink = HTML("<a href='javascript:;'>About</a>")

        outer = HorizontalPanel()
        inner = VerticalPanel()

        outer.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
        inner.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)

        links = HorizontalPanel()
        links.setSpacing(4)
        links.add(self.signOutLink)
        links.add(self.aboutLink)

        outer.add(inner)
        inner.add(HTML("<b>Welcome back, [email protected]</b>"))
        inner.add(links)

        self.signOutLink.addClickListener(self)
        self.aboutLink.addClickListener(self)

        self.initWidget(outer)
        inner.setStyleName("mail-TopPanel")
        links.setStyleName("mail-TopPanelLinks")
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:26,代码来源:TopPanel.py


示例7: __init__

 def __init__(self):
     self.vp_list=VerticalPanel()
     self.sinks=[]
     self.selectedSink=-1
     
     self.setWidget(self.vp_list)
     self.setStyleName("ks-List")
开发者ID:AwelEshetu,项目名称:cwm,代码行数:7,代码来源:SinkList.py


示例8: __init__

	def __init__(self, calendar):
		Composite.__init__(self)

		self.calendar = calendar
		self.dayCheckBoxListener = DayCheckBoxListener(calendar)
		self.outer = VerticalPanel()
		self.initWidget(self.outer)
		self.setStyleName("DynaTable-DayFilterWidget")
		self.outer.add(DayCheckBox(self, "Sunday", 0))
		self.outer.add(DayCheckBox(self, "Monday", 1))
		self.outer.add(DayCheckBox(self, "Tuesday", 2))
		self.outer.add(DayCheckBox(self, "Wednesday", 3))
		self.outer.add(DayCheckBox(self, "Thursday", 4))
		self.outer.add(DayCheckBox(self, "Friday", 5))
		self.outer.add(DayCheckBox(self, "Saturday", 6))

		self.buttonAll = Button("All", self)
		self.buttonNone = Button("None", self)

		hp = HorizontalPanel()
		hp.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
		hp.add(self.buttonAll)
		hp.add(self.buttonNone)
		
		self.outer.add(hp)
		self.outer.setCellVerticalAlignment(hp, HasAlignment.ALIGN_BOTTOM)
		self.outer.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_CENTER)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:27,代码来源:DayFilterWidget.py


示例9: onModuleLoad

    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()
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:34,代码来源:KitchenSink.py


示例10: __init__

 def __init__(self):
     self.fDialogButton = Button("Show Dialog", self)
     self.fPopupButton = Button("Show Popup", self)
     
     panel = VerticalPanel()
     panel.add(self.fPopupButton)
     panel.add(self.fDialogButton)
     
     list = ListBox()
     list.setVisibleItemCount(5)
     for i in range(10):
         list.addItem("list item " + i)
     panel.add(list)
     
     panel.setSpacing(8)
     self.initWidget(panel)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:16,代码来源:Popups.py


示例11: createImage

 def createImage(self, imageUrl):
     image = Image(imageUrl)
     image.setStyleName("ks-images-Image")
     
     p = VerticalPanel()
     p.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
     p.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
     p.add(image)
     return p
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:9,代码来源:Tabs.py


示例12: __init__

    def __init__(self, contact):
        # The popup's constructor's argument is a boolean specifying that it
        # auto-close itself when the user clicks outside of it.

        PopupPanel.__init__(self, True)

        inner = VerticalPanel()
        nameLabel = Label(contact.name)
        emailLabel = Label(contact.email)
        inner.add(nameLabel)
        inner.add(emailLabel)
        
        panel = HorizontalPanel()
        panel.setSpacing(4)
        panel.add(Image(contact.photo))
        panel.add(inner)
        
        self.add(panel)
        self.setStyleName("mail-ContactPopup")
        nameLabel.setStyleName("mail-ContactPopupName")
        emailLabel.setStyleName("mail-ContactPopupEmail")
开发者ID:AwelEshetu,项目名称:cwm,代码行数:21,代码来源:Contacts.py


示例13: onModuleLoad

    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().add(self.form)
开发者ID:pombredanne,项目名称:pyjamas-1,代码行数:40,代码来源:FormPanelExample.py


示例14: __init__

    def __init__(self):
        Sink.__init__(self)
        disabledButton = Button("Disabled Button")
        disabledCheck = CheckBox("Disabled Check")
        normalButton = Button("Normal Button")
        normalCheck = CheckBox("Normal Check")
        panel = VerticalPanel()
        radio0 = RadioButton("group0", "Choice 0")
        radio1 = RadioButton("group0", "Choice 1")
        radio2 = RadioButton("group0", "Choice 2 (Disabled)")
        radio3 = RadioButton("group0", "Choice 3")

        hp=HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(normalButton)
        hp.add(disabledButton)
        
        hp=HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(normalCheck)
        hp.add(disabledCheck)
        
        hp=HorizontalPanel()
        panel.add(hp)
        hp.setSpacing(8)
        hp.add(radio0)
        hp.add(radio1)
        hp.add(radio2)
        hp.add(radio3)
        
        disabledButton.setEnabled(False)
        disabledCheck.setEnabled(False)
        radio2.setEnabled(False)
        
        panel.setSpacing(8)
        self.initWidget(panel)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:38,代码来源:Buttons.py


示例15: __init__

    def __init__(self):
        img = Image("images/num1.png")
        img.addMouseListener(TooltipListener("An image: " + img.getUrl()))
        
        img2 = Image("images/num2.png")
        img2.addMouseListener(TooltipListener("An image: " + img2.getUrl()))

        html = HTML("Some <i>HTML</i> text.")
        html.addMouseListener(TooltipListener("An HTML component."))
        
        panel_h = HorizontalPanel()
        panel_h.add(img)
        panel_h.add(img2)       
        panel_h.setSpacing(8)
        
        panel = VerticalPanel()
        panel.add(panel_h)
        panel.add(html)
        
        panel.setSpacing(8)
        self.setWidget(panel)
开发者ID:AwelEshetu,项目名称:cwm,代码行数:21,代码来源:TooltipTab.py


示例16: __init__

    def __init__(self):
        Sink.__init__(self)
        self.sStrings = [["foo0", "bar0", "baz0", "toto0", "tintin0"],
                         ["foo1", "bar1", "baz1", "toto1", "tintin1"],
                         ["foo2", "bar2", "baz2", "toto2", "tintin2"],
                         ["foo3", "bar3", "baz3", "toto3", "tintin3"],
                         ["foo4", "bar4", "baz4", "toto4", "tintin4"]]

        self.combo = ListBox()
        self.list = ListBox()
        self.echo = Label()

        self.combo.setVisibleItemCount(1)
        self.combo.addChangeListener(self)
        self.list.setVisibleItemCount(10)
        self.list.setMultipleSelect(True)

        for i in range(len(self.sStrings)):
            self.combo.addItem("List %d" % i)
        self.combo.setSelectedIndex(0)
        self.fillList(0)

        self.list.addChangeListener(self)

        horz = HorizontalPanel()
        horz.setVerticalAlignment(HasAlignment.ALIGN_TOP)
        horz.setSpacing(8)
        horz.add(self.combo)
        horz.add(self.list)

        panel = VerticalPanel()
        panel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
        panel.add(horz)
        panel.add(self.echo)
        self.initWidget(panel)

        self.echoSelection()
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:37,代码来源:Lists.py


示例17: __init__

    def __init__(self):
        text="This is a <code>ScrollPanel</code> contained at "
        text+= "the center of a <code>DockPanel</code>.  "
        text+= "By putting some fairly large contents "
        text+= "in the middle and setting its size explicitly, it becomes a "
        text+= "scrollable area within the page, but without requiring the use of "
        text+= "an IFRAME."
        text+= "Here's quite a bit more meaningless text that will serve primarily "
        text+= "to make this thing scroll off the bottom of its visible area.  "
        text+= "Otherwise, you might have to make it really, really small in order "
        text+= "to see the nifty scroll bars!"
        
        contents = HTML(text)
        scroller = ScrollPanel(contents)
        scroller.setStyleName("ks-layouts-Scroller")
        
        dock = DockPanel()
        dock.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        north0 = HTML("This is the <i>first</i> north component", True)
        east = HTML("<center>This<br>is<br>the<br>east<br>component</center>", True)
        south = HTML("This is the south component")
        west = HTML("<center>This<br>is<br>the<br>west<br>component</center>", True)
        north1 = HTML("This is the <b>second</b> north component", True)
        dock.add(north0, DockPanel.NORTH)
        dock.add(east, DockPanel.EAST)
        dock.add(south, DockPanel.SOUTH)
        dock.add(west, DockPanel.WEST)
        dock.add(north1, DockPanel.NORTH)
        dock.add(scroller, DockPanel.CENTER)
        
        Logger.write("Layouts", "TODO: flowpanel")
        flow = FlowPanel()
        for i in range(8):
            flow.add(CheckBox("Flow " + i))

        horz = HorizontalPanel()
        horz.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        horz.add(Button("Button"))
        horz.add(HTML("<center>This is a<br>very<br>tall thing</center>", True))
        horz.add(Button("Button"))

        vert = VerticalPanel()
        vert.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        vert.add(Button("Small"))
        vert.add(Button("--- BigBigBigBig ---"))
        vert.add(Button("tiny"))

        menu = MenuBar()
        menu0 = MenuBar(True)
        menu1 = MenuBar(True)
        menu.addItem("menu0", menu0)
        menu.addItem("menu1", menu1)
        menu0.addItem("child00")
        menu0.addItem("child01")
        menu0.addItem("child02")
        menu1.addItem("child10")
        menu1.addItem("child11")
        menu1.addItem("child12")

        Logger.write("Layouts", "TODO: htmlpanel")
        id = HTMLPanel.createUniqueId()
        text="This is an <code>HTMLPanel</code>.  It allows you to add "
        text+="components inside existing HTML, like this:" + "<span id='" + id
        text+="'></span>" + "Notice how the menu just fits snugly in there?  Cute."
        html = HTMLPanel(text)
        
        DOM.setStyleAttribute(menu.getElement(), "display", "inline")
        html.add(menu, id)

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        
        panel.add(self.makeLabel("Dock Panel"))
        panel.add(dock)
        panel.add(self.makeLabel("Flow Panel"))
        panel.add(flow)
        panel.add(self.makeLabel("Horizontal Panel"))
        panel.add(horz)
        panel.add(self.makeLabel("Vertical Panel"))
        panel.add(vert)
        panel.add(self.makeLabel("HTML Panel"))
        panel.add(html)
        
        self.initWidget(panel)
        self.setStyleName("ks-layouts")
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:86,代码来源:Layouts.py


示例18: __init__

    def __init__(self):
        self.fPasswordText = PasswordTextBox()
        self.fTextArea = TextArea()
        self.fTextBox = TextBox()

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.add(HTML("Normal text box:"))
        panel.add(self.createTextThing(self.fTextBox))
        panel.add(HTML("Password text box:"))
        panel.add(self.createTextThing(self.fPasswordText))
        panel.add(HTML("Text area:"))
        panel.add(self.createTextThing(self.fTextArea))
        self.setWidget(panel)
开发者ID:AwelEshetu,项目名称:cwm,代码行数:14,代码来源:Text.py


示例19: __init__

    def __init__(self):
        self.curImage=0
        self.image=Image()
        self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
        self.nextButton = Image(self.baseURL() + "rembrandt/forward.gif")
        self.prevButton = Image(self.baseURL() + "rembrandt/back.gif")
        self.sImages=["rembrandt/JohannesElison.jpg", "rembrandt/LaMarcheNocturne.jpg", "rembrandt/SelfPortrait1628.jpg", "rembrandt/SelfPortrait1640.jpg", "rembrandt/TheArtistInHisStudio.jpg", "rembrandt/TheReturnOfTheProdigalSon.jpg"]

        for i in range(len(self.sImages)):
            self.sImages[i]=self.baseURL() + self.sImages[i]
        
        self.image.addLoadListener(self)
        self.prevButton.addClickListener(self)
        self.nextButton.addClickListener(self)
        
        topPanel = DockPanel()
        topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        topPanel.add(self.prevButton, DockPanel.WEST)
        topPanel.add(self.nextButton, DockPanel.EAST)
        topPanel.add(self.loadingImage, DockPanel.CENTER)
        
        panel = VerticalPanel()
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.add(HTML("<h2>A Bit of Rembrandt</h2>", True))
        panel.add(topPanel)
        panel.add(self.image)
        
        panel.setWidth("100%")
        self.setWidget(panel)
        self.image.setStyleName("ks-images-Image")
        self.nextButton.setStyleName("ks-images-Button")
        self.prevButton.setStyleName("ks-images-Button")
        
        self.loadImage(0)           
开发者ID:AwelEshetu,项目名称:cwm,代码行数:34,代码来源:Images.py


示例20: DayFilterWidget

class DayFilterWidget(Composite):

	def __init__(self, calendar):
		Composite.__init__(self)

		self.calendar = calendar
		self.dayCheckBoxListener = DayCheckBoxListener(calendar)
		self.outer = VerticalPanel()
		self.initWidget(self.outer)
		self.setStyleName("DynaTable-DayFilterWidget")
		self.outer.add(DayCheckBox(self, "Sunday", 0))
		self.outer.add(DayCheckBox(self, "Monday", 1))
		self.outer.add(DayCheckBox(self, "Tuesday", 2))
		self.outer.add(DayCheckBox(self, "Wednesday", 3))
		self.outer.add(DayCheckBox(self, "Thursday", 4))
		self.outer.add(DayCheckBox(self, "Friday", 5))
		self.outer.add(DayCheckBox(self, "Saturday", 6))

		self.buttonAll = Button("All", self)
		self.buttonNone = Button("None", self)

		hp = HorizontalPanel()
		hp.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
		hp.add(self.buttonAll)
		hp.add(self.buttonNone)
		
		self.outer.add(hp)
		self.outer.setCellVerticalAlignment(hp, HasAlignment.ALIGN_BOTTOM)
		self.outer.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_CENTER)
		
	def setAllCheckBoxes(self, checked):
		for widget in self.outer:
			if hasattr(widget, "setChecked"):
				widget.setChecked(checked)
				self.dayCheckBoxListener.onClick(widget)

	def onClick(self, sender):
		if self.buttonAll == sender:
			self.setAllCheckBoxes(True)
		elif self.buttonNone == sender:
			self.setAllCheckBoxes(False)
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:41,代码来源:DayFilterWidget.py



注:本文中的ui.VerticalPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python color.colorize函数代码示例发布时间:2022-05-27
下一篇:
Python ui.Ui_MainWindow类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap