コード例 #1
0
ファイル: SuiteDemo.py プロジェクト: anandology/pyjamas
 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)
コード例 #2
0
    def __init__(self, **kwargs):

        self.b = None
        self.text = None
        self.instance_name = None
        self.event_receiver = None
        Composite.__init__(self, **kwargs)
コード例 #3
0
 def __init__(self):
     layout = VerticalPanel()
     layout.add(
         HTML(
             "<b style=\"color:#f00;\">Stroke Gradients currently not working correctly in IE. RadialGradients are not supported in VML. Contributor assistance welcome :).</b>"
         ))
     Composite.__init__(self, layout)
コード例 #4
0
ファイル: BuilderWidget.py プロジェクト: anandology/pyjamas
 def __init__(self, **kwargs):
     
     self.b = None
     self.text = None
     self.instance_name = None
     self.event_receiver = None
     Composite.__init__(self, **kwargs)
コード例 #5
0
ファイル: DynaTableWidget.py プロジェクト: Afey/pyjs
    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)
コード例 #6
0
    def __init__(self):
        Composite.__init__(self)

        self.contacts = []
        self.contacts.append(Contact("Benoit Mandelbrot",
                                     "*****@*****.**"))
        self.contacts.append(Contact("Albert Einstein", "*****@*****.**"))
        self.contacts.append(Contact("Rene Descartes", "*****@*****.**"))
        self.contacts.append(Contact("Bob Saget", "*****@*****.**"))
        self.contacts.append(
            Contact("Ludwig von Beethoven", "*****@*****.**"))
        self.contacts.append(Contact("Richard Feynman", "*****@*****.**"))
        self.contacts.append(Contact("Alan Turing", "*****@*****.**"))
        self.contacts.append(Contact("John von Neumann", "*****@*****.**"))

        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.initWidget(self.panel)
        self.setStyleName("mail-Contacts")
コード例 #7
0
    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")
コード例 #8
0
    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)
コード例 #9
0
ファイル: DayFilterWidget.py プロジェクト: wkornewald/pyjs
    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)
コード例 #10
0
ファイル: TabBar.py プロジェクト: trb116/pythonanalyzer
    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("&nbsp;", True)
        rest = HTML("&nbsp;", 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)
コード例 #11
0
ファイル: TopPanel.py プロジェクト: Afey/pyjs
    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")
コード例 #12
0
    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)
コード例 #13
0
    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)
コード例 #14
0
    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)
コード例 #15
0
ファイル: Puzzle.py プロジェクト: vijayendra/Puzzle-Game
    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"
                                          , "&nbsp;&nbsp;start"
                                          , "&nbsp;&nbsp;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)
コード例 #16
0
ファイル: SinkList.py プロジェクト: anandology/pyjamas
 def __init__(self):
     Composite.__init__(self)
     self.vp_list=VerticalPanel()
     self.sinks=[]
     self.selectedSink=-1
     
     self.initWidget(self.vp_list)
     self.setStyleName("ks-List")
コード例 #17
0
    def __init__(self):
        Composite.__init__(self)
        self.vp_list = VerticalPanel()
        self.sinks = []
        self.selectedSink = -1

        self.initWidget(self.vp_list)
        self.setStyleName("ks-List")
コード例 #18
0
    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()
コード例 #19
0
ファイル: DisclosurePanel.py プロジェクト: Afey/pyjs
    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()
コード例 #20
0
ファイル: Trees.py プロジェクト: pombredanne/pyjamas
    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)
コード例 #21
0
ファイル: Trees.py プロジェクト: anandology/pyjamas
    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)
コード例 #22
0
ファイル: SchoolCalendarWidget.py プロジェクト: Afey/pyjs
    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)
コード例 #23
0
ファイル: Shortcuts.py プロジェクト: Afey/pyjs
    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)
コード例 #24
0
    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")
コード例 #25
0
    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)
コード例 #26
0
ファイル: ParticleDemo.py プロジェクト: andreyvit/pyjamas
    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)
コード例 #27
0
    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)
コード例 #28
0
    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
コード例 #29
0
ファイル: SinkList.py プロジェクト: Afey/pyjs
    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())
