예제 #1
0
def new_team_window(theme, x):
    sg.theme(theme)
    menu_def = [['&Application', ['&About', 'E&xit']]]

    layout = [[sg.Menu(menu_def)]]

    test = [sg.Checkbox(role, k=str(role) + "_box") for role in RoleList]
    test1 = test[:len(test) // 3]
    test2 = test[len(test) // 3:2 * len(test) // 3]
    test3 = test[2 * len(test) // 3:]

    input_layout = [
        [sg.Menu(menu_def)],
        [sg.Text('Enter player name: '),
         sg.Input(key='addplayername')], [sg.HorizontalSeparator()],
        [sg.HorizontalSeparator()],
        [sg.Text('Select player roles. DPS role is automatically assumed')],
        test1, test2, test3,
        [
            sg.Button('Cancel', k="Menu", size=(12, 2), button_color="orange"),
            sg.Text("\t\t\t"),
            sg.Button('Add player', size=(12, 2), button_color="green")
        ]
    ]

    layout += input_layout

    return sg.Window('Add Player ' + str(x) + "/10",
                     layout,
                     element_justification="center",
                     font=14)
예제 #2
0
 def sys_specific_menu(self):
     if platform.system() == "Windows":
         return sg.Menu(
             menu_definition=[["File", ["About","Exit"]]],
             background_color="snow",    # Menu does not use the theme and gets a blue background
             text_color="black",
             font=("Arial", 10))
     else:
         return sg.Menu(
             menu_definition=[["File", ["About","Exit"]]],
             font=("Arial", 10))
예제 #3
0
def new_comp_window(theme):
    sg.theme(theme)
    menu_def = [['&Application', ['&About', 'E&xit']]]

    layout = [[
        sg.Text('Add new composition',
                size=(38, 1),
                justification='center',
                font=("Helvetica", 24),
                relief=sg.RELIEF_RIDGE)
    ]]  # k = event

    layout2 = [[sg.Menu(menu_def)]]

    test1 = [
        sg.Spin([i for i in range(0, 11)],
                initial_value=0,
                k=str(role) + "_SPIN",
                size=(5, 20)) for role in RoleList
    ]
    test2 = [sg.Text(role) for role in RoleList]
    test = [i for t1t2 in zip(test2, test1) for i in t1t2]
    test1 = test[:len(test) // 3]
    test2 = test[len(test) // 3:2 * len(test) // 3]
    test3 = test[2 * len(test) // 3:]

    input_layout = [
        [sg.Menu(menu_def)], [sg.Text('Enter composition name:')],
        [sg.Input(key='addcompname')], [sg.HorizontalSeparator()],
        [sg.HorizontalSeparator()],
        [
            sg.Text(
                'Select number of players for each role. The remaining will be filled with DPS'
            )
        ], test1, test2, test3,
        [
            sg.Button('Back',
                      key='Compositions',
                      size=(12, 2),
                      button_color="orange"),
            sg.Text("\t\t"),
            sg.Button('Save', size=(12, 2), button_color="green")
        ]
    ]

    layout += input_layout + layout2

    return sg.Window('Gw2-RaidComp Compositions',
                     layout,
                     element_justification="center",
                     font=14)
예제 #4
0
def init_layout():
    layout = [
        [
            sg.Menu(menu_definition=[
                ['File', ['New::new-file', 'Open::open-file']],
                ['Help', ['About']],
            ])
        ],
        [
            sg.Multiline('Alfa',
                         size=(80, 5),
                         pad=(0, 80, 0, 0),
                         key='multiline-field',
                         disabled=True),
        ],
        [sg.Text('TIMESTAMP\t:', auto_size_text=False, key='input-text1')],
        [sg.Text('CONTENT\t:', auto_size_text=False, key='input-text2')],
        [
            # sg.Text('', auto_size_text=False, key='input-text'),
            sg.InputText('',
                         pad=(0, 20, 0, 0),
                         size=(80, 0),
                         key='input-field',
                         enable_events=True),
            sg.Exit('EXIT'),
        ],
        # [
        #     sg.Menu(menu_definition=[['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
        #     ['&Edit', ['!&Paste', ['Special', 'Normal', ], 'Undo'], ],
        #     ['&Debugger', ['Popout', 'Launch Debugger']],
        #     ['&Toolbar', ['Command &1', 'Command &2', 'Command &3', 'Command &4']],
        #     ['&Help', '&About...'], ])
        # ],
    ]
    return layout
def getWindow():
    menu_def = [[
        'Settings', ['Add Replay Folder...', 'Add Build to Library...']
    ]]

    layout = [
        [sg.Menu(menu_def, tearoff=True)],
        [
            sg.Frame(layout=[[sg.Checkbox('Include vs A.I.')],
                             [
                                 sg.Text('Past Games to Average'),
                                 sg.Spin(values=[
                                     "{:02d}".format(x) for x in range(1, 61)
                                 ],
                                         initial_value=30)
                             ]],
                     title='Analysis and Display Options',
                     relief=sg.RELIEF_SUNKEN)
        ],
        [
            sg.Multiline(disabled=True, key='-OUTPUT-', size=(45, 15))
        ],  #, sg.Image('C:\\Users\\matthew\\Documents\\gitprojects\\Starcraft2Metrics\\gui\\Acropolis.png')],
        [sg.Button('Refresh'), sg.Button('Exit')],
    ]

    window = sg.Window('Replay Analysis', layout)

    return window
예제 #6
0
def TestMenus():
    sg.ChangeLookAndFeel('LightGreen')
    sg.SetOptions(element_padding=(0, 0))

    # ------ Menu Definition ------ #
    menu_def = [
        ['&File', ['&Open', '&Save', '&Properties', 'E&xit']],
        [
            '&Edit',
            ['&Paste', [
                'Special',
                'Normal',
            ], 'Undo'],
        ],
        [
            '&Toolbar',
            [
                '---', 'Command &1', 'Command &2', '---', 'Command &3',
                'Command &4'
            ]
        ],
        ['&Help', '&About...'],
    ]

    # ------ GUI Defintion ------ #
    layout = [[sg.Menu(menu_def, tearoff=False, pad=(20, 1))],
              [sg.Output(size=(60, 20))],
              [
                  sg.Text('Status Bar',
                          relief=sg.RELIEF_SUNKEN,
                          size=(55, 1),
                          pad=(0, 3),
                          key='_status_')
              ]]

    window = sg.Window("Windows-like program",
                       default_element_size=(12, 1),
                       auto_size_text=False,
                       auto_size_buttons=False,
                       default_button_element_size=(12, 1)).Layout(layout)

    # ------ Loop & Process button menu choices ------ #
    while True:
        event, values = window.Read()
        if event is None or event == 'Exit':
            return
        print('Event = ', event)
        # ------ Process menu choices ------ #
        if event == 'About...':
            window.Disappear()
            sg.Popup('About this program',
                     'Version 1.0',
                     'PySimpleGUI rocks...',
                     grab_anywhere=True)
            window.Reappear()
        elif event == 'Open':
            filename = sg.PopupGetFile('file to open', no_window=True)
            print(filename)
        elif event == 'Properties':
            SecondForm()
예제 #7
0
def open_bod_window(mngr):
    bod_menu = [['Settings', ['Build Library...']]]

    bod_layout = [[sg.Menu(bod_menu, tearoff=True)], [sg.Text('Replay')],
                  [sg.Input(), sg.FileBrowse()],
                  [sg.Text('Player Name'),
                   sg.InputText()],
                  [sg.Multiline(disabled=True, key='-OUTPUT-', size=(45, 15))],
                  [sg.Button('Analyze'),
                   sg.Button('Exit')]]

    bod_window = sg.Window('Build Order Deviation', bod_layout)

    while True:
        event, values = bod_window.Read()

        if event is None or event == 'Exit':
            break

        if event == 'Build Library...':
            open_build_lib_window(mngr)

        if event == 'Analyze':
            bod_window['-OUTPUT-'].Update(mngr.get_bod_results_from_replay(
                values[1], values[2]),
                                          append=True)

    bod_window.close()
예제 #8
0
    def create_game_layout(self):  # standard game layout
        # Menu Bar at the top. We can add other options for how we want to see stuff.
        menu_bar = [["Game", ["New Game", "Exit Game"]]]

        layout = [[sg.Menu(menu_bar, tearoff=False, key="-MENU-")],
                  [sg.Text("Player vs. BUTTS the Battleship game AI")],
                  [sg.Image('assets/battleship_title.png', size=(800, 200))]]

        player_board_layout = [[sg.Text("Player Board:")]]
        player_board_layout += self.__create_grid(
            self.player1.get_board(),
            "Player ")  # Initializes each button with key "Player (row,col)"

        enemy_board_layout = [[sg.Text("Enemy Board:")]]
        enemy_board_layout += self.__create_grid(
            self.player2.get_board(),
            "Enemy ")  # Initializes each button with key "Enemy (row,col)"

        ship_button_layout = [[sg.Image('assets/patrol.png')],
                              [sg.Image('assets/sub.png')],
                              [sg.Image('assets/destroyer.png')],
                              [sg.Image('assets/battleship.png')],
                              [sg.Image('assets/carrier.png')]]

        layout += [[
            sg.Column(ship_button_layout),
            sg.Column(player_board_layout),
            sg.VSeperator(),  # Line that separates the two.
            sg.Column(enemy_board_layout)
        ]]

        return layout
 def menu_cadastrar(self):
     background = '#20660C'
     text = '#FAE98E'
     button_color=('#F3EE44', '#06470F')
     menu = [['Arquivo', ['Abrir', 'Salvar', 'Propriedades', 'Sair']]]
     layout = [[sgui.Menu(menu)],
               [sgui.Text('Cadastrar time', text_color='#FAE98E', background_color=background, size=(55,2), font=('Candara', 25), justification='center')],
               [sgui.Frame('Informe o nome do time', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F',
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,40), 
                             layout=[[sgui.Text('Nome do time:', size=(50,0), background_color='#06470F', font=('Candara', 12,'bold')), 
                             sgui.InputText(size=(40,1), font=(16), pad=((25,20),0), key=('time_nome'))]])]])],
               [sgui.Frame('Informe as cores do time', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', vertical_alignment='top',
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,200), 
                             layout=[[sgui.Text('Escolha no botão a cor primária do time:', size=(40,1), background_color='#06470F', font=('Candara', 12,'bold')),
                             sgui.ColorChooserButton('Botão cor primária', font=('Candara', 12, 'bold'), pad=(0,10), 
                             button_color=button_color, size=(10,3), target='cor1', key='cor_p'), 
                             sgui.InputText(size=(40,1), font=(16), pad=(20,20), key=('cor1'), disabled=True)],
                             [sgui.Text('Escolha no botão a cor secundária do time:', size=(40,1), background_color='#06470F', font=('Candara', 12,'bold')),
                             sgui.ColorChooserButton('Botão cor secundária', font=('Candara', 12, 'bold'), pad=(0,10), 
                             button_color=button_color, size=(10,3), target='cor2', key='cor_s'), 
                             sgui.InputText(size=(40,1), font=(16), pad=(20,20), key=('cor2'), disabled=True)]])]])],
               [sgui.Button('Confirmar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30))),
                     sgui.Button('Voltar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30)))]]
     window = sgui.Window('', layout, background_color=background, element_justification='left', finalize=True, keep_on_top = True)
     self.janela = window
     return
예제 #10
0
def init_layout():
    layout = [
        [
            sg.Text('', auto_size_text=False, key='time-text'),
            sg.Multiline('Alfa'),
            sg.Input('Input here')
        ],
        [
            sg.Menu(menu_definition=[
                ['File', ['New::new-file', 'Open::open-file']],
                ['Help', ['About']]
          ])
        ],
        [
            sg.Exit('EXIT', pad=(200, 0,0,0))
        ],
        # [
        #     sg.Menu(menu_definition=[['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
        #     ['&Edit', ['!&Paste', ['Special', 'Normal', ], 'Undo'], ],
        #     ['&Debugger', ['Popout', 'Launch Debugger']],
        #     ['&Toolbar', ['Command &1', 'Command &2', 'Command &3', 'Command &4']],
        #     ['&Help', '&About...'], ])
        # ],
    ]
    return layout
예제 #11
0
def make_win3RADIO():  ##define Radio Window Layout and contents

    sg.theme('DarkAmber')
    sg.set_options(element_padding=(1, 1))
    layout = [[sg.Menu(menu_def, tearoff=False, pad=(200, 1))],
              [sg.Text('Radio I/O')],
              [sg.Output(size=(80, 25), key='-OUTPUT_RADIO-')],
              [
                  sg.Button('Send Message to all', key='Send Message'),
                  sg.InputText(key='-MSGINPUT-'),
                  sg.Checkbox('AK MSK', key='-AKMSGTF-'),
                  sg.Checkbox('Want Response', key='-WNTRSPTF-')
              ],
              [
                  sg.Button('Send to node'),
                  sg.Text('message'),
                  sg.InputText(size=(20, 1), key='-NODE_MSG-'),
                  sg.Text('Node'),
                  sg.InputText(size=(10, 1), key='-NODE-')
              ],
              [
                  sg.Button('Connect to Radio'),
                  sg.Button('Close Radio Window'),
                  sg.Button('Close Radio Connection')
              ]]
    return sg.Window('Radio I/O',
                     layout,
                     finalize=True,
                     no_titlebar=True,
                     grab_anywhere=True)
예제 #12
0
 def menu_cadastrar(self, pessoas_dict_dados):
     background = '#20660C'
     text = '#FAE98E'
     button_color=('#F3EE44', '#06470F')
     menu = [['Arquivo', ['Abrir', 'Salvar', 'Propriedades', 'Sair']]]
     layout = [[sgui.Menu(menu)],
               [sgui.Text('Cadastrar pessoa', text_color='#FAE98E', background_color=background, size=(55,2), font=('Candara', 25), justification='center')],
               [sgui.Text('Marque a caixa da opcao que deseja cadastrar:'.upper(), font=('Candara', 16,'bold'), text_color=text, background_color=background)],
               [sgui.Frame('Cadastrar jogador', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='t', background_color='#06470F', size=(1000,40),
                             layout=[[sgui.Radio('Informe o nome do jogador:', 'r1', text_color='white', background_color='#06470F', size=(25,10), font=('Candara', 14), key='jogador'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key='jogador_nome'),
                             sgui.Combo(pessoas_dict_dados['posicoes'], default_value='Escolha a posição do jogador', font=(12), size=(30,1), readonly=True, key='posicao')]])]])],
               [sgui.Frame('Cadastrar técnico', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,40), 
                             layout=[[sgui.Radio('Informe o nome do técnico:', 'r1', text_color='white',background_color='#06470F', size=(25,10), font=('Candara', 14), key='tecnico'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key=('tecnico_nome')),
                             sgui.Combo(pessoas_dict_dados['mentalidades'], default_value='Escolha a mentalidade do técnico', font=(12), size=(30,1), readonly=True, key='mentalidade')]])]])],
               [sgui.Frame('Cadastrar árbitro', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,40), 
                             layout=[[sgui.Radio('Informe o nome do árbitro:', 'r1', text_color='white',background_color='#06470F', size=(25,10), font=('Candara', 14), key='arbitro'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key=('arbitro_nome')),
                             sgui.Combo(pessoas_dict_dados['rigidez'], default_value='Escolha a rigidez do árbitro', font=(12), size=(30,1), readonly=True, key='rigidez')]])]])],
               [sgui.Button('Confirmar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30))),
                     sgui.Button('Voltar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30)))]]
     window = sgui.Window('', layout, background_color=background, element_justification='left', finalize=True, keep_on_top = True)
     self.janela = window
     return
예제 #13
0
def encounter_window(theme):
    # dodej spodi se search by wing

    sg.theme(theme)
    menu_def = [['&Application', ['&About', 'E&xit']]]
    layout = [[sg.Menu(menu_def)]]

    layout2 = [[sg.Text("All Compositions:")],
               [
                   sg.Listbox(values=list(Compositions.keys()) +
                              list(CustomCompositions.keys()),
                              size=(20, 12),
                              key="COMP_SELECT",
                              enable_events=True,
                              select_mode="LISTBOX_SELECT_MODE_SINGLE")
               ], [sg.HorizontalSeparator()]]
    layout3 = [[sg.HorizontalSeparator()],
               [
                   sg.Button(button_text="Back",
                             k="Load",
                             size=(13, 2),
                             button_color="orange"),
                   sg.Button(button_text="Select",
                             size=(13, 2),
                             button_color="green")
               ]]

    layout += layout2 + layout3

    return sg.Window('Gw2-RaidComp Compositions',
                     layout,
                     element_justification="center",
                     font=14)
예제 #14
0
def table_gui():
    menu_def = [[
        '&File',
        [
            '&Open Students File', '&Save Students File', '---', 'Properties',
            'E&xit'
        ]
    ], ['&Import', ['&Matched Classes']],
                ['&Run', ['&Match Classses', '&Generate Jpg', "&Preview"]],
                ['&About', ['About']]]

    layout = [[sg.Menu(menu_def)],
              [
                  sg.Button("Preview"),
                  sg.Button("Export as Image"),
                  sg.Button("Match Classes"),
                  sg.Listbox(values=['Student 1', 'Student 2', 'Student 3'],
                             size=(30, 6))
              ]]
    window = sg.Window('Graphical Timetabler',
                       layout,
                       resizable=True,
                       size=(1000, 750))
    event, values = window.read()
    if event == "About":
        about()
    if event == "Match Classses":
        subject_gui()


#    if event =="Open Students File":

    event, values = window.read()
예제 #15
0
def get_layout():
    boutons = [[sg.InputText(key="__NOM__", size=(
        20, 1)), sg.OK()]] + [[
            sg.Text("", size=(30, 5), auto_size_text=True, key="__MESSAGE__")
        ]] + [[
            sg.Button(button_text="BOUTON" + str(0),
                      key="BOUTON" + str(0),
                      size=(40, 2),
                      visible=False,
                      bind_return_key=True)
        ]] + [[
            sg.Button(button_text="BOUTON" + str(i),
                      key="BOUTON" + str(i),
                      size=(40, 2),
                      visible=False)
        ] for i in range(1, 6)]
    colonne = sg.Column(boutons, key="__COLONNE__")
    layout = [[
        sg.Menu([], key="__MENU__"),
    ],
              [
                  sg.Graph((WIDTH, HEIGHT), (0, HEIGHT), (WIDTH, 0),
                           background_color='green',
                           key='__TAPIS__',
                           float_values=True,
                           enable_events=True,
                           drag_submits=False), colonne
              ]]

    return layout
예제 #16
0
 def __init__(self):
     menu_def = [
         ['File', ['Open', 'Save', 'Exit']],
         [
             'Edit',
             ['Paste', [
                 'Special',
                 'Normal',
             ], 'Undo'],
         ],
         ['Help', 'About...'],
     ]
     layout = [[sg.Menu(menu_def)],
               [
                   sg.Graph(canvas_size=(600, 600),
                            graph_bottom_left=(-10, 0),
                            graph_top_right=(210, 200),
                            enable_events=True,
                            pad=(50, 50),
                            background_color='white',
                            key='graph')
               ]]
     self.window = sg.Window('Windwow', layout,
                             grab_anywhere=True).Finalize()
     self.graph = self.window.Element('graph')
예제 #17
0
def main():
    # Design pattern 2 - First window remains active
    menu_def = [['MODE', ['AUTO', 'Manual', '---', 'Exit',]]        ]
    tab1_layout =  [[sg.T('This is inside tab 01')]                 ]
    tab2_layout =  [[sg.T('This is inside tab 020')],
                    [sg.T('This is inside tab 021')],
                    [sg.T('This is inside tab 022')],
                    [sg.T('This is inside tab 023')],
                    [sg.T('This is inside tab 024')],
                    [sg.In(key='-in_tab02-')]                       ]

    layout1 = [[sg.Menu(menu_def)                                   ],
              [sg.TabGroup([[sg.Tab('Tab 1', tab1_layout),
               sg.Tab('Tab 2', tab2_layout)]])                      ],
              [sg.Input(do_not_clear=True, key='-INPUT_1-')         ],
              [sg.Text(text=' ', size=(15,1), key='-in_tab-')       ],
              [sg.Button('Launch 2'),
               sg.Button('Launch 3'),
               sg.Button('Exit')                                   ]]

    layout2 = [ [sg.Text('Window 2')],
                [sg.Input(do_not_clear=True, key='-in_layout_2-')],
                [sg.Button('Close')]]

    layout3 = [ [sg.Text('Window 3')],
                [sg.Input(do_not_clear=True, key='-in_layout_3-')],
                [sg.Text(text=' ', size=(15,1))],
                [sg.Button('Close')]]

    win1 = sg.Window('Window 1', layout1)
    win2_active = False
    win3_active = False

    while True:
        #--- read 'Window 1' -------------------------------------------
        ev1, vals1 = win1.Read(timeout=100)
        print(ev1, vals1)
        if ev1 is None or ev1 == 'Exit':
            break

        #--- open 'Window 2' -------------------------------------------
        if not win2_active and ev1 == 'Launch 2':
            win2_active = True
            win2 = sg.Window('Window 2', layout2)
        if win2_active:
            ev2, vals2 = win2.Read(timeout=100)
            if ev2 is None or ev2 == 'Close':
                win2_active  = False
                win2.Close()

        #--- open 'Window 3' -------------------------------------------
        if not win3_active and ev1 == 'Launch 3':
            win3_active = True
            win3 = sg.Window('Window 3', layout3)
        if win3_active:
            ev3, vals3 = win3.Read(timeout=100)
            win3.FindElement('-in_layout_3-').Update(vals1['-in_tab02-'])
            if ev3 is None or ev3 == 'Close':
                win3_active  = False
                win3.Close()
예제 #18
0
def gen_layout_menu(config, macros):

    menu_def = [["File", ["Go Back", "Exit"]], ["Tools", ["Toggle Freeze"]],
                ["Help", ["Open Docs"]]]

    menu = sg.Menu(menu_def,
                   background_color=None,
                   size=(None, None),
                   tearoff=False,
                   font=None,
                   pad=None,
                   key=None,
                   k=None,
                   visible=True,
                   metadata=None)

    title = sg.Text(config["MenuParams"]["menu_name"],
                    font=("Helvetica", 15, "bold"),
                    justification="center",
                    key="menu_title")

    event_trigger = sg.Button("Click",
                              key="event_trigger",
                              metadata="",
                              visible=False)

    macro_frame = sg.Frame(
        "Macros",
        layout=[gen_layout_macro_single(x, event_trigger) for x in macros],
        font=("Helvetica", 10, "bold"),
        relief="solid",
        border_width=0,
        key="macro_frame")

    return [[menu], [title], [macro_frame], [event_trigger]]
예제 #19
0
 def menu_buscar(self, lista_jogadores, lista_tenicos, lista_arbitros):
     background = '#20660C'
     text = '#FAE98E'
     button_color=('#F3EE44', '#06470F')
     menu = [['Arquivo', ['Abrir', 'Salvar', 'Propriedades', 'Sair']]]
     layout = [[sgui.Menu(menu)],
               [sgui.Text('Buscar pessoa', text_color='#FAE98E', background_color=background, size=(55,2), font=('Candara', 25), justification='center')],
               [sgui.Text('Marque a opcao que deseja buscar, digite o nome ou escolha uma pessoa da lista:'.upper(), font=('Candara', 16,'bold'), text_color=text, background_color=background)],
               [sgui.Frame('Buscar jogador', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='t', background_color='#06470F', size=(1000,40),
                             layout=[[sgui.Radio('Informe o nome do jogador:', 'r1', text_color='white', background_color='#06470F', size=(25,10), font=('Candara', 14), key='jogador'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key='in_jnome'),
                             sgui.Combo(sorted(lista_jogadores), default_value='Escolha um jogador da lista', font=(12), size=(30,1), readonly=True, key='lst_jnome')]])]])],
               [sgui.Frame('Cadastrar técnico', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,40), 
                             layout=[[sgui.Radio('Informe o nome do técnico:', 'r1', text_color='white',background_color='#06470F', size=(25,10), font=('Candara', 14), key='tecnico'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key=('in_tnome')),
                             sgui.Combo(sorted(lista_tenicos), default_value='Escolha um técnico da lista', font=(12), size=(30,1), readonly=True, key='lst_tnome')]])]])],
               [sgui.Frame('Cadastrar árbitro', font=('Candara', 12,'bold'), title_color='#FAE98E', background_color='#06470F', pad=(20,15),
                     layout=[[sgui.Column(vertical_alignment='b', background_color='#06470F', size=(1000,40), 
                             layout=[[sgui.Radio('Informe o nome do árbitro:', 'r1', text_color='white',background_color='#06470F', size=(25,10), font=('Candara', 14), key='arbitro'), 
                             sgui.InputText(size=(35,1), font=(16), pad=((25,20),0), key=('in_anome')),
                             sgui.Combo(sorted(lista_arbitros), default_value='Escolha um árbitro da lista', font=(12), size=(30,1), readonly=True, key='lst_anome')]])]])],
               [sgui.Button('Confirmar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30))),
                     sgui.Button('Voltar', size=(15,2), font=('Candara', 12, 'bold'), button_color=button_color, pad=((15,15), (30,30)))]]
     window = sgui.Window('', layout, background_color=background, element_justification='left', finalize=True, keep_on_top = True)
     self.janela = window
     return
