Beispiel #1
0
    def build(self):
        root = BoxLayout()
        root = TabbedPanel(do_default_tab=False)
        root.tab_width = 200
        self.load("default.xml")

        self.wips_container = WipContainer(self,
                                           self.wips,
                                           orientation="vertical",
                                           size_hint_y=None,
                                           height=1200,
                                           minimum_height=200)
        queue_scroll = ScrollView(bar_width=20)
        queue_scroll.add_widget(self.wips_container)

        tab = TabbedPanelItem(text="queue")
        tab.add_widget(queue_scroll)
        root.add_widget(tab)

        tab = TabbedPanelItem(text="settings")
        self.setting_container = SettingContainer(self)
        tab.add_widget(self.setting_container)
        self.setting_container.update_widgets()
        root.add_widget(tab)

        self.check_for_projects()
        self.load_xml_files()
        Clock.schedule_interval(lambda x: self.check_for_projects(), 10)
        return root
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.tp_main = TabbedPanel()
        ti_pandas = TabbedPanelItem(id="ti_pandas", text = "pandas" )
        ti_list = TabbedPanelItem(id="ti_list", text = "list")
        ti_numpy = TabbedPanelItem(id="ti_numpy", text = "numpy array")

        self.qt_pandas = QzTable(id="qt_pandas")
        self.qt_list = QzTable(id="qt_list")
        self.qt_array = QzTable(id="qt_array")

        self.df_data = pd.read_csv("height_weight.csv")
        self.l_data = list()
        v = 10.0
        for y in range(1,1000,1):
            row = list()
            for x in range(0,50,1):
                v= v+ 10
                row.append(v)
            self.l_data.append(row)

        self.a_data = np.array(self.l_data)
        self.qt_pandas.data = self.df_data
        self.qt_list.data = self.l_data
        self.qt_array.data = self.a_data

        #Layout
        self.add_widget(self.tp_main)
        self.tp_main.add_widget(ti_pandas)
        ti_pandas.add_widget(self.qt_pandas)
        self.tp_main.add_widget(ti_list)
        ti_list.add_widget(self.qt_list)
        self.tp_main.add_widget(ti_numpy)
        ti_numpy.add_widget(self.qt_array)
Beispiel #3
0
def main_base_menu(build_place):
    scatter = ScatterLayout()
    menu = building.MenuLayout()
    inside_menu = building.InsideMenuLayout()
    main_box = BoxLayout(orientation='horizontal')
    left_box = BoxLayout(orientation='vertical', size_hint_x=.35)
    right_box = BoxLayout(size_hint_x=.65)
    icon_bottom_box = BoxLayout(size_hint=(.9, .8))
    icon_layout = BoxLayout(size_hint_y=.4)  # pos_hint=({'top': 1})

    # Вывод производства ресурсов
    stat_res = res_generation('main_base')

    # Добавление вкладок Здания
    tb = TabbedPanel(do_default_tab=False, tab_width=130)
    base_e = TabbedPanelItem(text='Энергия')
    base_e.content = base_energy()
    base_f = TabbedPanelItem(text='Пища')
    base_f.content = base_food()
    tb.add_widget(base_e)
    tb.add_widget(base_f)

    icon_bottom_box.add_widget(stat_res)
    icon_layout.add_widget(Image(source='data/images/buildings/main-base.png'))
    left_box.add_widget(icon_layout)
    left_box.add_widget(icon_bottom_box)
    right_box.add_widget(tb)
    main_box.add_widget(left_box)
    main_box.add_widget(right_box)
    inside_menu.add_widget(main_box)
    close_b = building.CloseMenuButton(build_place, scatter)
    menu.add_widget(inside_menu)
    menu.add_widget(close_b)
    scatter.add_widget(menu)
    return scatter
Beispiel #4
0
    def __init__(self):
        App.__init__(self)
        self.data = HymnData()
        
        self.title = "Old-Line Primitive Baptist Hymn and Tune Book"
        
        self.panel = TabbedPanel()
        
        self.number_tab = TabbedPanelItem(text="By number")
        self.panel.add_widget(self.number_tab)

        self.set_up_number_tab()

        self.panel.default_tab = self.number_tab

        self.first_line_tab = TabbedPanelItem(text="By first line")
        self.panel.add_widget(self.first_line_tab)

        self.set_up_first_line_tab()

        self.search_tab = TabbedPanelItem(text="Search")
        self.panel.add_widget(self.search_tab)
        self.set_up_search_tab()

        self.about_tab = TabbedPanelItem(text="About")
        self.panel.add_widget(self.about_tab)
        self.set_up_about_tab()
