Added theme_add_new, added Multiline write_only parm
This commit is contained in:
parent
110e5a0daf
commit
2684d7834a
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue