def __init__(self): super(TabSheetIconsExample, self).__init__() # Tab 1 content l1 = VerticalLayout() l1.setMargin(True) l1.addComponent(Label('There are no previously saved actions.')) # Tab 2 content l2 = VerticalLayout() l2.setMargin(True) l2.addComponent(Label('There are no saved notes.')) # Tab 3 content l3 = VerticalLayout() l3.setMargin(True) l3.addComponent(Label('There are currently no issues.')) self._t = TabSheet() self._t.setHeight('200px') self._t.setWidth('400px') self._t.addTab(l1, 'Saved actions', self._icon1) self._t.addTab(l2, 'Notes', self._icon2) self._t.addTab(l3, 'Issues', self._icon3) self._t.addListener(self, ISelectedTabChangeListener) self.addComponent(self._t)
def __init__(self): super(TabSheetClosingExample, self).__init__() # Tab 1 content l1 = VerticalLayout() l1.setMargin(True) l1.addComponent(Label('There are no previously saved actions.')) # Tab 2 content l2 = VerticalLayout() l2.setMargin(True) l2.addComponent(Label('There are no saved notes.')) # Tab 3 content l3 = VerticalLayout() l3.setMargin(True) l3.addComponent(Label('There are currently no issues.')) # Tab 4 content l4 = VerticalLayout() l4.setMargin(True) l4.addComponent(Label('There are no comments.')) # Tab 5 content l5 = VerticalLayout() l5.setMargin(True) l5.addComponent(Label('There is no new feedback.')) self._t = TabSheet() self._t.setHeight('200px') self._t.setWidth('400px') saved = self._t.addTab(l1, 'Saved actions', None) saved.setClosable(True) notes = self._t.addTab(l2, 'Notes', None) notes.setClosable(True) issues = self._t.addTab(l3, 'Issues', None) issues.setClosable(True) comments = self._t.addTab(l4, 'Comments', None) comments.setClosable(True) feedback = self._t.addTab(l5, 'Feedback', None) feedback.setClosable(True) self._t.addListener(self, tab_sheet.ISelectedTabChangeListener) self._t.setCloseHandler(self) self.addComponent(self._t)
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)
def __init__(self): super(TabSheetDisabledExample, self).__init__() self.setSpacing(True) # Tab 1 content self._l1 = VerticalLayout() self._l1.setMargin(True) self._l1.addComponent(Label('There are no previously saved actions.')) # Tab 2 content self._l2 = VerticalLayout() self._l2.setMargin(True) self._l2.addComponent(Label('There are no saved notes.')) # Tab 3 content self._l3 = VerticalLayout() self._l3.setMargin(True) self._l3.addComponent(Label('There are currently no issues.')) self._t = TabSheet() self._t.setHeight('200px') self._t.setWidth('400px') self._t1 = self._t.addTab(self._l1, 'Saved actions', self._icon1) self._t2 = self._t.addTab(self._l2, 'Notes', self._icon2) self._t3 = self._t.addTab(self._l3, 'Issues', self._icon3) self._t.addListener(self, tab_sheet.ISelectedTabChangeListener) self._toggleEnabled = Button('Disable \'Notes\' tab') self._toggleEnabled.addListener(self, button.IClickListener) self._toggleVisible = Button('Hide \'Issues\' tab') self._toggleVisible.addListener(self, button.IClickListener) hl = HorizontalLayout() hl.setSpacing(True) hl.addComponent(self._toggleEnabled) hl.addComponent(self._toggleVisible) self.addComponent(self._t) self.addComponent(hl)