Beispiel #5
0
    def button_options(self):
        print("options pressed")
        app = App.get_running_app()
        cont = GridLayout(cols=1)
        # retrieve audio outputs / soundcards from audioengine class
        out_list = app.root.ae.get_outputs()
        print(out_list)

        # combine out_list, add to output selector
        for x, y in zip(*out_list):
            # intentional error to remember where left off
            b = Button(id="{}".format(y), text="{} {}".format(x, y))
            b.bind(on_press=self.audio_opts_button_callback)
            cont.add_widget(b)
        for x in self.children:
            print(x)

        tp = TabbedPanel(do_default_tab=False)

        # audio tab
        th_audio = TabbedPanelItem(text="Audio")
        th_audio.content = GridLayout()
        th_audio.add_widget(cont)

        # files tab
        th_files = TabbedPanelItem(text="Files")
        th_files.add_widget(Button(text="files tab content"))
        tp.add_widget(th_audio)
        tp.add_widget(th_files)

        popup = Popup(title='Options',
                      content=tp,
                      size_hint=(None, None),
                      size=(800, 800))
        popup.open()
Beispiel #6
0
    def __init__(self, retour_selection, titre, parent_scm,
                 dict_eleves_par_groupe, **kwargs):
        self.titre = titre
        self.retour_selection = retour_selection
        self.parent_scm = parent_scm
        self.dict_eleves = dict_eleves_par_groupe
        self.dict_panneau_groupe = dict()
        super(Formation, self).__init__(**kwargs)

        for nom_groupe in self.dict_eleves.keys():
            tb = TabbedPanelItem(text=nom_groupe)
            panneaugr = PanneauGroupe(self.dict_eleves[nom_groupe],
                                      nom_cours=titre)
            self.dict_panneau_groupe[nom_groupe] = panneaugr
            tb.add_widget(panneaugr)
            self.nb.add_widget(tb)

        fin = TabbedPanelItem(text='Terminer')
        self.panfin = PanneauFinFormation(self.terminaison, self.recapitulatif)
        fin.add_widget(self.panfin)
        fin.bind(on_release=self.panfin.update)
        self.nb.add_widget(fin)
        self.panneau_fin = fin
        retour = TabbedPanelHeader(text='Retour')
        retour.bind(on_release=self.retour)
        self.nb.add_widget(retour)
        self.panneau_retour = retour
Beispiel #7
0
 def __init__(self, screenmanager, **kwargs):
     super(GraphScreen, self).__init__(**kwargs)
     #Set screenmanager
     sm = screenmanager
     #Set master layout
     layout = BoxLayout(spacing=10)
     #Create tabpanel
     tabs = TabbedPanel()
     #Add tabs
     speedTab = TabbedPanelItem(text='Speed')
     speedTab.content = Label(text='Speed')
     backTab = TabbedPanelItem(text='Back')
     tabs.add_widget(speedTab)
     tabs.add_widget(backTab)
     layout.add_widget(tabs)
     self.add_widget(layout)
Beispiel #8
0
 def tabProbabilityTesting(self):
     '''
     tab containing plot of probability distributions from various user-specificed pools of dice
     '''
     self.plotColorMap = [
         [1,0,0,1],
         [0,1,0,1],
         [0,0,1,1],
         [1,1,0,1],
         [1,0,1,1],
         [0,1,1,1],
         [1,1,1,1],
         [0.75,0.75,0.75,1]]
     tabProb = TabbedPanelItem(text = 'Prob. Plots')
     self.statsMainLayout = BoxLayout(orientation = 'vertical')
     self.entryLayout =  BoxLayout(orientation = 'vertical',size_hint = (1,0.45))
     buttonLayout = BoxLayout(size_hint = (1,0.05))
     self.graphLayout = BoxLayout(size_hint = (1,0.5))
     self.graph = Graph(xlabel='Value', ylabel='Counts', 
         x_ticks_minor=1,x_ticks_major=2, y_ticks_minor = 100, y_ticks_major=500,
         y_grid_label=True, x_grid_label=True, padding=5,
         x_grid=True, y_grid=True, xmin=-0, xmax=15, ymin=0,ymax = 5000)
     self.graphLayout.add_widget(self.graph)
     self.plotList = []
     self.statsMainLayout.add_widget(self.entryLayout)
     self.statsMainLayout.add_widget(buttonLayout)
     self.statsMainLayout.add_widget(self.graphLayout)
     self.testList = []
     self.appendNewTest(self.entryLayout,readOnly = True) 
     self.testList.append(self.appendNewTest(self.entryLayout)) 
     buttonList = [['Add New Test','Plot Results','Reset']]
     buttonFunctionList = [[self.fireNewTestButton,self.firePlotButton,self.fireResetTestsButton]]
     self.addButtons(buttonList,buttonFunctionList,buttonLayout)
     tabProb.add_widget(self.statsMainLayout)
     return tabProb    