コード例 #30
0
ファイル: Mailboxes.py プロジェクト: wkornewald/pyjs
    def __init__(self):
        Composite.__init__(self)

        self.tree = Tree()
        root = TreeItem(self.imageItemHTML("home.gif", "*****@*****.**"))
        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)
コード例 #31
0
    def __init__(self):
        Composite.__init__(self)

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

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

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

        self.resize(Window.getClientWidth(), Window.getClientHeight())
コード例 #32
0
ファイル: Mailboxes.py プロジェクト: Afey/pyjs
    def __init__(self):
        Composite.__init__(self)

        self.tree = Tree()
        root = TreeItem(self.imageItemHTML("home.gif", "*****@*****.**"))
        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)
コード例 #33
0
ファイル: Shortcuts.py プロジェクト: minghuascode/pyj
    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)
コード例 #34
0
    def __init__(self, provider, columns, columnStyles, rowCount):
        Composite.__init__(self)

        self.acceptor = RowDataAcceptorImpl(self)
        self.outer = DockPanel()
        self.startRow = 0
        self.grid = Grid()
        self.navbar = NavBar(self)

        self.provider = provider
        self.initWidget(self.outer)
        self.grid.setStyleName("table")
        self.outer.add(self.navbar, DockPanel.NORTH)
        self.outer.add(self.grid, DockPanel.CENTER)
        self.initTable(columns, columnStyles, rowCount)
        self.setStyleName("DynaTable-DynaTableWidget")
コード例 #35
0
ファイル: DynaTableWidget.py プロジェクト: Afey/pyjs
    def __init__(self, provider, columns, columnStyles, rowCount):
        Composite.__init__(self)

        self.acceptor = RowDataAcceptorImpl(self)
        self.outer = DockPanel()
        self.startRow = 0
        self.grid = Grid()
        self.navbar = NavBar(self)

        self.provider = provider
        self.initWidget(self.outer)
        self.grid.setStyleName("table")
        self.outer.add(self.navbar, DockPanel.NORTH)
        self.outer.add(self.grid, DockPanel.CENTER)
        self.initTable(columns, columnStyles, rowCount)
        self.setStyleName("DynaTable-DynaTableWidget")
コード例 #36
0
ファイル: Puzzle.py プロジェクト: vijayendra/Puzzle-Game
 def __init__(self, up_url, down_url, up_msg, down_msg):
     Composite.__init__(self)
     self.state = "up"
     self.up_url = up_url
     self.down_url = down_url
     self.up_msg = up_msg
     self.down_msg = down_msg
     self.control = VerticalPanel()
     self.image = Image(up_url)
     self.image.setStyleName("gwt-Image-Cell")
     self.text = HTML(up_msg)
     self.image.base = self
     self.text.base = self
     self.text.horzAlign = "center"
     self.control.add(self.image)
     self.control.add(self.text)
     self.initWidget(self.control)
コード例 #37
0
    def __init__(self):
        Composite.__init__(self)

        self.albums = []
        self.photos = []
        self.grid = Grid(4, 4, CellPadding=4, CellSpacing=4)
        self.grid.addTableListener(self)
        self.drill = 0
        self.pos = 0
        self.up = Button("Up", self)
        self.next = Button("Next", self)
        self.prev = Button("Prev", self)
        self.timer = Timer(notify=self)
        self.userid = "jameskhedley"
        self.album_url = "http://picasaweb.google.com/data/feed/base/user/" + self.userid + "?alt=json-in-script&kind=album&hl=en_US&callback=restCb"
        self.doRESTQuery(self.album_url, self.timer)

        self.vp = VerticalPanel()
        self.disclosure = DisclosurePanel(
            "Click for boring technical details.")
        self.disclosure.add(
            HTML(
                '''<p>OK so you want to write client JS to do a RESTful HTTP query from picasa right?
				 Well you can't because of the Same Origin Policy. Basically this means that
				 because the domain of the query and the domain of the hosted site are different,
				 then that could well be a cross-site scripting (XSS) attack. So, the workaround is to
				 do the call from a script tag so the JSON we get back is part of the document.
				 But since we don't know what URL to hit yet, once we find out then we have to inject
				 a new script tag dynamically which the browser will run as soon as we append it.
				 To be honest I'm not 100% why Google use RESTful services and not JSON-RPC or somesuch,
				 which would be easier. Well, easier for me.'''))

        self.IDPanel = HorizontalPanel()
        self.IDPanel.add(Label("Enter google account:"))
        self.IDButton = Button("Go", self)

        self.IDBox = TextBox()
        self.IDBox.setText(self.userid)
        self.IDPanel.add(self.IDBox)
        self.IDPanel.add(self.IDButton)
        self.vp.add(self.IDPanel)
        self.vp.add(self.disclosure)
        self.vp.add(self.grid)

        self.initWidget(self.vp)
