Fix for window.FindElementWithForux - wasn't checking listboxes

This commit is contained in:
MikeTheWatchGuy 2019-08-16 11:26:36 -04:00
parent c4d149f5c3
commit 5b1f8cdbca
1 changed files with 8 additions and 30 deletions

View File

@ -3596,18 +3596,6 @@ class TabGroup(Element):
return element.Key return element.Key
return None return None
# def SelectTab(self, index):
# """
# Create a tkinter event that mimics user clicking on a tab. Must have called window.Finalize / Read first!
#
# :param index: (int) indicates which Tab should be selected. Count starts at 0
# """
#
# try:
# self.TKNotebook.select(index)
# except Exception as e:
# print('Exception Selecting Tab {}'.format(e))
#
def Get(self): def Get(self):
""" """
@ -3628,19 +3616,6 @@ class TabGroup(Element):
value = None value = None
return value return value
#
# def GetCurrentlySelectedTabIndex(self):
# """
# Returns the "index" of the currently selected tab in this TabGroup. Indexes start at 0. Returns None if there is an error.
#
# :return: Union[int, None] The index number of the currently selected tab or None if there was a problem
# """
# try:
# index = self.TKNotebook.index('current')
# except:
# index = None
# return index
def __del__(self): def __del__(self):
""" """ """ """
@ -5062,11 +5037,11 @@ class Window:
self.TransparentColor = transparent_color self.TransparentColor = transparent_color
self.UniqueKeyCounter = 0 self.UniqueKeyCounter = 0
self.DebuggerEnabled = debugger_enabled self.DebuggerEnabled = debugger_enabled
self.WasClosed = False
if type(title) != str: if type(title) != str:
warnings.warn('Your title is not a string. Are you passing in the right parameters?', UserWarning) warnings.warn('Your title is not a string. Are you passing in the right parameters?', UserWarning)
if layout is not None and type(layout) != list: if layout is not None and type(layout) not in (list, tuple):
warnings.warn('Your layout is not a list... this is not good!') warnings.warn('Your layout is not a list or tuple... this is not good!')
if layout is not None: if layout is not None:
self.Layout(layout) self.Layout(layout)
@ -7094,6 +7069,10 @@ def _FindElementWithFocusInSubForm(form):
if element.TKButton is not None: if element.TKButton is not None:
if element.TKButton is element.TKButton.focus_get(): if element.TKButton is element.TKButton.focus_get():
return element return element
if element.Type == ELEM_TYPE_INPUT_LISTBOX:
if element.Widget is not None:
if element.Widget is element.Widget.focus_get():
return element
return None return None
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
@ -9735,8 +9714,6 @@ def MsgBox(*args):
# ======================== Scrolled Text Box =====# # ======================== Scrolled Text Box =====#
# ===================================================# # ===================================================#
def PopupScrolled(*args, title=None, button_color=None, yes_no=False, auto_close=False, auto_close_duration=None, size=(None, None), def PopupScrolled(*args, title=None, button_color=None, yes_no=False, auto_close=False, auto_close_duration=None, size=(None, None),
@ -11144,6 +11121,7 @@ def main():
elif event == 'Normal': elif event == 'Normal':
window.Normal() window.Normal()
window.Element('_MENU_').Update(visible=False) window.Element('_MENU_').Update(visible=False)
print()
elif event == 'Popout': elif event == 'Popout':
show_debugger_popout_window() show_debugger_popout_window()
elif event == 'Launch Debugger': elif event == 'Launch Debugger':