Merge pull request #794 from MikeTheWatchGuy/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2018-11-26 08:51:49 -05:00 committed by GitHub
commit 8aa7a9f8ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View File

@ -5325,12 +5325,12 @@ def EasyPrintClose():
# ======================== Scrolled Text Box =====#
# ===================================================#
def PopupScrolled(*args, button_color=None, yes_no=False, auto_close=False, auto_close_duration=None,
size=(None, None)):
size=(None, None), location=(None, None)):
if not args: return
width, height = size
width = width if width else MESSAGE_BOX_LINE_WIDTH
form = Window(args[0], auto_size_text=True, button_color=button_color, auto_close=auto_close,
auto_close_duration=auto_close_duration)
auto_close_duration=auto_close_duration, location=location)
max_line_total, max_line_width, total_lines, height_computed = 0, 0, 0, 0
complete_output = ''
for message in args:

View File

@ -50,7 +50,7 @@ def TimerStop():
g_time_end = time.time()
g_time_delta = g_time_end - g_time_start
print(g_time_delta)
print(int(g_time_delta*1000))
"""
@ -2221,12 +2221,13 @@ class TkScrollableFrame(tk.Frame):
class Column(Element):
def __init__(self, layout, background_color=None, size=(None, None), pad=None, scrollable=False, vertical_scroll_only=False, key=None):
'''
Column Element
Container for elements that are stacked into rows
:param layout:
:param background_color:
:param size:
:param pad:
:param scrollable:
:param vertical_scroll_only:
:param key:
'''
self.UseDictionary = False
@ -2239,10 +2240,6 @@ class Column(Element):
self.TKFrame = None
self.Scrollable = scrollable
self.VerticalScrollOnly = vertical_scroll_only
# self.ImageFilename = image_filename
# self.ImageData = image_data
# self.ImageSize = image_size
# self.ImageSubsample = image_subsample
bg = background_color if background_color is not None else DEFAULT_BACKGROUND_COLOR
self.Layout(layout)
@ -2803,6 +2800,7 @@ class ErrorElement(Element):
def __del__(self):
super().__del__()
Stretch = ErrorElement
# ------------------------------------------------------------------------- #
# Window CLASS #
@ -2816,13 +2814,14 @@ class Window(object):
alpha_channel=1, return_keyboard_events=False, use_default_focus=True, text_justification=None,
no_titlebar=False, grab_anywhere=False, keep_on_top=False, resizable=False, disable_close=False):
'''
Window
Main window object where Elements will be laid out in rows
:param title:
:param default_element_size:
:param default_button_element_size:
:param auto_size_text:
:param auto_size_buttons:
:param location:
:param size:
:param button_color:
:param font:
:param progress_bar_color:
@ -2832,6 +2831,7 @@ class Window(object):
:param auto_close_duration:
:param icon:
:param force_toplevel:
:param alpha_channel:
:param return_keyboard_events:
:param use_default_focus:
:param text_justification:
@ -2839,6 +2839,7 @@ class Window(object):
:param grab_anywhere:
:param keep_on_top:
:param resizable:
:param disable_close:
'''
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT
self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS
@ -3152,6 +3153,9 @@ class Window(object):
return ErrorElement(key=key)
return element
Element = FindElement # Shortcut function
def FindElementWithFocus(self):
element = _FindElementWithFocusInSubForm(self)
return element
@ -5416,10 +5420,12 @@ def PopupScrolled(*args, **_3to2kwargs):
if yes_no:
form.AddRow(Text('', size=(pad, 1), auto_size_text=False), Yes(), No())
button, values = form.Read()
form.Close()
return button
else:
form.AddRow(Text('', size=(pad, 1), auto_size_text=False), Button('OK', size=(5, 1), button_color=button_color))
button, values = form.Read()
form.Close()
return button