コード例 #38
0
ファイル: WebPageEdit.py プロジェクト: wkornewald/pyjs
    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)
コード例 #39
0
ファイル: cbir.py プロジェクト: victormatheus/cbir_pyjamas
  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)
コード例 #40
0
ファイル: Photos.py プロジェクト: anandology/pyjamas
    def __init__(self):
        Composite.__init__(self)

        self.albums = []
        self.photos = []
        self.grid = Grid(4, 4, CellPadding=4, CellSpacing=4)
        self.grid.addTableListener(self)
        self.drill = 0
        self.pos = 0
        self.up = Button("Up", self) 
        self.next = Button("Next", self) 
        self.prev = Button("Prev", self) 
        self.timer = Timer(notify=self)
        self.userid = "jameskhedley"
        self.album_url = "http://picasaweb.google.com/data/feed/base/user/" + self.userid + "?alt=json-in-script&kind=album&hl=en_US&callback=restCb"
        self.doRESTQuery(self.album_url, self.timer)

        self.vp = VerticalPanel()
        self.disclosure = DisclosurePanel("Click for boring technical details.") 
        self.disclosure.add(HTML('''<p>OK so you want to write client JS to do a RESTful HTTP query from picasa right?
				 Well you can't because of the Same Origin Policy. Basically this means that
				 because the domain of the query and the domain of the hosted site are different,
				 then that could well be a cross-site scripting (XSS) attack. So, the workaround is to
				 do the call from a script tag so the JSON we get back is part of the document. 
				 But since we don't know what URL to hit yet, once we find out then we have to inject
				 a new script tag dynamically which the browser will run as soon as we append it.
				 To be honest I'm not 100% why Google use RESTful services and not JSON-RPC or somesuch,
				 which would be easier. Well, easier for me.'''))
        
        self.IDPanel = HorizontalPanel()
        self.IDPanel.add(Label("Enter google account:"))
        self.IDButton = Button("Go", self)
        
        self.IDBox = TextBox()
        self.IDBox.setText(self.userid)
        self.IDPanel.add(self.IDBox)
        self.IDPanel.add(self.IDButton)
        self.vp.add(self.IDPanel)
        self.vp.add(self.disclosure)
        self.vp.add(self.grid)

        self.initWidget(self.vp)
コード例 #41
0
ファイル: WebPageEdit.py プロジェクト: janjaapbos/pyjs
    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)
コード例 #42
0
    def __init__(self, p, child, cDelegate, kDelegate):

        Composite.__init__(self)

        self.clickDelegate = cDelegate
        self.keyDelegate = kDelegate

        self.focusablePanel = SimplePanel(Focus.createFocusable())
        self.focusablePanel.setWidget(child)
        wrapperWidget = p.createTabTextWrapper()
        if wrapperWidget is None:
            self.initWidget(self.focusablePanel)
        else:
            wrapperWidget.setWidget(self.focusablePanel)
            self.initWidget(wrapperWidget)

        if hasattr(child, "addKeyboardListener"):
            child.addKeyboardListener(kDelegate)

        self.sinkEvents(Event.ONCLICK | Event.ONKEYDOWN)
コード例 #43
0
ファイル: Puzzle.py プロジェクト: vijayendra/Puzzle-Game
    def __init__(self):
        Composite.__init__(self)

        self.outer = VerticalPanel()
        self.outer.setSpacing("20px")
        self.outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER)
        
        self.display_panel = DisplayPanel()
        self.screen = Screen()
        self.screen.base = self
        self.screen.display_panel = self.display_panel
        self.control_panel = ControlPanel()
        self.control_panel.base = self
        
        self.initWidget(self.outer)
        self.outer.add(self.display_panel)
        self.outer.add(self.screen)
        self.outer.add(self.control_panel)

        self.initDashboard()