예제 #20
0
def menu_window(theme):
    sg.theme(theme)
    menu_def = [['&Application', ['&About', 'E&xit']]]

    input_layout = [
        [sg.Menu(menu_def)],
        [
            sg.Button(button_text="Compositions",
                      size=(13, 2),
                      button_color="white")
        ],
        [sg.HorizontalSeparator()],
        [sg.Text('Choose mode:')],
        [
            sg.Button(button_text="Pug Commander", size=(15, 3)),
            sg.Text("\t\t\t   "),
            sg.Button(button_text="Static Commander", size=(15, 3))
        ],
    ]

    layout = [[
        sg.Text('MENU',
                size=(38, 1),
                justification='center',
                font=("Helvetica", 24),
                relief=sg.RELIEF_RIDGE)
    ]]  # k = event
    layout += input_layout

    return sg.Window('Gw2-RaidComp Menu',
                     layout,
                     element_justification="center",
                     font=14)
예제 #21
0
def make_win5NODES():  ##define Radio Window Layout and contents

    sg.theme('DarkAmber')
    sg.set_options(element_padding=(1, 1))
    layout = [[sg.Menu(menu_def, tearoff=False, pad=(200, 1))],
              [sg.Text('Nodes')],
              [sg.Output(size=(100, 25), key='-OUTPUT_NODES-')],
              [sg.Button('Nodes')],
              [
                  sg.Button('Send Message to node'),
                  sg.Text('message'),
                  sg.InputText(size=(20, 1), key='-NODE_MSG-'),
                  sg.Text('Node'),
                  sg.InputText(size=(10, 1), key='-NODE-')
              ],
              [
                  sg.Button('Send Command to node'),
                  sg.Text('command'),
                  sg.InputText(size=(20, 1), key='-NODE_CMD-'),
                  sg.Text('Node'),
                  sg.InputText(size=(10, 1), key='-NODE1-')
              ], [sg.Button('Close Node Window')]]

    return sg.Window('Nodes',
                     layout,
                     finalize=True,
                     no_titlebar=True,
                     grab_anywhere=True)
