Example #1
0
def set_styles():
    """
    Sets custom values for DearPy GUI window settings.
    """
    core.set_main_window_size(1500, 900)
    core.set_style_window_padding(8.00, 8.00)
    core.set_style_frame_padding(12.00, 4.00)
    core.set_style_item_spacing(8.00, 2.00)
    core.set_style_item_inner_spacing(2.00, 1.00)
    core.set_style_touch_extra_padding(0.00, 0.00)
    core.set_style_indent_spacing(12.00)
    core.set_style_scrollbar_size(16.00)
    core.set_style_grab_min_size(20.00)
    core.set_style_window_border_size(1.00)
    core.set_style_child_border_size(1.00)
    core.set_style_popup_border_size(0.00)
    core.set_style_frame_border_size(0.00)
    core.set_style_tab_border_size(0.00)
    core.set_style_window_rounding(4.00)
    core.set_style_child_rounding(4.00)
    core.set_style_frame_rounding(5.00)
    core.set_style_popup_rounding(4.00)
    core.set_style_scrollbar_rounding(5.00)
    core.set_style_grab_rounding(4.00)
    core.set_style_tab_rounding(5.00)
    core.set_style_window_title_align(0.50, 0.50)
    core.set_style_button_text_align(0.50, 0.50)
    core.set_style_selectable_text_align(0.00, 0.00)
    core.set_style_display_safe_area_padding(4.00, 4.00)
    core.set_style_global_alpha(1.00)
    core.set_style_antialiased_lines(True)
    core.set_style_antialiased_fill(True)
    core.set_style_curve_tessellation_tolerance(1.25)
    core.set_style_circle_segment_max_error(1.60)
    core.add_additional_font('Karla-Regular.ttf', 20)
Example #2
0
	def __init__(self):
		core.set_style_item_spacing(1, 1)
		core.set_style_window_padding(0, 0)
		core.set_main_window_size(690, 450)
		with simple.window("main"):
			core.add_drawing("canvas")
		core.set_resize_callback(self.__resize)
		core.set_render_callback(self.__render)
Example #3
0
    def __init__(self):
        core.set_vsync(False)
        core.set_style_item_spacing(1, 1)

        self.__timeline = Timeline()
        self.__timeline.callback(self.__timelineRender)
        self.__fps = 0

        cmds = {
            '<<': lambda: self.__timeline.seek(0),
            '<-': lambda: self.__timeline.play(-1),
            '||': self.__timeline.stop,
            '->': lambda: self.__timeline.play(1),
            '>>': lambda: self.__timeline.seek(-1),
            '@@': self.__timeline.loop
        }

        _width = 60
        _size = len(cmds.keys()) * _width

        with simple.window("main"):
            with simple.group("MediaBar"):
                with simple.group("Shuttle"):
                    for k, v in cmds.items():
                        core.add_button(f"Shuttle#{k}",
                                        label=k,
                                        width=_width,
                                        height=25,
                                        callback=v)
                        core.add_same_line()
                    core.add_text("ShuttleFPS")
                core.add_drag_float("MediabarIndex",
                                    label="",
                                    width=_size,
                                    callback=self.__cbSeek)

            core.add_color_button("TEST BUTTON", [255, 255, 255],
                                  width=400,
                                  height=400)

        self.__timeline.keyEdit("TEST BUTTON", 'width', 0, 400)
        self.__timeline.keyEdit("TEST BUTTON", 'width', 2., 10)
        self.__timeline.keyEdit("TEST BUTTON", 'width', 3.75, 400)

        core.set_render_callback(self.__render)