Beispiel #9
0
    def _manip_sort(task, sort_type, *args):
        sort_type = 'Asc' not in sort_type.text
        from_address = task.from_address(task.tablenum, ':all', extended=True)
        values, cols, rows, labels = from_address

        # get separated cols to sort
        chunks = []
        for x in range(0, len(values), rows):
            chunks.append(values[x:x + rows])

        values = []
        for val in chunks:
            values.append(sorted(val, reverse=sort_type))

        # add Table
        table = task.ids.tablesel.text
        table += ' (desc)' if sort_type else ' (asc)'
        tabletab = TabbedPanelItem(text=table)
        task.app.root.ids.tabpanel.add_widget(tabletab)

        values = list(zip(*values))
        values = [v for vals in values for v in vals]
        task.app.root.tables.append((table,
                                     task.tablecls(max_cols=cols,
                                                   max_rows=rows,
                                                   pos=task.app.root.pos,
                                                   size=task.app.root.size,
                                                   values=values,
                                                   labels=labels)))
        tabletab.content = task.app.root.tables[-1][1]
Beispiel #10
0
    def __init__(self, **kwargs):
        super(PythonConsole, self).__init__(**kwargs)

        self.console = ConsoleWidget(self)
        tab1 = TabbedPanelItem(text="Console")
        tab1.add_widget(self.console)
        self.add_widget(tab1)
    def populate(self):
        app = MDApp.get_running_app()
        sub_panel = self.children[0]
        for name, store in app.db.stores.items():
            if name == 'default':  # Duplicated store
                default_store = store.name
                continue

            store_panel = TabbedPanelItem(text=name.capitalize())
            sub_panel.add_widget(store_panel)
            container = app.container_factory.get('map_locations', store)
            container.store = store

            items = set()
            for location in store.locations.values():
                for item in location.items:
                    if item:
                        item = app.db.items[item]
                        items.add((store, location, item))
            # print(len(items))

            container.generate_data(items)
            container.to_layout()
            store_panel.content = BoxLayout(orientation='vertical')
            store_panel.content.add_widget(LocationMapHeader(container=container))
            store_panel.content.add_widget(container.container_display)

        for panel in sub_panel.tab_list:
            # noinspection PyUnboundLocalVariable
            if panel.text == default_store:
                sub_panel.default_tab = panel
        sub_panel.tab_width = MDApp.get_running_app().root.width / (len(app.db.stores) - 1)
Beispiel #12
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.tp_main = TabbedPanel()
        ti_pandas = TabbedPanelItem(id="ti_pandas", text="pandas")
        ti_list = TabbedPanelItem(id="ti_list", text="list")
        ti_numpy = TabbedPanelItem(id="ti_numpy", text="numpy array")

        self.qt_pandas = QzTable(id="qt_pandas")
        self.qt_list = QzTable(id="qt_list")
        self.qt_array = QzTable(id="qt_array")

        self.df_data = pd.read_csv("height_weight.csv")
        self.l_data = list()

        v = 10.0
        for y in range(1, 1000, 1):
            row = list()
            for x in range(0, 50, 1):
                v = v + 10
                row.append(v)
            self.l_data.append(row)

        self.a_data = np.array(self.l_data)
        self.qt_pandas.data = self.df_data
        self.qt_pandas.row_header_width = 300
        self.qt_list.data = self.l_data
        self.qt_array.data = self.a_data

        #setup the pandas widgets
        spinner = qzw.CellSpinner(values=('1', '2'))
        spinner.background_color = (0.3, 0.3, 0.3, 1)
        spinner.font_size = 12
        qzw.CellSpinnerOptions.BackgroundColor = (0.6, 0.6, 0.65, 1)

        text = qzw.CellTxtInput(background_color=(0.3, 0.3, 0.3, 1),
                                font_size=12)
        text.halign = "right"
        self.qt_pandas.set_widgets({0: spinner, 1: text})

        #Layout
        self.add_widget(self.tp_main)
        self.tp_main.add_widget(ti_pandas)
        ti_pandas.add_widget(self.qt_pandas)
        self.tp_main.add_widget(ti_list)
        ti_list.add_widget(self.qt_list)
        self.tp_main.add_widget(ti_numpy)
        ti_numpy.add_widget(self.qt_array)
