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

Python Composite.Composite类代码示例

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

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



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


示例16: __init__

    def __init__(self, format='%d-%m-%Y'):
        DateSelectedHandler.__init__(self)
        if self.img_base is None:
            self.img_base = pygwt.getImageBaseURL(True)
        if self.icon_img is None:
            self.icon_img = self.img_base + 'icon_calendar.gif'
        self.format = format
        self.tbox = TextBox()
        self.tbox.setVisibleLength(10)
        # assume valid sep is - / . or nothing
        if format.find('-') >= 0:
            self.sep = '-'
        elif format.find('/') >= 0:
            self.sep = '/'
        elif format.find('.') >= 0:
            self.sep = '.'
        else:
            self.sep = ''
        # self.sep = format[2] # is this too presumptious?
        self.calendar = Calendar()
        self.img = Image(self.icon_img)
        self.img.addStyleName(self.icon_style)
        self.calendarLink = HyperlinkImage(self.img)
        self.todayLink = Hyperlink(self.today_text)
        self.todayLink.addStyleName(self.today_style)
        #
        # lay it out
        #
        hp = HorizontalPanel()
        hp.setSpacing(2)
        vp = VerticalPanel()
        hp.add(self.tbox)
        vp.add(self.calendarLink)
        vp.add(self.todayLink)
        #vp.add(self.calendar)
        hp.add(vp)

        Composite.__init__(self)
        self.initWidget(hp)
        #
        # done with layout, so now set up some listeners
        #
        self.tbox.addFocusListener(self) # hook to onLostFocus
        self.calendar.addSelectedDateListener(getattr(self, "onDateSelected"))
        self.todayLink.addClickListener(getattr(self, "onTodayClicked"))
        self.calendarLink.addClickListener(getattr(self, "onShowCalendar"))

        self.tbox.addChangeListener(getattr(self, "onFieldChanged"))
        self.tbox.addInputListener(getattr(self, "onFieldChanged"))

        self._last_date = None
开发者ID:Afey,项目名称:pyjs,代码行数:51,代码来源:Calendar.py


示例17: __init__

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

        self.tree = Tree()
        root = TreeItem(self.imageItemHTML("home.gif", "[email protected]"))
        self.tree.addItem(root)
        inboxItem = self.addImageItem(root, "Inbox")
        self.addImageItem(root, "Drafts")
        self.addImageItem(root, "Templates")
        self.addImageItem(root, "Sent")
        self.addImageItem(root, "Trash")

        root.setState(True)
        self.initWidget(self.tree)
开发者ID:Afey,项目名称:pyjs,代码行数:14,代码来源:Mailboxes.py


示例18: __init__

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

        self.vp_list=VerticalPanel()
        self.sinks=[]
        self.selectedSink=-1

        self.sp = ScrollPanel(self.vp_list)
        self.sp.setWidth("14em")

        self.initWidget(self.sp)
        self.setStyleName("ks-List")

        self.resize(Window.getClientWidth(), Window.getClientHeight())
开发者ID:Afey,项目名称:pyjs,代码行数:14,代码来源:SinkList.py


示例19: __init__

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

    panel = DockPanel(HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                      VerticalAlignment=HasAlignment.ALIGN_MIDDLE)
    panel.setWidth("100%")

    vp = VerticalPanel()

    grid = FlexTable(CellPadding=4, CellSpacing=4)

    hp = HorizontalPanel()

    handle_n = NextHandle(self)
    handle_f = FinishHandle(self)
    handle_c = ClearHandle(self)

    self.next   = Button("Next",    handle_n, StyleName='button')
    self.finish = Button("Finish!", handle_f, StyleName='button')
    self.clear  = Button("Clear",   handle_c, StyleName='button')

    hp.add(self.clear)
    hp.add(self.finish)
    hp.add(self.next)
    hp.setWidth("70%")

    vp.add(Label("Content-Based Image Retrieval Using OPF", StyleName='label'))
    vp.add(grid)

    vp.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
    vp.add(hp)

    cols = 4
    for i in range(100):
      im = Image('images/cbir/%d.jpg' % random.randint(0, 1000),  Size=("200px", "150px"), StyleName='image-cool')
      grid.setWidget(int(i/cols), i%cols, im)

    panel.add(vp, DockPanel.CENTER)

    self.initWidget(panel)

    self.status = Label()
    vp.add(self.status)
开发者ID:victormatheus,项目名称:cbir_pyjamas,代码行数:43,代码来源:cbir.py


示例20: __init__

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

        self.remote = sink.remote

        panel = VerticalPanel(Width="100%", Spacing=8)

        self.view = Button("View", self)
        self.newpage = Button("New", self)
        self.todoId = None
        self.todoTextName = TextBox()
        self.todoTextName.addKeyboardListener(self)

        self.todoTextArea = RichTextEditor(basePath="/fckeditor/")
        self.todoTextArea.setWidth("100%")
        self.todoTextArea.addSaveListener(self)

        self.todoList = ListBox()
        self.todoList.setVisibleItemCount(7)
        self.todoList.setWidth("200px")
        self.todoList.addClickListener(self)

        self.fDialogButton = Button("Upload Files", self)

        self.status = HTML()

        panel.add(HTML("Status:"))
        panel.add(self.status)
        panel.add(self.fDialogButton)
        panel.add(Label("Create New Page (doesn't save current one!):"))
        panel.add(self.newpage)
        panel.add(Label("Add/Edit New Page:"))
        panel.add(self.todoTextName)
        panel.add(Label("Click to Load and Edit (doesn't save current one!):"))
        panel.add(self.todoList)
        panel.add(self.view)
        panel.add(Label("New Page HTML.  Click 'save' icon to save.  (pagename is editable as well)"))
        panel.add(self.todoTextArea)

        self.setWidget(panel)

        self.remote.getPages(self)
开发者ID:janjaapbos,项目名称:pyjs,代码行数:42,代码来源:WebPageEdit.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python DockPanel.DockPanel类代码示例发布时间:2022-05-25
下一篇:
Python Button.Button类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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