commit
ad8224ff1a
|
@ -1,23 +1,5 @@
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
|
||||||
element_list = ('Text',
|
|
||||||
'InputText',
|
|
||||||
'CheckBox',
|
|
||||||
'RadioButton',
|
|
||||||
'Listbox',
|
|
||||||
'Slider',
|
|
||||||
'Multiline',
|
|
||||||
'Output',
|
|
||||||
'ProgressBar',
|
|
||||||
'OptionMenu',
|
|
||||||
'Menu',
|
|
||||||
'Frame',
|
|
||||||
'Column',
|
|
||||||
'Graph',
|
|
||||||
'Image',
|
|
||||||
'Table',
|
|
||||||
'Tab',
|
|
||||||
'TabGroup')
|
|
||||||
|
|
||||||
desc_text = """
|
desc_text = """
|
||||||
Text( text
|
Text( text
|
||||||
|
@ -31,7 +13,10 @@ Text( text
|
||||||
justification=None
|
justification=None
|
||||||
pad=None
|
pad=None
|
||||||
key=None
|
key=None
|
||||||
tooltip=None)"""
|
tooltip=None)
|
||||||
|
|
||||||
|
Shortcuts: Txt, T
|
||||||
|
"""
|
||||||
|
|
||||||
desc_inputtext = """
|
desc_inputtext = """
|
||||||
InputText( default_text =''
|
InputText( default_text =''
|
||||||
|
@ -47,10 +32,59 @@ InputText( default_text =''
|
||||||
key=None
|
key=None
|
||||||
focus=False
|
focus=False
|
||||||
pad=None)
|
pad=None)
|
||||||
|
|
||||||
|
Shortcuts: In, Input
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
desc_inputcombo = """
|
||||||
|
InputCombo( values
|
||||||
|
default_value=None
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
change_submits=False
|
||||||
|
disabled=False
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
|
|
||||||
|
Shortcuts: Combo, DropDown, Drop
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_inputoptionmenu = """
|
||||||
|
InputOptionMenu(values
|
||||||
|
default_value=None
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
|
|
||||||
|
Shortcuts: OptionMenu
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_listbox = """
|
||||||
|
Listbox(values
|
||||||
|
default_values=None
|
||||||
|
select_mode=None
|
||||||
|
change_submits=False
|
||||||
|
bind_return_key=False
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
font=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
desc_checkbox = """
|
desc_checkbox = """
|
||||||
CheckBox( text,
|
CheckBox( text
|
||||||
default=False
|
default=False
|
||||||
size=(None, None)
|
size=(None, None)
|
||||||
auto_size_text=None
|
auto_size_text=None
|
||||||
|
@ -61,14 +95,314 @@ CheckBox( text,
|
||||||
key=None
|
key=None
|
||||||
pad=None
|
pad=None
|
||||||
tooltip=None)
|
tooltip=None)
|
||||||
|
|
||||||
|
Shortcuts: CB, CBox, Check
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_radio = """
|
||||||
|
Radio( text
|
||||||
|
group_id
|
||||||
|
default=False
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
font=None
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_spin = """
|
||||||
|
Spin( values
|
||||||
|
initial_value=None
|
||||||
|
change_submits=False
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
font=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
descriptions = {'Text':desc_text, 'InputText':desc_inputtext, 'CheckBox':desc_checkbox}
|
desc_multiline = """
|
||||||
|
MultiLine( default_text=''
|
||||||
|
enter_submits = False
|
||||||
|
autoscroll=False
|
||||||
|
size=(None,None)
|
||||||
|
auto_size_text=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
do_not_clear=False
|
||||||
|
key=None
|
||||||
|
focus=False
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_output = """
|
||||||
|
Output( size=(None, None)
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
pad=None
|
||||||
|
font=None
|
||||||
|
tooltip=None
|
||||||
|
key=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_button = """
|
||||||
|
Button( button_text=''
|
||||||
|
button_type=BUTTON_TYPE_CLOSES_WIN
|
||||||
|
target=(None, None)
|
||||||
|
tooltip=None
|
||||||
|
file_types=(("ALL Files", "*.*"),)
|
||||||
|
initial_folder=None
|
||||||
|
image_filename=None
|
||||||
|
image_size=(None, None)
|
||||||
|
image_subsample=None
|
||||||
|
border_width=None
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_button=None
|
||||||
|
button_color=None
|
||||||
|
default_value = None
|
||||||
|
font=None
|
||||||
|
bind_return_key=False
|
||||||
|
focus=False
|
||||||
|
pad=None
|
||||||
|
key=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_progressbar = """
|
||||||
|
ProgressBar(max_value
|
||||||
|
orientation=None
|
||||||
|
size=(None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
bar_color=(None, None)
|
||||||
|
style=None
|
||||||
|
border_width=None
|
||||||
|
relief=None
|
||||||
|
key=None
|
||||||
|
pad=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_image = """
|
||||||
|
Image( filename=None
|
||||||
|
data=None
|
||||||
|
size=(None, None)
|
||||||
|
pad=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_canvas = """
|
||||||
|
Canvas( canvas=None
|
||||||
|
background_color=None
|
||||||
|
size=(None, None)
|
||||||
|
pad=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_graph = """
|
||||||
|
Graph( canvas_size
|
||||||
|
graph_bottom_left
|
||||||
|
graph_top_right
|
||||||
|
background_color=None
|
||||||
|
pad=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_frame = """
|
||||||
|
Frame( title
|
||||||
|
layout
|
||||||
|
title_color=None
|
||||||
|
background_color=None
|
||||||
|
title_location=None
|
||||||
|
relief=DEFAULT_FRAME_RELIEF
|
||||||
|
size=(None, None)
|
||||||
|
font=None
|
||||||
|
pad=None
|
||||||
|
border_width=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_tab = """
|
||||||
|
Tab(title
|
||||||
|
layout
|
||||||
|
title_color=None
|
||||||
|
background_color=None
|
||||||
|
font=None
|
||||||
|
pad=None
|
||||||
|
disabled=False
|
||||||
|
border_width=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
desc_tabgroup = """
|
||||||
|
TabGroup( layout
|
||||||
|
tab_location=None
|
||||||
|
title_color=None
|
||||||
|
selected_title_color=None
|
||||||
|
background_color=None
|
||||||
|
font=None
|
||||||
|
change_submits=False
|
||||||
|
pad=None
|
||||||
|
border_width=None
|
||||||
|
theme=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
desc_slider = """
|
||||||
|
Slider( range=(None,None)
|
||||||
|
default_value=None
|
||||||
|
resolution=None
|
||||||
|
orientation=None
|
||||||
|
border_width=None
|
||||||
|
relief=None
|
||||||
|
change_submits=False
|
||||||
|
size=(None, None)
|
||||||
|
font=None
|
||||||
|
background_color=None
|
||||||
|
text_color=None
|
||||||
|
key=None
|
||||||
|
pad=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
desc_column = """
|
||||||
|
Column( layout
|
||||||
|
background_color = None
|
||||||
|
size=(None, None)
|
||||||
|
pad=None
|
||||||
|
scrollable=False
|
||||||
|
key=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_menu = """
|
||||||
|
Menu( menu_definition
|
||||||
|
background_color=None
|
||||||
|
size=(None, None)
|
||||||
|
tearoff=True
|
||||||
|
pad=None
|
||||||
|
key=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
desc_table = """
|
||||||
|
Table( values
|
||||||
|
headings=None
|
||||||
|
visible_column_map=None
|
||||||
|
col_widths=None
|
||||||
|
def_col_width=10
|
||||||
|
auto_size_columns=True
|
||||||
|
max_col_width=20
|
||||||
|
select_mode=None
|
||||||
|
display_row_numbers=False
|
||||||
|
scrollable=None
|
||||||
|
font=None
|
||||||
|
justification='right'
|
||||||
|
text_color=None
|
||||||
|
background_color=None
|
||||||
|
size=(None, None)
|
||||||
|
pad=None
|
||||||
|
key=None
|
||||||
|
tooltip=None)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_window = """
|
||||||
|
Window( title
|
||||||
|
default_element_size=DEFAULT_ELEMENT_SIZE
|
||||||
|
default_button_element_size = (None, None)
|
||||||
|
auto_size_text=None
|
||||||
|
auto_size_buttons=None
|
||||||
|
location=(None, None)
|
||||||
|
button_color=None
|
||||||
|
font=None
|
||||||
|
progress_bar_color=(None, None)
|
||||||
|
background_color=None
|
||||||
|
border_depth=None
|
||||||
|
auto_close=False
|
||||||
|
auto_close_duration=DEFAULT_AUTOCLOSE_TIME
|
||||||
|
icon=DEFAULT_WINDOW_ICON
|
||||||
|
force_toplevel = False
|
||||||
|
return_keyboard_events=False
|
||||||
|
use_default_focus=True
|
||||||
|
text_justification=None
|
||||||
|
no_titlebar=False
|
||||||
|
grab_anywhere=False
|
||||||
|
keep_on_top=False)
|
||||||
|
"""
|
||||||
|
|
||||||
|
desc_button_types = """
|
||||||
|
There are multiple button types / names to choose from
|
||||||
|
SimpleButton = Button
|
||||||
|
ReadFormButton = ReadButton = RButton
|
||||||
|
RealtimeButton
|
||||||
|
DummyButton
|
||||||
|
FolderBrowse
|
||||||
|
FileBrowse
|
||||||
|
FilesBrowse
|
||||||
|
FileSaveAs = SaveAs
|
||||||
|
CalendarButton
|
||||||
|
ColorChooserButton
|
||||||
|
Shortcuts - Normal buttons with predefined text
|
||||||
|
Save, Open, OK, Ok, Cancel, Quit, Exit, Yes, No, Help
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
element_list = ('Window',
|
||||||
|
'Text',
|
||||||
|
'InputText',
|
||||||
|
'CheckBox',
|
||||||
|
'RadioButton',
|
||||||
|
'Listbox',
|
||||||
|
'InputCombo',
|
||||||
|
'Slider',
|
||||||
|
'Multiline',
|
||||||
|
'Output',
|
||||||
|
'ProgressBar',
|
||||||
|
'OptionMenu',
|
||||||
|
'Menu',
|
||||||
|
'Frame',
|
||||||
|
'Column',
|
||||||
|
'Graph',
|
||||||
|
'Image',
|
||||||
|
'Table',
|
||||||
|
'Tab',
|
||||||
|
'TabGroup',
|
||||||
|
'Button Types')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
descriptions = {'Window':desc_window, 'Text':desc_text, 'InputText':desc_inputtext, 'CheckBox':desc_checkbox,
|
||||||
|
'RadioButton' : desc_radio, 'Listbox':desc_listbox, 'Slider':desc_slider, 'Multiline':desc_multiline,
|
||||||
|
'Output':desc_output,
|
||||||
|
'ProgressBar':desc_progressbar,
|
||||||
|
'OptionMenu':desc_inputoptionmenu,
|
||||||
|
'InputCombo':desc_inputcombo,
|
||||||
|
'Menu':desc_menu,
|
||||||
|
'Frame':desc_frame,
|
||||||
|
'Column': desc_column,
|
||||||
|
'Graph':desc_graph,
|
||||||
|
'Image':desc_image,
|
||||||
|
'Table':desc_table,
|
||||||
|
'Tab':desc_tab,
|
||||||
|
'TabGroup': desc_tabgroup,
|
||||||
|
'Button Types':desc_button_types}
|
||||||
|
|
||||||
layout = [[sg.Text('The PySimpleGUI SDK Quick Reference Guide',font='Any 15', relief=sg.RELIEF_RAISED)],
|
layout = [[sg.Text('The PySimpleGUI SDK Quick Reference Guide',font='Any 15', relief=sg.RELIEF_RAISED)],
|
||||||
[sg.Listbox(values=element_list, size=(15,len(element_list)), key='_in_', change_submits=True),
|
[sg.Listbox(values=element_list, size=(15,len(element_list)+2), key='_in_', change_submits=True, font=('Consolas 12')),
|
||||||
sg.Text(desc_text, size=(40,15),font=('Consolas 13'), text_color='darkblue', key='_out_')],
|
sg.Text(desc_text, size=(55,25),font=('Consolas 13'), text_color='darkblue', key='_out_')],
|
||||||
[sg.RButton('Read'), sg.Exit()]]
|
[sg.RButton('Read'), sg.Exit()]]
|
||||||
|
|
||||||
window = sg.Window('Window that stays open',
|
window = sg.Window('Window that stays open',
|
||||||
|
@ -83,4 +417,4 @@ while True:
|
||||||
desc = descriptions[element]
|
desc = descriptions[element]
|
||||||
except: desc = ''
|
except: desc = ''
|
||||||
window.FindElement('_out_').Update(desc)
|
window.FindElement('_out_').Update(desc)
|
||||||
print(button, values)
|
# print(button, values)
|
Loading…
Reference in New Issue