Merge pull request #242 from MikeTheWatchGuy/Dev-latest
Button clicks return key instead of button text if key is present
This commit is contained in:
commit
719d5dbd2c
|
@ -901,6 +901,9 @@ class Button(Element):
|
||||||
def ButtonPressCallBack(self, parm):
|
def ButtonPressCallBack(self, parm):
|
||||||
r, c = self.Position
|
r, c = self.Position
|
||||||
self.ParentForm.LastButtonClickedWasRealtime = True
|
self.ParentForm.LastButtonClickedWasRealtime = True
|
||||||
|
if self.Key is not None:
|
||||||
|
self.ParentForm.LastButtonClicked = self.Key
|
||||||
|
else:
|
||||||
self.ParentForm.LastButtonClicked = self.ButtonText
|
self.ParentForm.LastButtonClicked = self.ButtonText
|
||||||
|
|
||||||
# ------- Button Callback ------- #
|
# ------- Button Callback ------- #
|
||||||
|
@ -957,6 +960,9 @@ class Button(Element):
|
||||||
# first, get the results table built
|
# first, get the results table built
|
||||||
# modify the Results table in the parent FlexForm object
|
# modify the Results table in the parent FlexForm object
|
||||||
r,c = self.Position
|
r,c = self.Position
|
||||||
|
if self.Key is not None:
|
||||||
|
self.ParentForm.LastButtonClicked = self.Key
|
||||||
|
else:
|
||||||
self.ParentForm.LastButtonClicked = self.ButtonText
|
self.ParentForm.LastButtonClicked = self.ButtonText
|
||||||
self.ParentForm.FormRemainedOpen = False
|
self.ParentForm.FormRemainedOpen = False
|
||||||
# if the form is tabbed, must collect all form's results and destroy all forms
|
# if the form is tabbed, must collect all form's results and destroy all forms
|
||||||
|
@ -971,6 +977,9 @@ class Button(Element):
|
||||||
elif self.BType == BUTTON_TYPE_READ_FORM: # LEAVE THE WINDOW OPEN!! DO NOT CLOSE
|
elif self.BType == BUTTON_TYPE_READ_FORM: # LEAVE THE WINDOW OPEN!! DO NOT CLOSE
|
||||||
# first, get the results table built
|
# first, get the results table built
|
||||||
# modify the Results table in the parent FlexForm object
|
# modify the Results table in the parent FlexForm object
|
||||||
|
if self.Key is not None:
|
||||||
|
self.ParentForm.LastButtonClicked = self.Key
|
||||||
|
else:
|
||||||
self.ParentForm.LastButtonClicked = self.ButtonText
|
self.ParentForm.LastButtonClicked = self.ButtonText
|
||||||
self.ParentForm.FormRemainedOpen = True
|
self.ParentForm.FormRemainedOpen = True
|
||||||
self.ParentForm.TKroot.quit() # kick the users out of the mainloop
|
self.ParentForm.TKroot.quit() # kick the users out of the mainloop
|
||||||
|
|
Loading…
Reference in New Issue