Beispiel #13
0
    def populate_tabs(self):

        new_manager_tab = TabbedPanelItem(text='Tasks')
        new_manager_tab.add_widget(self.new_manager)
        # self.ids.tp.add_widget(events_tab)
        self.ids.tp.add_widget(new_manager_tab)
        # self.ids.tp.add_widget(stats_tab)

        self.ids.tp.default_tab = new_manager_tab
Beispiel #14
0
 def getTabLayout(self, command):
     tabItem = None
     for child in self.root.tab_list:
         if child.text == command.tabName:
             return child.content
     tabItem = TabbedPanelItem(text=command.tabName)
     self.root.add_widget(tabItem)
     tabItem.add_widget(BoxLayout(orientation='vertical', size_hint=(1, 1)))
     return tabItem.content
Beispiel #15
0
 def change_data_set(self, new_dic):
     liste_groupe = [{'text': nom_groupe} for nom_groupe in new_dic.keys()]
     print('tododo:', liste_groupe)
     current_groupes = self.dict_panneau_groupe.keys()
     self.deja_enregistre = False
     print('tadada:', new_dic.keys())
     print(current_groupes)
     for nom_groupe in current_groupes:
         # Si le groupe n'est plus dans la liste
         # il faut retirer le panneau
         if nom_groupe not in new_dic:
             # Mais d'abord il faut le retrouver !
             tabbed = [
                 tb for tb in self.nb.get_tab_list()
                 if tb.text == nom_groupe
             ]
             try:
                 del self.dict_panneau_groupe[nom_groupe]
             except KeyError:
                 pass
             if tabbed:
                 self.nb.remove_widget(tabbed[0])
     for groupe in liste_groupe:
         nom_groupe = groupe['text']
         if not new_dic[nom_groupe]:
             # Si c'est vide
             continue
         # Si le groupe n'existe pas, on crée le panneau et le rajoute
         if not nom_groupe in current_groupes:
             tb = TabbedPanelItem(text=nom_groupe)
             panneaugr = PanneauGroupe(new_dic[nom_groupe],
                                       nom_cours=self.titre)
             self.dict_panneau_groupe[nom_groupe] = panneaugr
             tb.add_widget(panneaugr)
             # Parce qu'à la SNSM, on aime quand c'est bien fait!
             self.nb.remove_widget(self.panneau_fin)
             self.nb.remove_widget(self.panneau_retour)
             self.nb.add_widget(tb)
             self.nb.add_widget(self.panneau_fin)
             self.nb.add_widget(self.panneau_retour)
         else:
             # Maintenant on gère les nouveaux élèves
             nouveaux_eleves = [
                 eleve for eleve in new_dic[nom_groupe]
                 if not eleve in self.dict_eleves[nom_groupe]
             ]
             rejetes = [
                 eleve for eleve in self.dict_eleves[nom_groupe]
                 if not eleve in new_dic[nom_groupe]
             ]
             self.dict_eleves = dict(new_dic)
             panneaugr = self.dict_panneau_groupe[nom_groupe]
             for ne in nouveaux_eleves:
                 panneaugr.ajoute_nouvel_eleve(ne)
             # Et on vire les autres
             for mm in rejetes:
                 panneaugr.supprime_eleve(mm)
Beispiel #16
0
    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