コード例 #44
0
ファイル: ClickDelegatePanel.py プロジェクト: Afey/pyjs
    def __init__(self, p, child, cDelegate, kDelegate) :

        Composite.__init__(self)

        self.clickDelegate = cDelegate
        self.keyDelegate = kDelegate

        self.focusablePanel = SimplePanel(Focus.createFocusable())
        self.focusablePanel.setWidget(child)
        wrapperWidget = p.createTabTextWrapper()
        if wrapperWidget is None:
            self.initWidget(self.focusablePanel)
        else :
            wrapperWidget.setWidget(self.focusablePanel)
            self.initWidget(wrapperWidget)

        if hasattr(child, "addKeyboardListener"):
            child.addKeyboardListener(kDelegate)

        self.sinkEvents(Event.ONCLICK | Event.ONKEYDOWN)
コード例 #45
0
ファイル: Puzzle.py プロジェクト: vijayendra/Puzzle-Game
    def __init__(self, owner):
        Composite.__init__(self)
        self.owner = owner
        self.bar = DockPanel()
        
        self.timer_msg = HTML("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timer:&nbsp;")
        self.timer = TimeDisplay()
        self.timer_panel = HorizontalPanel()
        self.timer_panel.add(self.timer_msg)
        self.timer_panel.add(self.timer)
        
        self.counter_msg = HTML("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;total moves:&nbsp;")
        self.counter = HTML("0")
        self.counter_panel = HorizontalPanel()
        self.counter_panel.add(self.counter_msg)
        self.counter_panel.add(self.counter)
        
        self.initWidget(self.bar)
        self.bar.add(self.timer_panel, DockPanel.WEST)
        self.bar.add(self.counter_panel, DockPanel.EAST)

        self.setStyleName("Puzzle-DisplayPanel")
コード例 #46
0
ファイル: MailList.py プロジェクト: trb116/pythonanalyzer
    def __init__(self, mailObject):
        Composite.__init__(self)

        self.countLabel = HTML()
        self.newerButton = HTML("<a href='javascript:;'>&lt; newer</a>", True)
        self.olderButton = HTML("<a href='javascript:;'>older &gt;</a>", True)
        self.startIndex = 0
        self.selectedRow = -1
        self.table = FlexTable()
        self.navBar = HorizontalPanel()
        self.mailObject = mailObject

        # Setup the table.
        self.table.setCellSpacing(0)
        self.table.setCellPadding(2)
        self.table.setWidth("100%")

        # Hook up events.
        self.table.addTableListener(self)
        self.newerButton.addClickListener(self)
        self.olderButton.addClickListener(self)

        # Create the 'navigation' bar at the upper-right.
        innerNavBar = HorizontalPanel()
        innerNavBar.setSpacing(8)
        innerNavBar.add(self.newerButton)
        innerNavBar.add(self.countLabel)
        innerNavBar.add(self.olderButton)

        self.navBar.setStyleName("mail-ListNavBar")
        self.navBar.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
        self.navBar.add(innerNavBar)
        self.navBar.setWidth("100%")

        self.initWidget(self.table)
        self.setStyleName("mail-List")

        self.initTable()
        self.update()
コード例 #47
0
ファイル: MailList.py プロジェクト: Ludovic-Condette/pyjs
    def __init__(self, mailObject):
        Composite.__init__(self)

        self.countLabel = HTML()
        self.newerButton = HTML("<a href='javascript:;'>&lt; newer</a>", True)
        self.olderButton = HTML("<a href='javascript:;'>older &gt;</a>", True)
        self.startIndex = 0
        self.selectedRow = -1
        self.table = FlexTable()
        self.navBar = HorizontalPanel()
        self.mailObject = mailObject

        # Setup the table.
        self.table.setCellSpacing(0)
        self.table.setCellPadding(2)
        self.table.setWidth("100%")

        # Hook up events.
        self.table.addTableListener(self)
        self.newerButton.addClickListener(self)
        self.olderButton.addClickListener(self)

        # Create the 'navigation' bar at the upper-right.
        innerNavBar = HorizontalPanel()
        innerNavBar.setSpacing(8)
        innerNavBar.add(self.newerButton)
        innerNavBar.add(self.countLabel)
        innerNavBar.add(self.olderButton)

        self.navBar.setStyleName("mail-ListNavBar")
        self.navBar.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
        self.navBar.add(innerNavBar)
        self.navBar.setWidth("100%")

        self.initWidget(self.table)
        self.setStyleName("mail-List")

        self.initTable()
        self.update()
