Merge pull request #3162 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
PySimpleGUI 2020-07-18 19:53:19 -04:00 committed by GitHub
commit 141df2b778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 622 additions and 152 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
#usr/bin/python3 #usr/bin/python3
version = __version__ = "0.39.0.4 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image" version = __version__ = "0.39.0.5 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image, added theme_add_new"
port = 'PySimpleGUIWeb' port = 'PySimpleGUIWeb'
@ -1544,7 +1544,7 @@ class SuperImage(remi.gui.Image):
self.load(image) self.load(image)
def load(self, file_path_name): def load(self, file_path_name):
if type(file_path_name) is bytes or len(file_path_name) > 200: if type(file_path_name) is bytes:
try: try:
#here a base64 image is received #here a base64 image is received
self.imagedata = base64.b64decode(file_path_name, validate=True) self.imagedata = base64.b64decode(file_path_name, validate=True)
@ -2309,6 +2309,9 @@ class Column(Element):
layout = Layout layout = Layout
Col = Column
# ---------------------------------------------------------------------- # # ---------------------------------------------------------------------- #
# Menu # # Menu #
# ---------------------------------------------------------------------- # # ---------------------------------------------------------------------- #
@ -7261,6 +7264,22 @@ def theme_list():
return list_of_look_and_feel_values() return list_of_look_and_feel_values()
def theme_add_new(new_theme_name, new_theme_dict):
"""
Add a new theme to the dictionary of themes
:param new_theme_name: text to display in element
:type new_theme_name: (str)
:param new_theme_dict: text to display in element
:type new_theme_dict: (dict)
"""
global LOOK_AND_FEEL_TABLE
try:
LOOK_AND_FEEL_TABLE[new_theme_name] = new_theme_dict
except Exception as e:
print('Exception during adding new theme {}'.format(e))
def theme_previewer(columns=12): def theme_previewer(columns=12):
""" """
Show a window with all of the color themes - takes a while so be patient Show a window with all of the color themes - takes a while so be patient

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "0.17.1.4 Unreleased\n VSeparator added (spelling error), Radio.reset_group added and removed the clearing all when one cleared, added default key for one_line_progress_meter, auto-add keys to tables & trees" version = __version__ = "0.17.1.5 Unreleased\n VSeparator added (spelling error), Radio.reset_group added and removed the clearing all when one cleared, added default key for one_line_progress_meter, auto-add keys to tables & trees, added theme_add_new"
port = 'PySimpleGUIWx' port = 'PySimpleGUIWx'
@ -955,7 +955,7 @@ class Spin(Element):
class Multiline(Element): class Multiline(Element):
def __init__(self, default_text='', enter_submits=False, disabled=False, autoscroll=False, size=(None, None), def __init__(self, default_text='', enter_submits=False, disabled=False, autoscroll=False, size=(None, None),
auto_size_text=None, background_color=None, text_color=None, change_submits=False, enable_events=False, do_not_clear=True, auto_size_text=None, background_color=None, text_color=None, change_submits=False, enable_events=False, do_not_clear=True,
key=None, focus=False, font=None, pad=None, tooltip=None, visible=True, size_px=(None,None)): key=None, write_only=False, focus=False, font=None, pad=None, tooltip=None, visible=True, size_px=(None,None)):
''' '''
Multiline Element Multiline Element
:param default_text: :param default_text:
@ -982,6 +982,7 @@ class Multiline(Element):
self.Autoscroll = autoscroll self.Autoscroll = autoscroll
self.Disabled = disabled self.Disabled = disabled
self.ChangeSubmits = change_submits or enable_events self.ChangeSubmits = change_submits or enable_events
self.WriteOnly = write_only
self.Widget = self.WxTextCtrl = None self.Widget = self.WxTextCtrl = None
@ -4001,6 +4002,8 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
except: except:
value = 0 value = 0
elif element.Type == ELEM_TYPE_INPUT_MULTILINE: elif element.Type == ELEM_TYPE_INPUT_MULTILINE:
if element.WriteOnly:
continue
try: try:
value = element.WxTextCtrl.GetValue() value = element.WxTextCtrl.GetValue()
except: except:
@ -7135,6 +7138,23 @@ def theme_list():
return list_of_look_and_feel_values() return list_of_look_and_feel_values()
def theme_add_new(new_theme_name, new_theme_dict):
"""
Add a new theme to the dictionary of themes
:param new_theme_name: text to display in element
:type new_theme_name: (str)
:param new_theme_dict: text to display in element
:type new_theme_dict: (dict)
"""
global LOOK_AND_FEEL_TABLE
try:
LOOK_AND_FEEL_TABLE[new_theme_name] = new_theme_dict
except Exception as e:
print('Exception during adding new theme {}'.format(e))
def theme_previewer(columns=12): def theme_previewer(columns=12):
""" """
Show a window with all of the color themes - takes a while so be patient Show a window with all of the color themes - takes a while so be patient