Beispiel #17
0
class ListaCheltuieliPanel(TabbedPanelItem):
    updateState = ''
    lista = TabbedPanelItem(text='Lista cheltuieli')
    bigView = StackLayout(orientation='rl-tb')
    top_buttons = GridLayout(cols=2,
                             row_default_height=40,
                             size_hint=(1, None),
                             height=40)
    db_entries = DBEntries(cols=2)
    scroll = ScrollView(size_hint=(1, None),
                        size=(Window.width, Window.height - 126))

    def updateByButton(self, button):
        if (self.updateState != button[0].lower() + button[1:] + "_ASC"):
            self.updateState = button[0].lower() + button[1:] + "_ASC"
        else:
            self.updateState = button[0].lower() + button[1:] + "_DESC"
        self.updateView()

    def updateView(self):
        self.db_entries.clear_widgets()
        db = getConnection()
        cur = db.cursor()
        if (self.updateState == ''):
            cur.execute("SELECT * FROM cheltuieli;")
            for row in cur.fetchall():
                for col in row[1:]:
                    self.db_entries.add_widget(SpendingsLabel(text=str(col)))
        else:
            cur.execute("SELECT * FROM cheltuieli ORDER BY " +
                        self.updateState[0:4] + " " + self.updateState[5:] +
                        ";")
            for row in cur.fetchall():
                for col in row[1:]:
                    self.db_entries.add_widget(SpendingsLabel(text=str(col)))
        self.db_entries.add_widget(TotalLabel(text='Total'))
        cur.execute("SELECT SUM(suma) FROM cheltuieli;")
        self.db_entries.add_widget(TotalLabel(text=str(cur.fetchall()[0][0])))

    def __init__(self):
        self.top_buttons.add_widget(
            Button(on_press=lambda btn: self.updateByButton(btn.text),
                   text='Suma'))
        self.top_buttons.add_widget(
            Button(on_press=lambda btn: self.updateByButton(btn.text),
                   text='Data'))
        self.updateView()
        self.bigView.add_widget(
            RefreshButton(on_press=lambda btn: self.updateView(),
                          text='',
                          size_hint=(None, None),
                          height=40,
                          width=40))
        self.bigView.add_widget(self.top_buttons)
        self.bigView.add_widget(self.db_entries)
        self.lista.add_widget(self.bigView)
Beispiel #18
0
 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)
Beispiel #19
0
    def build(self):
        self.GabrielPage = FloatLayout()
        self.EditPage = FloatLayout()
        self.SettingsPage = FloatLayout()

        self.MainMenu = TabbedPanel(background_color=(1, 1, 1, 1),
                                    default_tab_text='Габриэль',
                                    default_tab_content=self.GabrielPage)
        self.EditMenu = TabbedPanelItem(text='Edit')
        self.SettingsMenu = TabbedPanelItem(text='Settings')

        self.MainMenu.add_widget(self.EditMenu)
        self.MainMenu.add_widget(self.SettingsMenu)

        self.In_GabrielPage()
        self.In_EditPage()
        self.In_SettingsPage()

        return self.MainMenu
Beispiel #20
0
def prod_menu(build_place):
    scatter = ScatterLayout()
    menu = MenuLayout()
    inside_menu = InsideMenuLayout()
    main_box = BoxLayout(orientation='horizontal')
    left_box = BoxLayout(orientation='vertical', size_hint_x=.35)
    right_box = BoxLayout(size_hint_x=.65)
    icon_bottom_box = BoxLayout(size_hint=(.9, .8))
    icon_layout = BoxLayout(size_hint_y=.4)  # pos_hint=({'top': 1})
    statistic_grid = GridLayout(cols=1,
                                size_hint_y=None,
                                pos_hint=({
                                    'top': .9
                                }),
                                spacing=10,
                                padding=5)
    for r in config.resources:
        res = config.resources[r]
        stat_box = BoxLayout(orientation='horizontal',
                             height=40,
                             size_hint_y=None)
        stat_box.add_widget(Image(source=res[2], size_hint_x=.2))
        stat_box.add_widget(Label(text=f'{res[0]}', size_hint_x=.8))
        statistic_grid.add_widget(stat_box)
    tb = TabbedPanel(do_default_tab=False, tab_width=130)
    ti = TabbedPanelItem(text='Улучшения')
    ti.content = prod_upgrade_content()
    tb.add_widget(ti)
    tb.add_widget(TabbedPanelItem(text='Автоматизация'))
    tb.add_widget(TabbedPanelItem(text='Статистика'))
    icon_bottom_box.add_widget(statistic_grid)
    icon_layout.add_widget(Image(source='data/images/buildings/buildings.zip'))
    left_box.add_widget(icon_layout)
    left_box.add_widget(icon_bottom_box)
    right_box.add_widget(tb)
    main_box.add_widget(left_box)
    main_box.add_widget(right_box)
    inside_menu.add_widget(main_box)
    close_b = CloseMenuButton(build_place, scatter)
    menu.add_widget(inside_menu)
    menu.add_widget(close_b)
    scatter.add_widget(menu)
    return scatter
	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)
