Merge pull request #145 from MikeTheWatchGuy/Dev-latest

Sized controls to fit 1280x720 video
This commit is contained in:
MikeTheWatchGuy 2018-09-06 20:29:48 -04:00 committed by GitHub
commit 86062583c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -12,6 +12,7 @@ a temp file. Clearly... clearly... this is not the optimal solution and one is
Until then enjoy it working somewhat slowly. Until then enjoy it working somewhat slowly.
""" """
def main(): def main():
filename = sg.PopupGetFile('Filename to play') filename = sg.PopupGetFile('Filename to play')
if filename is None: if filename is None:
@ -24,10 +25,10 @@ def main():
sg.ChangeLookAndFeel('Dark') sg.ChangeLookAndFeel('Dark')
# define the form layout # define the form layout
layout = [[sg.Text('OpenCV Demo', size=(40, 1), justification='center', font='Helvetica 20')], layout = [[sg.Text('OpenCV Demo', size=(15, 1),pad=((510,0),3), justification='center', font='Helvetica 20')],
[sg.Image(filename='', key='image')], [sg.Image(filename='', key='image')],
[sg.Slider(range=(0, num_frames), size=(60, 10), orientation='h', key='slider')], [sg.Slider(range=(0, num_frames), size=(115, 10), orientation='h', key='slider')],
[sg.ReadFormButton('Exit', size=(10, 2), pad=((280, 0), 3), font='Helvetica 14')]] [sg.ReadFormButton('Exit', size=(10, 2), pad=((600, 0), 3), font='Helvetica 14')]]
# create the form and show it without the plot # create the form and show it without the plot
form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True) form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True)

View File

@ -1422,7 +1422,7 @@ class FlexForm:
''' '''
Display a user defined for and return the filled in data Display a user defined for and return the filled in data
''' '''
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False): def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=True):
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT 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 self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS
self.Title = title self.Title = title
@ -1463,6 +1463,7 @@ class FlexForm:
self.LastKeyboardEvent = None self.LastKeyboardEvent = None
self.TextJustification = text_justification self.TextJustification = text_justification
self.NoTitleBar = no_titlebar self.NoTitleBar = no_titlebar
self.GrabAnywhere = grab_anywhere
# ------------------------- Add ONE Row to Form ------------------------- # # ------------------------- Add ONE Row to Form ------------------------- #
def AddRow(self, *args): def AddRow(self, *args):
@ -2636,7 +2637,7 @@ def StartupTK(my_flex_form):
my_flex_form.TKroot = root my_flex_form.TKroot = root
# Make moveable window # Make moveable window
if my_flex_form.NoTitleBar: if my_flex_form.NoTitleBar or my_flex_form.GrabAnywhere:
root.bind("<ButtonPress-1>", my_flex_form.StartMove) root.bind("<ButtonPress-1>", my_flex_form.StartMove)
root.bind("<ButtonRelease-1>", my_flex_form.StopMove) root.bind("<ButtonRelease-1>", my_flex_form.StopMove)
root.bind("<B1-Motion>", my_flex_form.OnMotion) root.bind("<B1-Motion>", my_flex_form.OnMotion)