当前位置: 首页>>代码示例>>Python>>正文


Python Composite.Composite类代码示例

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


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

示例1: __init__

    def __init__(self):
        Composite.__init__(self)
        self.buttons = HorizontalPanel()
        self.buttons.setSpacing("10px")
        self.refresh_button = ControlButton("images/refresh.png",
                                            "images/refresh_down.png",
                                            "reload",
                                            "reload"
                                            )
        self.refresh_button.addMouseListener(ReloadButtonListner())
        self.refresh_button.base = self
        
        self.start_button = ControlButton("images/start.png"
                                          , "images/pause.png"
                                          , "  start"
                                          , "  pause"
                                          )

        self.start_button.addMouseListener(StartButtonListner())
        self.start_button.base = self
        
        
        self.buttons.add(self.refresh_button)
        self.buttons.add(self.start_button)
        self.initWidget(self.buttons)
开发者ID:vijayendra,项目名称:Puzzle-Game,代码行数:25,代码来源:Puzzle.py

示例2: __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:FreakTheMighty,项目名称:pyjamas,代码行数:27,代码来源:DayFilterWidget.py

示例3: __init__

    def __init__(self, **kwargs):

        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-TabBar"

        # this is awkward: HorizontalPanel is the composite,
        # so we either the element here, and pass it in to HorizontalPanel.
        element = None
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')

        self.panel = HorizontalPanel(Element=element)
        self.selectedTab = None
        self.tabListeners = []

        self.panel.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM)

        first = HTML(" ", True)
        rest = HTML(" ", True)
        first.setStyleName("gwt-TabBarFirst")
        rest.setStyleName("gwt-TabBarRest")
        first.setHeight("100%")
        rest.setHeight("100%")

        self.panel.add(first)
        self.panel.add(rest)
        first.setHeight("100%")
        self.panel.setCellHeight(first, "100%")
        self.panel.setCellWidth(rest, "100%")

        Composite.__init__(self, self.panel, **kwargs)
        self.sinkEvents(Event.ONCLICK)
开发者ID:anandology,项目名称:pyjamas,代码行数:31,代码来源:TabBar.py

示例4: __init__

 def __init__(self, chart):
     self.chart = chart
     self.canvas = chart.canvas
     
     self.b2 = Button("Compositing", self)
     self.b3 = Button("Paths & shapes", self)
     self.b4 = Button("Arcs & circles", self)
     self.b1 = Button("Bezier curves", self)
     self.b6 = Button("Colors", self)
     self.b7 = Button("Translating", self)
     self.b8 = Button("Scaling", self)
     self.b5 = Button("Rotating", self)
     self.b10 = Button("Transparency", self)
     self.b11 = Button("Lines", self)
     self.b9 = Button("Animations", self)
     
     hp = HorizontalPanel()
     vp = VerticalPanel()
     vp.setHorizontalAlignment(HasAlignment.ALIGN_LEFT)
     vp.add(Label("MENU"))
     vp.setSpacing(6)
     vp.add(self.b2)
     vp.add(self.b3)
     vp.add(self.b4)
     vp.add(self.b1)
     vp.add(self.b6)
     vp.add(self.b7)
     vp.add(self.b8)
     vp.add(self.b5)
     vp.add(self.b10)
     vp.add(self.b11)
     vp.add(self.b9)
     hp.add(vp)
     
     Composite.__init__(self, hp)
开发者ID:anandology,项目名称:pyjamas,代码行数:35,代码来源:SuiteDemo.py

示例5: __init__

 def __init__(self, **kwargs):
     
     self.b = None
     self.text = None
     self.instance_name = None
     self.event_receiver = None
     Composite.__init__(self, **kwargs)
开发者ID:anandology,项目名称:pyjamas,代码行数:7,代码来源:BuilderWidget.py

示例6: __init__

    def __init__(self, tabBar=None, **kwargs):
        self.children = [] # TODO: can self.children be used instead?
        self.tab_names = {} 
        self.deck = kwargs.pop('Deck', None)
        floatingtab = kwargs.pop('FloatingTab', False)
        if self.deck is None:
            self.deck = DeckPanel(StyleName="gwt-TabPanelBottom")
        if tabBar is None:
            self.tabBar = TabBar()
        else:
            self.tabBar = tabBar
        self.tabListeners = []

        # this is awkward: VerticalPanel is the composite,
        # so we get the element here, and pass it in to VerticalPanel.
        element = kwargs.pop('Element', None)

        panel = VerticalPanel(Element=element)
        if not floatingtab:
            panel.add(self.tabBar)
        if self.deck.getParent() is None:
            panel.add(self.deck)
            panel.setCellHeight(self.deck, "100%")
        self.tabBar.setWidth("100%")
        self.tabBar.addTabListener(self)

        kwargs['StyleName'] = kwargs.get('StyleName', "gwt-TabPanel")

        PanelBase.__init__(self)
        Composite.__init__(self, panel, **kwargs)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:30,代码来源:TabPanel.py

示例7: __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:Afey,项目名称:pyjs,代码行数:28,代码来源:TopPanel.py