Beispiel #22
0
    def _import_data(self, selection, *args):
        '''Imports :ref:`sqlite` from path selected in ``Dialog`` and puts it
        to :mod:`main.Table`.

        .. versionadded:: 0.1.0
        '''
        # limit table name and column name to [a-zA-Z]

        # CREATE TABLE test(
        #                   Column INTEGER NOT NULL CHECK(
        #                               typeof(Column) = 'integer'))
        if not selection:
            return
        else:
            selection = selection[0]
            if '.sqlite' not in selection:
                return

        conn = sqlite3.connect(op.join(selection))
        c = conn.cursor()

        # get tables first!
        c.execute("SELECT name FROM sqlite_master WHERE type='table'")
        tables = [tab[0] for tab in c.fetchall()]

        for table in tables:
            c.execute("pragma table_info({0})".format(table))
            table_info = c.fetchall()
            labels = [lbl[1] for lbl in table_info]

            # allow only: INTEGER, REAL, TEXT
            try:
                types = [type[2][0] for type in table_info]
            except IndexError:
                error = ErrorPop(msg='Bad file: No defined types in columns!')
                error.open()
                return

            tabletab = TabbedPanelItem(text=table)
            self.ids.tabpanel.add_widget(tabletab)
            c.execute('select * from {0}'.format(table))
            values = [item for item in c.fetchone()]
            max_cols = len(values)
            values += [item for sublist in c.fetchall() for item in sublist]
            max_rows = int(math.ceil(len(values) / float(max_cols)))
            self.tables.append((table,
                                Table(max_cols=max_cols,
                                      max_rows=max_rows,
                                      pos=self.pos,
                                      size=self.size,
                                      values=values,
                                      labels=labels)))
            tabletab.content = self.tables[-1][1]
        self.opendlg.dismiss()
        conn.close()
    def __init__(self, publicationsView, friendsView, aboutView,
                 activityFeedView, **kwargs):
        """
        Panneau d'onglets contenant (dans chaque onglet):
            - L'espace de publication
            - Les amis/demandes d'ami
            - Les informations personnelles de l'utilisateur
            - Le fil d'actualité

        :param publicationsView: Les publications
        :type publicationsView: PublicationsWidget
        :param friendsView: Les amis
        :type friendsView: FriendsWidget
        :param aboutView: Les information personnelles
        :type aboutView: AboutWidget
        :param activityFeedView: Le fil d'actualité
        :type activityFeedView: ActivityFeedWidget
        :param kwargs: Arguments clé/valeur de la classe parente
        """
        super(ProfileTabbedPanel, self).__init__(**kwargs)

        # La taille des onglets s'adapte à la taille disponible
        self._tab_layout.padding = [0, 0, 0, '-2dp']
        self.bind(size=self.resizeTabs)

        # L'onglet des publications (il faut utiliser l'onglet par défaut)
        self.default_tab_text = "Wall"
        self.default_tab_content = publicationsView

        # L'onglet des amis/demandes d'ami
        self.friendsViewTab = TabbedPanelItem(text="Friends",
                                              content=friendsView)

        # L'onglet des informations personnelles
        self.aboutViewTab = TabbedPanelItem(text="About", content=aboutView)

        # L'onglet du fil d'actualité
        self.activityFeedViewTab = TabbedPanelItem(text="Feed",
                                                   content=activityFeedView)

        self.add_widget(self.friendsViewTab)
        self.add_widget(self.aboutViewTab)
Beispiel #24
0
 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 build(self):
                container = super().build()

                panel = TabbedPanelItem(text="Starcraft 2 Launcher")
                self.mission_panel = panel.content = MissionLayout()

                self.tabs.add_widget(panel)

                Clock.schedule_interval(self.build_mission_table, 0.5)

                return container