예제 #22
0
    def build_main_layout(self):
        """
         Creates main page layout
         """

        sg.ChangeLookAndFeel(self.gui_theme)
        sg.SetOptions(margins=(0, 3), border_width=1)

        menu_elem = sg.Menu(menu, tearoff=False)

        search_layout = [
            [
                sg.Text('Welcome to your personal Movie Database',
                        justification='center',
                        font='Courier 20')
            ],
            [sg.Text('')],
            [sg.Button('Login', font='Courier 20')],
            [sg.Button('Sign In', font='Courier 20')],
            [sg.Text('')],
        ]

        layout = [[menu_elem],
                  [
                      sg.Column(search_layout,
                                justification='center',
                                element_justification='center',
                                key='-COL1-')
                  ]]

        return layout
예제 #23
0
def create_journal_layout():
    file_new: str = 'New............(CTRL+N)'
    file_open: str = 'Open..........(CTRL+O)'
    file_save: str = 'Save............(CTRL+S)'
    day = date.today()
    journal_text = 'Today is: ' + str(
        day
    ) + '. Write down how your day is going or what you want to achieve.'
    menu_layout: list = [[
        'File', [file_new, file_open, file_save, 'Save As', '---', 'Exit']
    ], ['Help', ['About']]]
    layout = [[sg.Menu(menu_layout)],
              [
                  sg.Text('> New entry <',
                          font=('Consolas', 10),
                          size=(600, 1),
                          key='_INFO_')
              ], [sg.Text(journal_text)],
              [
                  sg.Multiline(font=('Consolas', 12),
                               size=(600, 500),
                               key='_BODY_')
              ], [sg.Button('Exit')]]

    return layout