Example #4
0
    def __init__(self):
        core.set_style_item_spacing(1, 1)
        core.set_style_window_padding(0, 0)

        with simple.window("main"):
            with simple.group("controls", width=520):
                with simple.group("buttons"):
                    for x in range(6):
                        core.add_button(f"id-{x}", label=f"button {x}")
                    core.add_color_button("bcolor", (196, 128, 155, 255))
                    core.add_radio_button("radio")
                    core.add_checkbox("checkbox")

                core.add_same_line()

                with simple.group("misc"):
                    core.add_date_picker("date")

                with simple.group("text"):
                    core.add_text("text")
                    core.add_input_text(
                        "input_text",
                        label="",
                        default_value=
                        "Call me Ish-meal. Tasty like an ashen log.")
                    core.add_label_text("label",
                                        label="",
                                        default_value="label")

                core.add_same_line()

                with simple.group("dropdown"):
                    core.add_listbox("listbox", label="", items=(1, 2, 3))
                    core.add_combo("combo", label="", items=(1, 2, 3))

                for x in ["float", "int"]:
                    with simple.group(x):
                        for what in ["add_drag_", "add_input_"]:
                            for y in ['', 2, 3, 4]:
                                n = f"{what}{x}{y}"
                                cmd = getattr(core, n)
                                cmd(n, label="", width=200)
                    core.add_same_line()

        manager.ThemeManager()
Example #5
0
	def __init__(self):
		core.set_style_item_spacing(29, 4)
		core.set_style_window_padding(0, 0)
		core.set_main_window_size(1920, 1080)

		self.__column = 7
		self.__row = 58

		with simple.window("main"):
			with simple.group("test", width=187):
				core.add_button("THE DPG HERO WE NEED...", callback=self.__generate)

			for c in range(self.__column):
				core.add_same_line()
				with simple.group(f"col-{c}", width=187):
					x = c * self.__row
					for r in range(self.__row):
						core.add_text(str(x + r), default_value=" ")
Example #6
0
    def __init__(self):
        core.set_style_item_spacing(0, 0)
        core.set_style_window_padding(0, 0)

        self.__rows = 0
        self.__cap = 0
        self.__board = []
        self.__width = 0
        self.__height = 0

        self.__puzzles = {}
        root = path.dirname(path.realpath(__file__))
        for f in listdir(root):
            full = f"{root}/{f}"
            if not path.isfile(full) or not f.endswith('.png'):
                continue
            who, _ = path.splitext(f)
            self.__puzzles[who] = full
        keys = list(self.__puzzles.keys())
        self.__puzzle = self.__puzzles[keys[0]]

        with simple.window("MainWindow", autosize=True):
            with simple.group("Controls"):
                for d in [3, 5, 7]:
                    core.add_same_line()
                    core.add_button(f"{d} x {d}",
                                    width=120,
                                    height=50,
                                    callback=self.__clearBoard)
                    core.add_same_line()
                    core.add_dummy()
                core.add_same_line()
                core.add_button("Solve!",
                                width=120,
                                height=50,
                                callback=self.__solve)
                core.add_same_line()
                items = [p for p in self.__puzzles.keys()]
                core.add_listbox("selection",
                                 items=items,
                                 callback=self.__imgChange)
        self.__clearBoard(self, 3)
Example #7
0
    def __init__(self):
        core.set_style_item_spacing(1, 1)
        core.set_style_window_padding(0, 0)
        core.enable_docking(shift_only=False, dock_space=True)
        core.set_main_window_size(690, 450)

        root = os.path.dirname(__file__)
        self.__configFile = f'{root}/config.json'

        with simple.window("main"):
            with simple.group("test", width=200):
                core.add_button("button1")

        core.add_window()
        with simple.window("floaty", ):
            with simple.group("test", width=200):
                core.add_button("button1")

        core.set_exit_callback(self.__exit)
        self.__configLoad()
Example #8
0
import dearpygui.core as core
import dearpygui.simple as simple
from logic import listen, load_config, modal, open_url, default

WINDOW = 'L0lScape Configuration'