Beispiel #26
0
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
Beispiel #27
0
    def __init__(self, **kwargs):
        super(MainBody, self).__init__(**kwargs)

        self.do_default_tab = False
        self.tab_height = 50
        self.tab_width = 125

        self.tab1 = TabbedPanelItem(text="Cutting Speed")
        self.tab2 = TabbedPanelItem(text="Toolpath Angle")
        self.tab3 = TabbedPanelItem(text="Material Removal")
        self.tab4 = TabbedPanelItem(text="RA")
        self.tab5 = TabbedPanelItem(text="R Edge Feed")
        self.tab6 = TabbedPanelItem(text="Tolerance")

        self.cuttingdata()
        self.helix_angle()
        self.material_removal()
        self.surface_roughness()
        self.round_edge()
        self.midpoint()

        self.add_widget(self.tab1)
        self.add_widget(self.tab2)
        self.add_widget(self.tab3)
        self.add_widget(self.tab4)
        self.add_widget(self.tab5)
        self.add_widget(self.tab6)
        self.default_tab = self.tab1
Beispiel #28
0
        def build(self):
            tp = TabbedPanel(do_default_tab=False)
            tab0 = TabbedPanelItem(text='First Tab')

            box = BoxLayout(orientation='horizontal', padding=5)
            xw0 = XWrapChromium('http://news.ycombinator.com')

            box.add_widget(xw0)

            b = Button(text='Randomize Site')
            b.bind(on_press=lambda inst: xw0.chromote.tabs[0].set_url(
                random.choice(random_sites)))
            box.add_widget(b)
            tab0.add_widget(box)

            tp.add_widget(tab0)

            tab1 = TabbedPanelItem(text='Other Panel')
            new_box = BoxLayout(orientation='vertical', padding=12)
            xw1 = XWrapChromium('http://codewaffle.com/')
            xw2 = XWrapChromium('http://eventual.games')

            b2 = Button(text='Random Sites')

            def randomize_xw12(*args, **kwargs):
                xw1.chromote.tabs[0].set_url(random.choice(random_sites))
                xw2.chromote.tabs[0].set_url(random.choice(random_sites))

            b2.bind(on_press=randomize_xw12)

            new_box.add_widget(xw1)
            new_box.add_widget(b2)
            new_box.add_widget(xw2)
            tab1.add_widget(new_box)
            tp.add_widget(tab1)

            return tp
Beispiel #29
0
    def build(self):
        height = 800
        width = 1200

        settings_layout = GridLayout(cols=2)

        self.my_controller = Controller()

        self.settings_table = TableSettings(self.my_controller)
        settings_layout.add_widget(self.settings_table.get_table())
        add_button = Button(text='add', size_hint=(.09, .005))
        add_button.bind(on_press=self.add_setting)
        save_and_run = GridLayout(cols=2)
        save_button = Button(text='Save', size_hint=(.09, .005))
        save_button.bind(on_press=self.save_settings)
        run_button = Button(text='Run', size_hint=(.09, .005))
        run_button.bind(on_press=self.run_settings)
        save_and_run.add_widget(save_button)
        save_and_run.add_widget(run_button)
        settings_layout.add_widget(add_button)
        settings_layout.add_widget(save_and_run)
        settings = TabbedPanelItem(text='settings')
        settings.add_widget(settings_layout)
        tp = TabbedPanel()
        tp.add_widget(settings)

        groups_layout = GridLayout()
        groups = TabbedPanelItem(text='groups')
        groups.add_widget(groups_layout)

        tp.add_widget(groups)

        tp.set_def_tab(settings)
        Window.clearcolor = (.43, .43, .43, .01)
        Window.size = (width, height)

        return tp
Beispiel #30
0
 def buildTab(self):
     self.background_image = "images/gui_elements/tab_darkblue.png"
     with open("config/blocks.json") as json_data:
         blocks_config = json.load(json_data)
         for tab in blocks_config["tabs"]:
             #newTab = TabbedPanelItem(text = str(tab["id"]))
             block_type = str(tab["id"])[0]
             newTab = TabbedPanelItem()
             color_tab = []
             for color in tab["rgba"]:
                 color_tab.append(color)
             newTab.background_color = color_tab
             newLayout = StackLayout(spacing=10)
             for block in tab["blocks"]:
                 newBlock = Block(block_type, str(block["id"]),
                                  str(block["source"]))
                 newLayout.add_widget(newBlock)
             newTab.content = newLayout
             self.add_widget(newTab)