def PlayerChooseSongGUI(self): # ---------------------- DEFINION OF CHOOSE WHAT TO PLAY GUI ---------------------------- layout = [[ sg.Text('MIDI File Player', font=("Helvetica", 15), size=(20, 1), text_color='green') ], [sg.Text('File Selection', font=("Helvetica", 15), size=(20, 1))], [ sg.Text('Single File Playback', justification='right'), sg.InputText(size=(65, 1), key='midifile'), sg.FileBrowse(size=(10, 1), file_types=(("MIDI files", "*.mid"), )) ], [ sg.Text('Or Batch Play From This Folder', auto_size_text=False, justification='right'), sg.InputText(size=(65, 1), key='folder'), sg.FolderBrowse(size=(10, 1)) ], [sg.Text('_' * 250, auto_size_text=False, size=(100, 1))], [ sg.Text('Choose MIDI Output Device', size=(22, 1)), sg.Listbox(values=self.PortList, size=(30, len(self.PortList) + 1), key='device') ], [sg.Text('_' * 250, auto_size_text=False, size=(100, 1))], [ sg.SimpleButton('PLAY', size=(12, 2), button_color=('red', 'white'), font=("Helvetica", 15), bind_return_key=True), sg.Text(' ' * 2, size=(4, 1)), sg.Cancel(size=(8, 2), font=("Helvetica", 15)) ]] window = sg.Window('MIDI File Player', auto_size_text=False, default_element_size=(30, 1), font=("Helvetica", 12)).Layout(layout) self.Window = window return window.Read()
orientation='v', size=(5, 20), default_value=75), sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10), sg.Column(column1, background_color='#F7F3EC') ]]) ], [sg.Text('_' * 80)], [sg.Text('Choose A Folder', size=(35, 1))], [ sg.Text('Your Folder', size=(15, 1), auto_size_text=False, justification='right'), sg.InputText('Default Folder'), sg.FolderBrowse() ], [sg.Submit(tooltip='Click to submit this form'), sg.Cancel()] ] window = sg.Window('Everything bagel', default_element_size=(40, 1), grab_anywhere=False).Layout(layout) button, values = window.Read() sg.Popup('Title', 'The results of the window.', 'The button clicked was "{}"'.format(button), 'The values are', values)
frm_plugins = sg.InputText("", size=(60, 2), key="plugin-dir", do_not_clear=True) frm_more = sg.InputText("", key="add-args", size=(60, 2), do_not_clear=True) form = sg.FlexForm("Nuitka Standalone EXE Generation") compile_to = pscript = icon_file = "" layout = [ [ sg.Text("Python Script:", size=(13, 1)), sg.InputText("", key="py-file", do_not_clear=True), sg.FileBrowse(button_text="...", file_types=(("Python Files", "*.py*"),)), ], [ sg.Text("Output Folder:", size=(13, 1)), frm_output, sg.FolderBrowse(button_text="..."), ], [sg.Text("Icon File:", size=(13, 1)), frm_icon, sg.FileBrowse(button_text="...")], [ sg.Text("App control:", size=(15, 1)), sg.Checkbox("Use Console", default=True, key="use-console"), sg.Checkbox("Tk Support", default=False, key="tk-support"), sg.Checkbox("Qt Support", default=False, key="qt-support"), sg.Checkbox("Numpy Support", default=False, key="np-support"), ], [ sg.Text("Output control:", size=(15, 1)), sg.Checkbox("Remove <.build> folder", default=True, key="remove-build"), sg.Checkbox("Use UPX-Packer", default=False, key="compress"), ], [
# Workbook vars cwd = os.getcwd() # template = os.path.join(cwd + '\\template', 'Clarity_BOM_Template.xlsx') template = os.path.join(cwd, 'Clarity_BOM_Template.xlsx') wb = load_workbook(filename=template) ws = wb['Sheet1'] # sg initialization interpreter = executable path_to_interpreter = path.dirname(interpreter) sitepkg = path_to_interpreter + "\\site-packages" addsitedir(sitepkg) import arcpy # Apparently need to put the import arcpy statement after the sg initialization for desktop app to work. gui = [[sg.Text('Input GDB', size=(20, 1)), sg.InputText(size=(70, 1)), sg.FolderBrowse()], [sg.Text('BOM Output Location:', size=(20, 1)), sg.InputText(size=(70, 1)), sg.FolderBrowse()], [sg.Text('OLT(s) Comma Separated:', size=(20, 1)), sg.InputText(size=(70, 1))], [sg.Submit(), sg.Exit()]] window = sg.Window('Clarity BOM (Simplified)').Layout(gui) scratchExists = os.path.exists(os.path.join(r'C:\Users', getpass.getuser(), 'Documents', 'ArcGIS','scratch.gdb')) if scratchExists == False: arcpy.CreateFileGDB_management(os.path.join(r'C:\Users', getpass.getuser(), 'Documents', 'ArcGIS'), 'scratch.gdb') else: pass scratch = os.path.join(r'C:\Users', getpass.getuser(), 'Documents', 'ArcGIS','scratch.gdb') ################################################################## def clear_scratch():
def Everything(): sg.ChangeLookAndFeel('TanBlue') column1 = [[ sg.Text('Column 1', background_color=sg.DEFAULT_BACKGROUND_COLOR, justification='center', size=(10, 1)) ], [ sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 1', key='spin1') ], [ sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 2', key='spin2') ], [ sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 3', key='spin3') ]] layout = [ [ sg.Text('All graphic widgets in one form!', size=(30, 1), font=("Helvetica", 25)) ], [sg.Text('Here is some text.... and a place to enter text')], [sg.InputText('This is my text', key='in1', do_not_clear=True)], [ sg.Checkbox('Checkbox', key='cb1'), sg.Checkbox('My second checkbox!', key='cb2', default=True) ], [ sg.Radio('My first Radio! ', "RADIO1", key='rad1', default=True), sg.Radio('My second Radio!', "RADIO1", key='rad2') ], [ sg.Multiline( default_text= 'This is the default Text should you decide not to type anything', size=(35, 3), key='multi1', do_not_clear=True), sg.Multiline(default_text='A second multi-line', size=(35, 3), key='multi2', do_not_clear=True) ], [ sg.InputCombo(('Combobox 1', 'Combobox 2'), key='combo', size=(20, 1)), sg.Slider(range=(1, 100), orientation='h', size=(34, 20), key='slide1', default_value=85) ], [ sg.InputOptionMenu( ('Menu Option 1', 'Menu Option 2', 'Menu Option 3'), key='optionmenu') ], [ sg.Listbox(values=('Listbox 1', 'Listbox 2', 'Listbox 3'), size=(30, 3), key='listbox'), sg.Slider( range=(1, 100), orientation='v', size=(5, 20), default_value=25, key='slide2', ), sg.Slider( range=(1, 100), orientation='v', size=(5, 20), default_value=75, key='slide3', ), sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10, key='slide4'), sg.Column(column1, background_color='gray34') ], [sg.Text('_' * 80)], [sg.Text('Choose A Folder', size=(35, 1))], [ sg.Text('Your Folder', size=(15, 1), auto_size_text=False, justification='right'), sg.InputText('Default Folder', key='folder', do_not_clear=True), sg.FolderBrowse() ], [ sg.ReadButton('Exit'), sg.Text(' ' * 40), sg.ReadButton('SaveSettings'), sg.ReadButton('LoadSettings') ] ] window = sg.Window('Form Fill Demonstration', default_element_size=(40, 1), grab_anywhere=False) # button, values = window.LayoutAndRead(layout, non_blocking=True) window.Layout(layout) while True: button, values = window.Read() if button is 'SaveSettings': filename = sg.PopupGetFile('Save Settings', save_as=True, no_window=True) window.SaveToDisk(filename) # save(values) elif button is 'LoadSettings': filename = sg.PopupGetFile('Load Settings', no_window=True) window.LoadFromDisk(filename) # load(form) elif button in ['Exit', None]: break