コード例 #48
0
ファイル: Email.py プロジェクト: wkornewald/pyjs
    def __init__(self, **kwargs):

        element = None
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')

        panel = VerticalPanel(Element=element)
        Composite.__init__(self, panel, **kwargs)

        self.TEXT_WAITING = "Please wait..."
        self.TEXT_ERROR = "Server Error"

        self.remote_py = EchoServicePython()

        self.status = Label()
        self.subject = TextBox()
        self.subject.setVisibleLength(60)
        self.sender = TextBox()
        self.sender.setVisibleLength(40)
        self.message = TextArea()
        self.message.setCharacterWidth(60)
        self.message.setVisibleLines(15)

        self.button_py = Button("Send", self)

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

        panel.add(HTML("Subject:"))
        panel.add(self.subject)
        panel.add(HTML("From:"))
        panel.add(self.sender)
        panel.add(
            HTML("Your Message - please keep it to under 1,000 characters"))
        panel.add(self.message)
        panel.add(buttons)
        panel.add(self.status)
コード例 #49
0
ファイル: Contacts.py プロジェクト: Ludovic-Condette/pyjs
    def __init__(self):
        Composite.__init__(self)

        self.contacts = []
        self.contacts.append(Contact("Benoit Mandelbrot", "*****@*****.**"))
        self.contacts.append(Contact("Albert Einstein", "*****@*****.**"))
        self.contacts.append(Contact("Rene Descartes", "*****@*****.**"))
        self.contacts.append(Contact("Bob Saget", "*****@*****.**"))
        self.contacts.append(Contact("Ludwig von Beethoven", "*****@*****.**"))
        self.contacts.append(Contact("Richard Feynman", "*****@*****.**"))
        self.contacts.append(Contact("Alan Turing", "*****@*****.**"))
        self.contacts.append(Contact("John von Neumann", "*****@*****.**"))

        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.initWidget(self.panel)
        self.setStyleName("mail-Contacts")
コード例 #50
0
ファイル: Email.py プロジェクト: FreakTheMighty/pyjamas
    def __init__(self, **kwargs):

        element = None
        if kwargs.has_key('Element'):
            element = kwargs.pop('Element')

        panel = VerticalPanel(Element=element)
        Composite.__init__(self, panel, **kwargs)

        self.TEXT_WAITING = "Please wait..."
        self.TEXT_ERROR = "Server Error"

        self.remote_py = EchoServicePython()

        self.status=Label()
        self.subject = TextBox()
        self.subject.setVisibleLength(60)
        self.sender = TextBox()
        self.sender.setVisibleLength(40)
        self.message = TextArea()
        self.message.setCharacterWidth(60)
        self.message.setVisibleLines(15)
        
        self.button_py = Button("Send", self)

        buttons = HorizontalPanel()
        buttons.add(self.button_py)
        buttons.setSpacing(8)
        
        panel.add(HTML("Subject:"))
        panel.add(self.subject)
        panel.add(HTML("From:"))
        panel.add(self.sender)
        panel.add(HTML("Your Message - please keep it to under 1,000 characters"))
        panel.add(self.message)
        panel.add(buttons)
        panel.add(self.status)