예제 #24
0
    def build_signin_layout(self):
        """
        Creates Sign In window layout
        """

        sg.ChangeLookAndFeel(self.gui_theme)
        sg.SetOptions(margins=(0, 3), border_width=1)

        menu_elem = sg.Menu(menu, tearoff=False)

        login_layout = [[sg.Text('Welcome!', font='Courier 25')],
                        [
                            sg.Text('Choose your username:'******'Courier 20'),
                            sg.Input(font="Courier 20")
                        ],
                        [
                            sg.Text('Choose your password:'******'Courier 20'),
                            sg.Input(font="Courier 20", password_char='*')
                        ],
                        [
                            sg.Button('Ok', bind_return_key=True),
                            sg.Button('Back'),
                            sg.Button('Cancel')
                        ]]

        layout = [[menu_elem], [sg.Column(login_layout, key='-COL1-')]]

        return layout
예제 #25
0
    def makeMain(self): # make the physical gui

        sg.ChangeLookAndFeel('LightGreen')
        sg.SetOptions(element_padding=(0,0))

        # ---Menu Definitions--- #
        menu_def = [
            ['File', ['Save', 'Exit']], 
            ['Reddit', ['Subreddit', 'Summary',['New', 'Hot'], 'Advanced']], 
            ['Clear',['All',]], 
            ['Help', ['About', 'Instructions', ]]
            ]

        # ---GUI Definition--- #
        layout = [
            [sg.Menu(menu_def, )],
            [sg.Output(size=(100, 40), key='_output_')]
        ]

        window = sg.Window("Window-like program", layout, default_element_size=(12,1), auto_size_text = False, auto_size_buttons = False, default_button_element_size = (12,1))

        # ---Popup input window--- #

        # ---Loop and Process button menu choices--- #
        while True:
            event, values = window.read()
            if event == None or event == 'Exit':
                break
            # --- Process menu choices ---#
            if event == 'About':
                sg.popup('Reddit Companion', 'Version 0.01')
            elif event == 'Instructions':
                window.FindElement('_output_').Update('Instructions \n Click on Reddit tab to see options \n Click on Subreddit to change the subreddit, the default is "UConn" \n Click on Overview to get quick summaries \n Click on Advanced to create a specific search')
            elif event == 'All':
                window.FindElement('_output_').Update('')
            elif event == 'New':
                window.FindElement('_output_').Update('')
                newest = func.getSummary(self, self.sub, "new")
                for post in newest:
                    func.printInfo(self, post)
            elif event == 'Hot':
                window.FindElement('_output_').Update('')
                hottest = func.getSummary(self, self.sub, "hot")
                for post in hottest:
                    func.printInfo(self, post)
            elif event == "Advanced":
                text = sg.PopupGetText('Only separate words with spaces.', 'Search Criteria')
                if text != None:
                    window.FindElement('_output_').Update('')
                    inputs = str(text).split()
                    results = func.advanced(self, self.sub, inputs)
                if results != None:
                    for post in results:
                        func.printInfo(self, post)
            elif event == 'Subreddit':
                subR = sg.PopupGetText('Subreddit?', 'Change Subreddit')
                self.makebot(subR)


        window.close()
