def creer(self): self.cours_sm = ScreenManager() self.cours_sm.size_hint = (1, 1) #menu_cours = BoxLayout(orientation="vertical", padding=40) menu_cours = SnsmBox(orientation="vertical", padding=40) boutons = GridLayout(cols=2) menu_cours.add_widget(boutons) for cours in formation_db.liste_cours_all(): button = Button(text=str(cours), color=(1, 1, 1, 1), font_size=20, size_hint=(1, 0.1), markup=True) boutons.add_widget(button) button.bind(on_press=self.selection_cours) scm = Screen(name='menu_principal') scm.add_widget(menu_cours) self.cours_sm.add_widget(scm) self.cours_sm.current = scm.name # Ajout de l'écran d'accueil aux onglets tab = TabbedPanelItem() tab.text = "Accueil" tab.add_widget(self.cours_sm) self.notebook.add_widget(tab) self.notebook.set_def_tab(tab) self.accueil_tab = tab # Ajout de l'écran de gestion aux onglets tab = TabbedPanelItem() tab.text = "Gérer" tab.add_widget(GestionSCM()) self.notebook.add_widget(tab) self.gestion_tab = tab # Ajout de l'écran d'Apropos aux onglets tab = TabbedPanelItem() tab.text = "A propos" tab.add_widget(Label(text="Bienvenue à la SNSM")) self.notebook.add_widget(tab) self.apropos_tab = tab return self
def __init__(self, prjMaterials, *args, **kwargs): print(f"creating materials sliders...") super(AllMatPropTabbedPanel, self).__init__(*args, **kwargs) self._prjMaterials = prjMaterials for mat in prjMaterials.materials: tmp = TabbedPanelItem() tmp2 = MatPropPanel(mat) self.add_widget(tmp) tmp.text = mat.name tmp.add_widget(tmp2)
def make_new_category(self, category_name, index=0): components_categories = self.ids.components_categories new_tab = TabbedPanelItem() new_tab.id = category_name new_tab.text = category_name components_box = self.make_components_box(category_name) new_scroll = ScrollView() new_scroll.add_widget(components_box) new_tab.add_widget(new_scroll) components_categories.add_widget(new_tab, index + 1)
def open_file(self, document): """ :type document: doxing.client.data_model.document.DocumentDTO """ # TODO: prevent double openning same file opened_file = TabbedPanelItem() opened_file.text = document.name opened_file.add_widget( TextFileEditor(ctxt=self._ctxt, document=document)) self.add_widget(opened_file) self.switch_to(opened_file)
def createInfoTab(stringDict, tabName): tab = TabbedPanelItem() tab.name = tabName tab.text = stringDict[tabName]["Title"] titleText = Label(text=stringDict[tabName]["Title"]) bodyText = Label(text=stringDict[tabName]["Body"]) tab.add_widget(titleText) tab.add_widget(bodyText) return tab
def __init__(self, **kwargs): super(BandLay, self).__init__(**kwargs) self.tab_item = TabbedPanel() self.tab_item.do_default_tab = False self.tab_item.tab_height = 20 list_bands = [] if site.equipment == 'ADU06': list_bands = ['A', 'B', 'F', 'C', 'D'] elif site.equipment == 'ADU07': list_bands = ['65536H', '4096H', '128H', '4H'] for band in list_bands: tab_item = TabbedPanelItem() tab_item.text = band self.tab_item.add_widget(tab_item) list_file_pplt = self.search_pplt_file(band) site.files_plot[band] = list_file_pplt self.grid_lay = ScrollBox() i = 0 for file_pplt_select in site.files_plot[band]: self.grid_lay.ids.grid.add_widget(file_pplt_select) print(file_pplt_select.obj_pplt.name) i += 1 if band == '65536H' or band == '4096H': self.grid_lay.ids.grid.size_hint_x = None self.grid_lay.ids.grid.width = int(i / 3 * 300) else: self.grid_lay.ids.grid.size_hint_x = None self.grid_lay.ids.grid.width = int(i/3 * 250) tab_item.add_widget(self.grid_lay) self.add_widget(self.tab_item) print(project.path_file_ppmt)
def __init__(self, **kwargs): super(BandLay, self).__init__(**kwargs) self.tab_item = TabbedPanel() self.tab_item.do_default_tab = False self.tab_item.tab_height = 20 list_bands = [] if site.equipment == 'ADU06': list_bands = ['A', 'B', 'F', 'C', 'D'] elif site.equipment == 'ADU07': list_bands = ['65536H', '4096H', '128H', '4H'] for band in list_bands: tab_item = TabbedPanelItem() tab_item.text = band self.tab_item.add_widget(tab_item) list_file_pplt = self.search_pplt_file(band) site.files_plot[band] = list_file_pplt self.grid_lay = ScrollBox() i = 0 for file_pplt_select in site.files_plot[band]: self.grid_lay.ids.grid.add_widget(file_pplt_select) print(file_pplt_select.obj_pplt.name) i += 1 if band == '65536H' or band == '4096H': self.grid_lay.ids.grid.size_hint_x = None self.grid_lay.ids.grid.width = int(i / 3 * 300) else: self.grid_lay.ids.grid.size_hint_x = None self.grid_lay.ids.grid.width = int(i / 3 * 250) tab_item.add_widget(self.grid_lay) self.add_widget(self.tab_item) print(project.path_file_ppmt)