コード例 #51
0
ファイル: MailDetail.py プロジェクト: Afey/pyjs
    def __init__(self):
        Composite.__init__(self)

        panel = VerticalPanel()
        headerPanel = VerticalPanel()
        self.subject = HTML()
        self.sender = HTML()
        self.recipient = HTML()
        self.body = HTML()
        self.scroller = ScrollPanel(self.body)

        self.body.setWordWrap(True)

        headerPanel.add(self.subject)
        headerPanel.add(self.sender)
        headerPanel.add(self.recipient)
        headerPanel.setWidth("100%")

        innerPanel = DockPanel()
        innerPanel.add(headerPanel, DockPanel.NORTH)
        innerPanel.add(self.scroller, DockPanel.CENTER)

        innerPanel.setCellHeight(self.scroller, "100%")
        panel.add(innerPanel)
        innerPanel.setSize("100%", "100%")
        self.scroller.setSize("100%", "100%")
        self.initWidget(panel)

        self.setStyleName("mail-Detail")
        headerPanel.setStyleName("mail-DetailHeader")
        innerPanel.setStyleName("mail-DetailInner")
        self.subject.setStyleName("mail-DetailSubject")
        self.sender.setStyleName("mail-DetailSender")
        self.recipient.setStyleName("mail-DetailRecipient")
        self.body.setStyleName("mail-DetailBody")
        Logger("Mail detail", " ")
コード例 #52
0
    def __init__(self):
        Composite.__init__(self)

        panel = VerticalPanel()
        headerPanel = VerticalPanel()
        self.subject = HTML()
        self.sender = HTML()
        self.recipient = HTML()
        self.body = HTML()
        self.scroller = ScrollPanel(self.body)

        self.body.setWordWrap(True)

        headerPanel.add(self.subject)
        headerPanel.add(self.sender)
        headerPanel.add(self.recipient)
        headerPanel.setWidth("100%")

        innerPanel = DockPanel()
        innerPanel.add(headerPanel, DockPanel.NORTH)
        innerPanel.add(self.scroller, DockPanel.CENTER)

        innerPanel.setCellHeight(self.scroller, "100%")
        panel.add(innerPanel)
        innerPanel.setSize("100%", "100%")
        self.scroller.setSize("100%", "100%")
        self.initWidget(panel)

        self.setStyleName("mail-Detail")
        headerPanel.setStyleName("mail-DetailHeader")
        innerPanel.setStyleName("mail-DetailInner")
        self.subject.setStyleName("mail-DetailSubject")
        self.sender.setStyleName("mail-DetailSender")
        self.recipient.setStyleName("mail-DetailRecipient")
        self.body.setStyleName("mail-DetailBody")
        Logger("Mail detail", " ")
コード例 #53
0
    def __init__(self):
        Composite.__init__(self)
        self.guesses = 0
        self.score = 0
        self.level = 5
        self.answer = ''
        self.blanks = ''

        self.vp_main = VerticalPanel()
        self.vp_main.setSpacing(4)
        self.hangdude = HangDude()
        self.cmdNew = Button("Start", self)

        self.radLevel5 = RadioButton("group0", "5-10 letters")
        self.radLevel5.setChecked(True)
        self.radLevel10 = RadioButton("group0", "10-15 letters")
        self.radLevel15 = RadioButton("group0", "15-20 letters")
        self.radLevel20 = RadioButton("group0", "20+ letters")

        self.radLevel5.addClickListener(self.onRadioSelect)
        self.radLevel10.addClickListener(self.onRadioSelect) 
        self.radLevel15.addClickListener(self.onRadioSelect)
        self.radLevel20.addClickListener(self.onRadioSelect) 

        self.rad_hp = HorizontalPanel()
        self.rad_hp.setSpacing(4)
        self.rad_hp.add(self.radLevel5)
        self.rad_hp.add(self.radLevel10)
        self.rad_hp.add(self.radLevel15)
        self.rad_hp.add(self.radLevel20)
        self.rad_hp.add(self.cmdNew)

        self.puzzlestring = HTML()

        self.key_widgets = []
        for i in range (len(string.uppercase)):
            self.key_widgets.append(Button(string.uppercase[i:i+1], self))

        self.toprow = HorizontalPanel()
        self.midrow = HorizontalPanel()
        self.botrow = HorizontalPanel()

        for i in range(len(self.key_widgets)):
            if i <= 7:
                 self.toprow.add(self.key_widgets[i])
            elif i <= 16:
                 self.midrow.add(self.key_widgets[i])
            else:
                 self.botrow.add(self.key_widgets[i])
        
        self.vp_main.add(self.hangdude)
        self.vp_main.add(self.puzzlestring)
        self.vp_main.add(self.toprow)
        self.vp_main.add(self.midrow)
        self.vp_main.add(self.botrow)
        self.vp_main.add(self.rad_hp)

        for i in range(1,12):
            self.hangdude.draw(i)

        self.setWidget(self.vp_main)
