コード例 #1
0
    def createComponents(self):
        components = list()

        label = Label('This is a long text block that will wrap.')
        label.setWidth('120px')
        components.append(label)

        image = Embedded('', ThemeResource('../runo/icons/64/document.png'))
        components.append(image)

        documentLayout = CssLayout()
        documentLayout.setWidth('19px')
        for _ in range(5):
            e = Embedded(None, ThemeResource('../runo/icons/16/document.png'))
            e.setHeight('16px')
            e.setWidth('16px')
            documentLayout.addComponent(e)
        components.append(documentLayout)

        buttonLayout = VerticalLayout()
        button = Button('Button')

        button.addListener(ButtonClickListener(self), IClickListener)
        buttonLayout.addComponent(button)
        buttonLayout.setComponentAlignment(button, Alignment.MIDDLE_CENTER)
        components.append(buttonLayout)

        return components
コード例 #2
0
ファイル: WebEmbedExample.py プロジェクト: AvdN/muntjac
    def __init__(self):
        super(WebEmbedExample, self).__init__()

        e = Embedded('Google Search',
                ExternalResource('http://www.google.com'))
        e.setType(Embedded.TYPE_BROWSER)
        e.setWidth('100%')
        e.setHeight('400px')
        self.addComponent(e)
コード例 #3
0
    def __init__(self):
        super(WebEmbedExample, self).__init__()

        e = Embedded('Google Search',
                     ExternalResource('http://www.google.com'))
        e.setType(Embedded.TYPE_BROWSER)
        e.setWidth('100%')
        e.setHeight('400px')
        self.addComponent(e)
コード例 #4
0
ファイル: FlashEmbedExample.py プロジェクト: AvdN/muntjac
    def __init__(self):
        super(FlashEmbedExample, self).__init__()

        e = Embedded(None, ExternalResource('http://www.youtube.com/'
                'v/Qy67XU6xEi8&hl=en_US&fs=1&'))
        e.setMimeType('application/x-shockwave-flash')
        e.setParameter('allowFullScreen', 'true')
        e.setWidth('320px')
        e.setHeight('265px')
        self.addComponent(e)
コード例 #5
0
 def generateCell(self, source, itemId, columnId):
     f = itemId
     if isinstance(f, FeatureSet):
         # no icon for sections
         return None
     resId = '75-' + f.getIconName()
     res = self._app.getSampleIcon(resId)
     emb = Embedded('', res)
     emb.setWidth('48px')
     emb.setHeight('48px')
     emb.setType(Embedded.TYPE_IMAGE)
     return emb
コード例 #6
0
    def __init__(self):
        super(FlashEmbedExample, self).__init__()

        e = Embedded(
            None,
            ExternalResource('http://www.youtube.com/'
                             'v/Qy67XU6xEi8&hl=en_US&fs=1&'))
        e.setMimeType('application/x-shockwave-flash')
        e.setParameter('allowFullScreen', 'true')
        e.setWidth('320px')
        e.setHeight('265px')
        self.addComponent(e)
コード例 #7
0
 def generateCell(self, source, itemId, columnId):
     f = itemId
     if isinstance(f, FeatureSet):
         # no icon for sections
         return None
     resId = '75-' + f.getIconName()
     res = self._app.getSampleIcon(resId)
     emb = Embedded('', res)
     emb.setWidth('48px')
     emb.setHeight('48px')
     emb.setType(Embedded.TYPE_IMAGE)
     return emb
コード例 #8
0
    def __init__(self):
        super(PackageIconsExample, self).__init__()

        self._icons = ['arrow-down.png', 'arrow-left.png', 'arrow-right.png',
            'arrow-up.png', 'attention.png', 'calendar.png', 'cancel.png',
            'document.png', 'document-add.png', 'document-delete.png',
            'document-doc.png', 'document-image.png', 'document-pdf.png',
            'document-ppt.png', 'document-txt.png', 'document-web.png',
            'document-xsl.png', 'email.png', 'email-reply.png',
            'email-send.png', 'folder.png', 'folder-add.png',
            'folder-delete.png', 'globe.png', 'help.png', 'lock.png',
            'note.png', 'ok.png', 'reload.png', 'settings.png', 'trash.png',
            'trash-full.png', 'user.png', 'users.png']

        self._sizes = ['16', '32', '64']

        self.setSpacing(True)

        tabSheet = TabSheet()
        tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL)

        for size in self._sizes:
            iconsSideBySide = 2 if size == '64' else 3
            grid = GridLayout(iconsSideBySide * 2, 1)
            grid.setSpacing(True)
            grid.setMargin(True)
            tabSheet.addTab(grid, size + 'x' + size, None)

            tabSheet.addComponent(grid)
            for icon in self._icons:
                res = ThemeResource('../runo/icons/' + size + '/' + icon)

                e = Embedded(None, res)

                # Set size to avoid flickering when loading
                e.setWidth(size + 'px')
                e.setHeight(size + 'px')

                name = Label(icon)
                if size == '64':
                    name.setWidth('185px')
                else:
                    name.setWidth('150px')

                grid.addComponent(e)
                grid.addComponent(name)

                grid.setComponentAlignment(name, Alignment.MIDDLE_LEFT)

        self.addComponent(tabSheet)