예제 #1
0
 def logged_in_mode(self):
     Menu()
     core.delete_item("Login Window")
     core.add_tab_bar(name="tab_bar", parent="Main Window")
     Tab("Workout", "tab_bar").generate_tab()
     Tab("Records", "tab_bar").generate_tab()
     simple.show_item("Main Menu")
예제 #2
0
    def make_gui(self):
        dpg.set_main_window_size(self.width, self.height)
        dpg.set_theme(self.theme)
        with simple.window("Main", no_title_bar=True):
            dpg.set_main_window_title("pytasker")
            with simple.menu_bar("Menu"):
                with simple.menu("File"):
                    dpg.add_menu_item("New Page", callback=self.new_tab)
                    dpg.add_menu_item("Load Page", callback=self.load_page)
                    dpg.add_menu_item("Save Page",
                                      callback=self.save_page_dialog)
                    dpg.add_separator()
                    dpg.add_menu_item("Quit", callback=self.exit_program)
                with simple.menu("Themes"):
                    dpg.add_menu_item("Dark", callback=self.theme_callback)
                    dpg.add_menu_item("Light", callback=self.theme_callback)
                    dpg.add_menu_item("Classic", callback=self.theme_callback)
                    dpg.add_menu_item("Dark 2", callback=self.theme_callback)
                    dpg.add_menu_item("Grey", callback=self.theme_callback)
                    dpg.add_menu_item("Dark Grey",
                                      callback=self.theme_callback)
                    dpg.add_menu_item("Cherry", callback=self.theme_callback)
                    dpg.add_menu_item("Purple", callback=self.theme_callback)
                    dpg.add_menu_item("Gold", callback=self.theme_callback)
                    dpg.add_menu_item("Red", callback=self.theme_callback)

            dpg.add_tab_bar(name="tab_bar_1", parent="Main")
            with simple.group("inittext"):
                dpg.add_text("Hello! Select File - New to get started")
예제 #3
0
def tab_bar(*args,
            reorderable: bool = False,
            callback: Callable = None,
            callback_data: Any = None,
            show: bool = True,
            parent: str = "",
            before: str = ""):
    """Wraps add_tab_bar() and automates calling end().

    Args:
        name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
            anything after "##" that occurs in the name will not be shown on screen.
        **reorderable: Allows for moveable tabs.
        **callback: Registers a callback.
        **callback_data: Callback data.
        **show: Decides if the item is shown of not.
        **parent: Parent to add this item to. (runtime adding)
        **before: This item will be displayed before the specified item in the parent. (runtime adding)

    Returns:
        None
    """
    try:
        yield internal_dpg.add_tab_bar(*args,
                                       reorderable=reorderable,
                                       callback=callback,
                                       callback_data=callback_data,
                                       show=show,
                                       parent=parent,
                                       before=before)
    finally:
        internal_dpg.end()
예제 #4
0
def tab_bar(name: str,
            reorderable: bool = False,
            callback: str = "",
            parent: str = "",
            before: str = "",
            data_source: str = ""):
    try:
        yield dpg.add_tab_bar(name,
                              reorderable=reorderable,
                              callback=callback,
                              parent=parent,
                              before=before,
                              data_source=data_source)
    finally:
        dpg.end()
예제 #5
0
def tab_bar(name: str,
            reorderable: bool = False,
            callback: str = "",
            callback_data: str = "",
            show: bool = True,
            parent: str = "",
            before: str = ""):
    try:
        yield internalDPG.add_tab_bar(name,
                                      reorderable=reorderable,
                                      callback=callback,
                                      callback_data=callback_data,
                                      show=show,
                                      parent=parent,
                                      before=before)
    finally:
        internalDPG.end()
예제 #6
0
 def _add(self):
     add_tab_bar(self.name,
                 reorderable=self.reorderable,
                 **self.default_config)
예제 #7
0
 def make_gui(self):
     Menu()
     core.add_tab_bar(name="tab_bar", parent="Main Window")
     Tab("Exercises", "tab_bar").generate()
     Tab("Activity", "tab_bar").generate()
예제 #8
0
 def _setup_add_widget(self, dpg_args) -> None:
     dpgcore.add_tab_bar(self.id, **dpg_args)