예제 #26
0
def pxxteste02():

    sg.ChangeLookAndFeel('DarkBlue11')      

    # ------ Menu Definition ------ #      
    menu_def = [['File', ['Open', 'Save', 'Exit', 'Properties']],      
                ['Edit', ['Paste', ['Special', 'Normal', ], 'Undo'], ],      
                ['Help', 'About...'], ]      

  #  
    column1 = [[sg.Text('Column 1', background_color='#F7F3EC', justification='center', size=(10, 1))],      
                [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 1')],      
                [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 2')],      
                [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 3')]]      

    layout = [      
        [sg.Menu(menu_def, tearoff=True)],      
        [sg.Text('Opções de Seleção e Consulta!', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE)],    
        [sg.Text('PESQUISA, informe:')],  
        #[sg.Text('Jogo De:', size=(5, 1)), sg.InputText()), sg.Text('Até:', size=(5, 1), sg.InputText())],      
        [sg.Text('Jogo De:', size=(7, 1)), sg.Input(size=(5,0), key='jde'), sg.Text('Ate:', size=(3, 0)), sg.InputText(size=(5,1), key='jate')],
        [sg.Submit(tooltip='Click to submit this window'), sg.Cancel()]    
    ]      

    window = sg.Window('Menu de Opções da Lotofacil', layout, default_element_size=(40, 1), grab_anywhere=False)    
    event, values = window.read()  
    #window.Maximize()    
    window.close()    

    sg.popup('Title',      
                'The results of the window.',      
                'The button clicked was "{}"'.format(event),      
                'The values are', values)
예제 #27
0
    def create_ai_battle_layout(
            self):  # form for when two AI's are battling each other
        # Menu Bar at the top. We can add other options for how we want to see stuff.
        menu_bar = [["Game", ["New Game", "Exit Game"]]]

        layout = [[sg.Menu(menu_bar, tearoff=False, key="-MENU-")],
                  [sg.Text("Battle of the BUTTS: Basic vs Advanced")],
                  [sg.Image('assets/battleship_title.png', size=(600, 200))]]

        player1_board_layout = [[sg.Text("Basic Board:")]]
        player1_board_layout += self.__create_grid(self.player1.get_board(),
                                                   "player1 ")

        player2_board_layout = [[sg.Text("Advanced Board:")]]
        player2_board_layout += self.__create_grid(self.player2.get_board(),
                                                   "player2 ")

        layout += [
            [
                sg.Column(player1_board_layout),
                sg.VSeperator(),  # Line that separates the two.
                sg.Column(player2_board_layout)
            ],
            [sg.Button("Next", key="next")]
        ]

        return layout
예제 #28
0
    def __init__(self):

        # Aparência
        sg.ChangeLookAndFeel('SystemDefault')

        # Layout - Campos para serem exibidos
        menu_def = [
            ['&Clientes', ['&Inclusão', '&Alteração']],
            ['&Veículos', ['I&nclusão', 'A&lteração']],
            ['&Locação', ['&Registrar', '&Devolução']],
            ['A&juda', '&Sobre...'],
        ]

        option1 = sg.Button("Option 1", enable_events=True)

        opcoes = [
            option1,
            sg.Button("Option 2"),
            sg.Button("Option 3"),
            sg.Button("Option 4"),
        ]

        rodape = [sg.Text('Rodape')]

        layout = [
            #[sg.Text("Hello from PySimpleGUI")], [sg.Button("OK")]
            [sg.Menu(menu_def, tearoff=True)],
            opcoes,
            rodape
        ]

        # Janela
        self.janela = sg.Window('Menu principal',
                                size=(800, 600)).layout(layout)
예제 #29
0
    def get_board(self):
        ############### user interface creation ############################
        archive = ['&Nuevo', '&Guardar', '&Cargar', '&Salir']
        help = ['&Ver reglas', '&Acerca de ScrabbleAR']
        menu_buttons = [['&Archivo', archive], ['A&yuda', help]]

        ######### column creation
        column_1=[]
        for i in range(15):
            row = []
            for j in range(15):
                r,a,value = colorize_buttons((i, j))
                row.append(sg.Button( a , size=(2,1), key=(i,j), pad=(0,0), button_color=(None, r)))
            column_1.append(row)


        column_2 = [   [sg.Text(' ' * 3),sg.Button('Reponer')],
                        [sg.Text(' ' * 22)],
                        [sg.Text('Tiempo de Juego', key='-CLOCK_TEXT-')],
                        [sg.Text(key='-CLOCK-', size=(8, 2), font=('Helvetica', 11), justification='center')],
                        [sg.Text(' ' * 22)],
                        [sg.Text(' ' * 22)],
                        [sg.Button ('Pasar turno', key='pasarturno')]
                    ]
        #Armo el diseño de la interface
        layout=[[sg.Menu(menu_buttons)],
                [sg.Text('Tablero Pc '), sg.Text('Puntaje', key='puntajepc')],
                [sg.Button(key=i + 7, button_text='?', size=(2,1), pad=((1,1), (16, 1)), enable_events=True, disabled=True) for i in letras_pc],
                [sg.Column(column_1), sg.Column(column_2)],
                [sg.Text('Tablero Jugador '), sg.Text('Puntaje', key= 'puntajejugador')],
                [sg.Button(key=i, button_text=letras_usuario, size=(2,1), pad=((1,1), (16, 1)), enable_events=True) for i in letras_usuario]
                ]

        window = sg.Window('Juguemos', layout)
        return window
예제 #30
0
def create_main_window(settings):
    sg.theme(settings['theme'])
    menu_def = [['&Menu', ['&Settings', 'E&xit']], ['&Help', '&About...']]

    right_click_menu = ['Unused', ['Settings', 'E&xit']]

    layout = [[sg.Menu(menu_def)],
              [
                  sg.Text('Welcome! I am your Virtual Assistant Alpha.',
                          font=('Comic sans ms', 10),
                          size=(59, 1)),
                  sg.Text('Projects Support', font=('Helvetica', 9))
              ],
              [
                  sg.Text('', size=(60, 1)),
                  sg.Button('',
                            key='paypal',
                            size=(12, 1),
                            font=('Helvetica', 9),
                            button_color=(sg.theme_background_color(),
                                          sg.theme_background_color()),
                            image_filename='paypal.png',
                            image_size=(80, 50),
                            image_subsample=2,
                            border_width=0)
              ],
              [
                  sg.Text('Please speak.(Wake word Alpha)',
                          font=('Comic sans ms', 8))
              ], [sg.Output(size=(80, 17), key='out')]]

    return sg.Window('Alpha',
                     location=(738, 268),
                     right_click_menu=right_click_menu).Layout(layout)