コード例 #54
0
ファイル: LogoDemo.py プロジェクト: wkornewald/pyjs
 def __init__(self):
     Composite.__init__(self, VerticalPanel())
コード例 #55
0
 def __init__(self):
     Composite.__init__(self)
コード例 #56
0
    def __init__(self):
        Composite.__init__(self)

        self.m_isInText = False
        self.m_lastText = ""
        self.trigger = False
        self.m_lastRange = None

        # Timer for trying real time selection change stuff
        self.m_timerRange = None
        self.m_selTimer = Timer()

        self.m_mainPanel = DockPanel()
        self.m_toolbarPanel = HorizontalPanel()
        self.m_toolbarPanel.setWidth("100%")
        self.m_toolbarPanel.setHeight("25px")
        self.m_toolbarPanel.setBorderWidth(1)
        self.m_toolbarPanel.addStyleName("timeline-RichTextToolbar")

        self.m_textW = RichTextArea()
        self.m_textW.addClickListener(self)
        self.m_textW.addKeyboardListener(self)
        self.m_textW.addFocusListener(self)
        self.m_textW.addMouseListener(self)
        # According to gwt doc, these do need to be set because this is a frame
        self.m_textW.setHeight("100%")
        self.m_textW.setWidth("100%")

        # Add buttons
        self.m_formatter = self.getFormatter()

        self.m_boldW = self.addToggleButton(self.m_toolbarPanel,
                                            Icons.bold_icon, "Bold")
        self.m_italicW = self.addToggleButton(self.m_toolbarPanel,
                                              Icons.italics_icon, "Italic")
        self.m_underlineW = self.addToggleButton(self.m_toolbarPanel,
                                                 Icons.underline_icon,
                                                 "Underline")
        self.m_subscriptW = self.addToggleButton(self.m_toolbarPanel,
                                                 Icons.subscript_icon,
                                                 "Subscript")
        self.m_superscriptW = self.addToggleButton(self.m_toolbarPanel,
                                                   Icons.superscript_icon,
                                                   "Superscript")
        self.m_strikethroughW = self.addToggleButton(self.m_toolbarPanel,
                                                     Icons.strikethrough_icon,
                                                     "Strikethrough")

        self.m_indentW = self.addPushButton(self.m_toolbarPanel,
                                            Icons.indentmore_icon,
                                            "Indent Right")
        self.m_outdentW = self.addPushButton(self.m_toolbarPanel,
                                             Icons.indentless_icon,
                                             "Indent Left")
        self.m_justifyLeftW = self.addPushButton(self.m_toolbarPanel,
                                                 Icons.justifyleft_icon,
                                                 "Justify Left")
        self.m_justifyCenterW = self.addPushButton(self.m_toolbarPanel,
                                                   Icons.justifycenter_icon,
                                                   "Justify Center")
        self.m_justifyRightW = self.addPushButton(self.m_toolbarPanel,
                                                  Icons.justifyright_icon,
                                                  "Justify Right")
        self.m_hrW = self.addPushButton(self.m_toolbarPanel,
                                        Icons.horizontalrule_icon,
                                        "Horizontal Rule")
        self.m_olW = self.addPushButton(self.m_toolbarPanel,
                                        Icons.numberedlist_icon,
                                        "Numbered List")
        self.m_ulW = self.addPushButton(self.m_toolbarPanel, Icons.list_icon,
                                        "List")
        self.m_newLinkW = self.addPushButton(self.m_toolbarPanel,
                                             Icons.link_icon, "Link Document")
        self.m_removeFormatW = self.addPushButton(self.m_toolbarPanel,
                                                  Icons.noformat_icon,
                                                  "No Format")

        self.m_mainPanel.add(self.m_toolbarPanel, DockPanel.NORTH)
        self.m_mainPanel.add(self.m_textW, DockPanel.CENTER)

        self.initWidget(self.m_mainPanel)
        self.sinkEvents(Event.ONCLICK)