with simple.window(WINDOW):
    core.set_main_window_title(WINDOW)
    core.set_main_window_size(430, 460)

    core.set_theme('Purple')

    core.set_style_item_spacing(5, 5)
    core.set_style_frame_padding(5, 5)

    core.add_additional_font('resources/monofur.ttf', 18)

    core.add_dummy(width=140)
    core.add_same_line()
    core.add_image('logo', 'resources/l0lscape.png')

    core.add_button('About', callback=modal, width=100)
    core.add_same_line()
    core.add_button('Github', callback=open_url, width=100)
    core.add_same_line()
    core.add_button('Discord', callback=open_url, width=100)
    core.add_same_line()
    core.add_button('Help', callback=open_url, width=100)

    core.add_separator()
Example #9
0
    def __init__(self):

        self.__last = -1

        self.__targetFPS = 30

        # playhead position
        self.__head = 0.

        # playback stopped
        self.__direction = 0.

        # looping on
        self.__loop = True

        # thread that is "streaming" the video
        self.__thread = None

        self.__frameCount = self.__width = self.__height = 0

        self.__root = path.dirname(path.realpath(__file__))

        core.set_style_item_spacing(1, 1)
        core.set_style_frame_padding(0, 0)
        core.get_style_window_padding(0, 0)
        width = 740
        height = 680
        core.set_main_window_size(width, height)

        with simple.window("MainWindow"):
            core.add_drawing("Canvas", width=width, height=height)

        w = 50
        h = 20
        with simple.window("Media Bar",
                           autosize=True,
                           no_collapse=True,
                           no_close=True,
                           no_scrollbar=True):
            with simple.group("Browser"):
                core.add_listbox("Listing",
                                 label='',
                                 items=[],
                                 callback=self.__itemChange)

            with simple.group("Shuttle"):
                core.add_button("Shuttle#Browse",
                                width=w,
                                height=h,
                                label="...",
                                callback=lambda: core.select_directory_dialog(
                                    callback=self.__browser))
                core.add_button("Shuttle#Front",
                                width=w,
                                height=h,
                                label='|<',
                                callback=lambda: self.__seek(0))
                core.add_same_line()
                core.add_button("Shuttle#Backwards",
                                width=w,
                                height=h,
                                label='<-',
                                callback=lambda: self.__play(-1))
                core.add_same_line()
                core.add_button("Shuttle#Forwards",
                                width=w,
                                height=h,
                                label='->',
                                callback=lambda: self.__play(1))
                core.add_same_line()
                core.add_button("Shuttle#End",
                                width=w,
                                height=h,
                                label='>|',
                                callback=lambda: self.__seek(-1))
                core.add_same_line()
                core.add_color_button("Shuttle#Loop", [50, 50, 227, 255],
                                      width=w,
                                      height=h,
                                      callback=self.__loopToggle)
                core.add_same_line()
                core.add_text("ShuttleFPS")
                core.add_drag_float("MediabarHead",
                                    label="",
                                    width=w * 5 + 5,
                                    callback=self.__cbSeek)

        core.set_render_callback(self.__render)
        core.set_mouse_wheel_callback(self.__mouseWheel)
        core.set_exit_callback(self.__close)
        self.__scanDir()
Example #10
0
def login(sender, data):
    pass


def multiple_accounts(sender, data):
    core.delete_item('Account Email')
    core.delete_item('Account Password')

    core.add_input_text('Accounts File',
                        default_value='accs_to_level.txt',
                        before='Login',
                        width=200)


with simple.window('Moon Overwatch Leveling Bot'):
    core.set_style_item_spacing(15, 15)
    core.set_style_frame_padding(5, 5)
    core.add_additional_font('Roboto-Regular.ttf', 14)

    core.add_image('logo', 'moon.png')
    core.add_separator()

    core.add_input_text('Account Email',
                        default_value='*****@*****.**',
                        width=200)

    core.add_input_text('Account Password',
                        default_value='weShouldBuffBrig!69',
                        width=200)

    core.add_checkbox('Multiple Accounts',