示例8: __init__

    def __init__(self, owner):
        Composite.__init__(self)
        self.owner = owner
        self.bar = DockPanel()
        self.gotoFirst = Button("&lt;&lt;", self)
        self.gotoNext = Button("&gt;", self)
        self.gotoPrev = Button("&lt;", self)
        self.status = HTML()

        self.initWidget(self.bar)
        self.bar.setStyleName("navbar")
        self.status.setStyleName("status")

        buttons = HorizontalPanel()
        buttons.add(self.gotoFirst)
        buttons.add(self.gotoPrev)
        buttons.add(self.gotoNext)
        self.bar.add(buttons, DockPanel.EAST)
        self.bar.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT)
        self.bar.add(self.status, DockPanel.CENTER)
        self.bar.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellHorizontalAlignment(self.status, HasAlignment.ALIGN_RIGHT)
        self.bar.setCellVerticalAlignment(self.status, HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellWidth(self.status, "100%")

        self.gotoPrev.setEnabled(False)
        self.gotoFirst.setEnabled(False)
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:DynaTableWidget.py

示例9: __init__

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

示例10: __init__

    def __init__(self, *args, **kwargs):

        self.handlers = []
        self.content = None
        self.images = False

        # this is awkward: VerticalPanel is the composite,
        # so we get the element here, and pass it in to VerticalPanel.
        element = kwargs.pop('Element', None)

        # process the passed arguments
        headerText = headerWidget = None
        isOpen = False
        if len(args) == 1:
            header = args[0]
        if len(args) == 2:
            header, isOpen = args[:2]
        # apparently "basestring" is not understood
        if isinstance(header, basestring):
            headerText = header
        else:
            headerWidget = header
        isOpen = kwargs.pop('isOpen', isOpen)
        headerText = kwargs.pop('header', headerText)
        headerWidget = kwargs.pop('header', headerWidget)
        # TODO: add ImageBundle
        # images = kwargs.pop('images', None)

        # If both headerText and headerWidget are arguments, headerText will
        # be used to preserve API compatibility.
        headerContent = headerWidget
        if headerText is not None or headerContent is None:
            if headerText is None:
                headerText = ""
            headerContent = DefaultHeader(headerText)

        self.mainPanel = VerticalPanel(Element=element)

        self._init_header(headerContent)

        self.contentWrapper = SimplePanel()
        self.mainPanel.add(self.header)
        self.mainPanel.add(self.contentWrapper)
        DOM.setStyleAttribute(self.contentWrapper.getElement(),
                              "padding", "0px");
        DOM.setStyleAttribute(self.contentWrapper.getElement(),
                              "overflow", "hidden");

        kwargs['StyleName'] = kwargs.get('StyleName', "gwt-DisclosurePanel")
        Composite.__init__(self, self.mainPanel, **kwargs)

        # Must call setOpen after creating the initializing the object
        self.isOpen = None
        self.setOpen(isOpen)

        self.setContentDisplay()
开发者ID:Afey,项目名称:pyjs,代码行数:56,代码来源:DisclosurePanel.py

示例11: __init__

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

        self.fProto = []
        self.fTree = Tree()
        
        self.fTree.addTreeListener(self)
        self.initWidget(self.fTree)
        self.remote = InfoServicePython()
        self.remote.index("", 1, self)
开发者ID:anandology,项目名称:pyjamas,代码行数:10,代码来源:Trees.py

示例12: __init__

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

        columns = ["Name", "Description", "Schedule"]
        styles = ["name", "desc", "sched"]
        self.calProvider = CalendarProvider(self)
        self.daysFilter = [True, True, True, True, True, True, True]
        self.pendingRefresh = False

        self.dynaTable = DynaTableWidget(self.calProvider, columns, styles, visibleRows)
        self.initWidget(self.dynaTable)
开发者ID:Afey,项目名称:pyjs,代码行数:11,代码来源:SchoolCalendarWidget.py

示例13: __init__

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

        stackPanel = StackPanel()
        stackPanel.add(Mailboxes(), self.createHeaderHTML("mailgroup.gif", "Mail"), True)
        stackPanel.add(Tasks(), self.createHeaderHTML("tasksgroup.gif", "Tasks"), True)
        stackPanel.add(Contacts(), self.createHeaderHTML("contactsgroup.gif", "Contacts"), True)

        stackPanel.showStack(0)

        self.initWidget(stackPanel)
开发者ID:Afey,项目名称:pyjs,代码行数:11,代码来源:Shortcuts.py

示例14: __init__

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

        panel = VerticalPanel()
        panel.add(CheckBox("Get groceries"))
        panel.add(CheckBox("Walk the dog"))
        panel.add(CheckBox("Start Web 2.0 company"))
        panel.add(CheckBox("Write cool app in GWT"))
        panel.add(CheckBox("Get funding"))
        panel.add(CheckBox("Take a vacation"))
        self.initWidget(panel)
        self.setStyleName("mail-Tasks")
开发者ID:Afey,项目名称:pyjs,代码行数:12,代码来源:Tasks.py

示例15: __init__

    def __init__(self):
        self.average = 1
        self.iterations = 1
        self.startTime = -1

        self.refreshRateLabel = Label("")
        self.averageLabel = Label("")

        layout = VerticalPanel()
        layout.add(self.refreshRateLabel)
        layout.add(self.averageLabel)

        Composite.__init__(self, layout)
开发者ID:andreyvit,项目名称:pyjamas,代码行数:13,代码来源:ParticleDemo.py


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