Merge pull request #571 from MikeTheWatchGuy/Dev-latest
SHORTCUT BUTTONS no longer closes window, Removed "Default Value" for…
This commit is contained in:
commit
c46b3144f9
|
@ -1174,7 +1174,7 @@ class Button(Element):
|
||||||
def __init__(self, button_text='', button_type=BUTTON_TYPE_CLOSES_WIN, target=(None, None), tooltip=None,
|
def __init__(self, button_text='', button_type=BUTTON_TYPE_CLOSES_WIN, target=(None, None), tooltip=None,
|
||||||
file_types=(("ALL Files", "*.*"),), initial_folder=None, disabled=False, image_filename=None,
|
file_types=(("ALL Files", "*.*"),), initial_folder=None, disabled=False, image_filename=None,
|
||||||
image_data=None, image_size=(None, None), image_subsample=None, border_width=None, size=(None, None),
|
image_data=None, image_size=(None, None), image_subsample=None, border_width=None, size=(None, None),
|
||||||
auto_size_button=None, button_color=None, default_value=None, font=None, bind_return_key=False,
|
auto_size_button=None, button_color=None, font=None, bind_return_key=False,
|
||||||
focus=False, pad=None, key=None):
|
focus=False, pad=None, key=None):
|
||||||
'''
|
'''
|
||||||
Button Element
|
Button Element
|
||||||
|
@ -1215,7 +1215,6 @@ class Button(Element):
|
||||||
self.BindReturnKey = bind_return_key
|
self.BindReturnKey = bind_return_key
|
||||||
self.Focus = focus
|
self.Focus = focus
|
||||||
self.TKCal = None
|
self.TKCal = None
|
||||||
self.DefaultValue = default_value
|
|
||||||
self.InitialFolder = initial_folder
|
self.InitialFolder = initial_folder
|
||||||
self.Disabled = disabled
|
self.Disabled = disabled
|
||||||
|
|
||||||
|
@ -1354,8 +1353,7 @@ class Button(Element):
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def Update(self, text=None, button_color=(None, None), value=None, disabled=None, image_data=None,
|
def Update(self, text=None, button_color=(None, None), disabled=None, image_data=None, image_filename=None):
|
||||||
image_filename=None):
|
|
||||||
try:
|
try:
|
||||||
if text is not None:
|
if text is not None:
|
||||||
self.TKButton.configure(text=text)
|
self.TKButton.configure(text=text)
|
||||||
|
@ -1364,8 +1362,6 @@ class Button(Element):
|
||||||
self.TKButton.config(foreground=button_color[0], background=button_color[1])
|
self.TKButton.config(foreground=button_color[0], background=button_color[1])
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
if value is not None:
|
|
||||||
self.DefaultValue = value
|
|
||||||
if disabled == True:
|
if disabled == True:
|
||||||
self.TKButton['state'] = 'disabled'
|
self.TKButton['state'] = 'disabled'
|
||||||
elif disabled == False:
|
elif disabled == False:
|
||||||
|
@ -1662,6 +1658,7 @@ class Graph(Element):
|
||||||
def MoveFigure(self, figure, x_direction, y_direction):
|
def MoveFigure(self, figure, x_direction, y_direction):
|
||||||
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
|
zero_converted = self._convert_xy_to_canvas_xy(0, 0)
|
||||||
shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
|
shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
|
||||||
|
shift_converted = self._convert_xy_to_canvas_xy(x_direction, y_direction)
|
||||||
shift_amount = (shift_converted[0] - zero_converted[0], shift_converted[1] - zero_converted[1])
|
shift_amount = (shift_converted[0] - zero_converted[0], shift_converted[1] - zero_converted[1])
|
||||||
if figure is None:
|
if figure is None:
|
||||||
print('*** WARNING - Your figure is None. It most likely means your did not Finalize your Window ***')
|
print('*** WARNING - Your figure is None. It most likely means your did not Finalize your Window ***')
|
||||||
|
@ -3152,7 +3149,7 @@ def SaveAs(button_text='Save As...', target=(ThisRow, -1), file_types=(("ALL Fil
|
||||||
# ------------------------- SAVE BUTTON Element lazy function ------------------------- #
|
# ------------------------- SAVE BUTTON Element lazy function ------------------------- #
|
||||||
def Save(button_text='Save', size=(None, None), auto_size_button=None, button_color=None, bind_return_key=True,
|
def Save(button_text='Save', size=(None, None), auto_size_button=None, button_color=None, bind_return_key=True,
|
||||||
disabled=False, tooltip=None, font=None, focus=False, pad=None, key=None):
|
disabled=False, tooltip=None, font=None, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3160,7 +3157,7 @@ def Save(button_text='Save', size=(None, None), auto_size_button=None, button_co
|
||||||
# ------------------------- SUBMIT BUTTON Element lazy function ------------------------- #
|
# ------------------------- SUBMIT BUTTON Element lazy function ------------------------- #
|
||||||
def Submit(button_text='Submit', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
def Submit(button_text='Submit', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
||||||
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3169,7 +3166,7 @@ def Submit(button_text='Submit', size=(None, None), auto_size_button=None, butto
|
||||||
# ------------------------- OPEN BUTTON Element lazy function ------------------------- #
|
# ------------------------- OPEN BUTTON Element lazy function ------------------------- #
|
||||||
def Open(button_text='Open', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
def Open(button_text='Open', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
||||||
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3177,7 +3174,7 @@ def Open(button_text='Open', size=(None, None), auto_size_button=None, button_co
|
||||||
# ------------------------- OK BUTTON Element lazy function ------------------------- #
|
# ------------------------- OK BUTTON Element lazy function ------------------------- #
|
||||||
def OK(button_text='OK', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
def OK(button_text='OK', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
||||||
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3185,7 +3182,7 @@ def OK(button_text='OK', size=(None, None), auto_size_button=None, button_color=
|
||||||
# ------------------------- YES BUTTON Element lazy function ------------------------- #
|
# ------------------------- YES BUTTON Element lazy function ------------------------- #
|
||||||
def Ok(button_text='Ok', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
def Ok(button_text='Ok', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
||||||
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
bind_return_key=True, tooltip=None, font=None, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3193,7 +3190,7 @@ def Ok(button_text='Ok', size=(None, None), auto_size_button=None, button_color=
|
||||||
# ------------------------- CANCEL BUTTON Element lazy function ------------------------- #
|
# ------------------------- CANCEL BUTTON Element lazy function ------------------------- #
|
||||||
def Cancel(button_text='Cancel', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
def Cancel(button_text='Cancel', size=(None, None), auto_size_button=None, button_color=None, disabled=False,
|
||||||
tooltip=None, font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
tooltip=None, font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3201,7 +3198,7 @@ def Cancel(button_text='Cancel', size=(None, None), auto_size_button=None, butto
|
||||||
# ------------------------- QUIT BUTTON Element lazy function ------------------------- #
|
# ------------------------- QUIT BUTTON Element lazy function ------------------------- #
|
||||||
def Quit(button_text='Quit', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
def Quit(button_text='Quit', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
||||||
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3209,7 +3206,7 @@ def Quit(button_text='Quit', size=(None, None), auto_size_button=None, button_co
|
||||||
# ------------------------- Exit BUTTON Element lazy function ------------------------- #
|
# ------------------------- Exit BUTTON Element lazy function ------------------------- #
|
||||||
def Exit(button_text='Exit', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
def Exit(button_text='Exit', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
||||||
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3217,7 +3214,7 @@ def Exit(button_text='Exit', size=(None, None), auto_size_button=None, button_co
|
||||||
# ------------------------- YES BUTTON Element lazy function ------------------------- #
|
# ------------------------- YES BUTTON Element lazy function ------------------------- #
|
||||||
def Yes(button_text='Yes', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
def Yes(button_text='Yes', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
||||||
font=None, bind_return_key=True, focus=False, pad=None, key=None):
|
font=None, bind_return_key=True, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3225,7 +3222,7 @@ def Yes(button_text='Yes', size=(None, None), auto_size_button=None, button_colo
|
||||||
# ------------------------- NO BUTTON Element lazy function ------------------------- #
|
# ------------------------- NO BUTTON Element lazy function ------------------------- #
|
||||||
def No(button_text='No', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
def No(button_text='No', size=(None, None), auto_size_button=None, button_color=None, disabled=False, tooltip=None,
|
||||||
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
font=None, bind_return_key=False, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
@ -3233,7 +3230,7 @@ def No(button_text='No', size=(None, None), auto_size_button=None, button_color=
|
||||||
# ------------------------- NO BUTTON Element lazy function ------------------------- #
|
# ------------------------- NO BUTTON Element lazy function ------------------------- #
|
||||||
def Help(button_text='Help', size=(None, None), auto_size_button=None, button_color=None, disabled=False, font=None,
|
def Help(button_text='Help', size=(None, None), auto_size_button=None, button_color=None, disabled=False, font=None,
|
||||||
tooltip=None, bind_return_key=False, focus=False, pad=None, key=None):
|
tooltip=None, bind_return_key=False, focus=False, pad=None, key=None):
|
||||||
return Button(button_text=button_text, button_type=BUTTON_TYPE_CLOSES_WIN, tooltip=tooltip, size=size,
|
return Button(button_text=button_text, button_type=BUTTON_TYPE_READ_FORM, tooltip=tooltip, size=size,
|
||||||
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
auto_size_button=auto_size_button, button_color=button_color, font=font, disabled=disabled,
|
||||||
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
bind_return_key=bind_return_key, focus=focus, pad=pad, key=key)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue