More changes to Radio Buttons
This commit is contained in:
parent
0a1dabe636
commit
c9d7c9c425
|
@ -893,7 +893,7 @@ class Radio(Element):
|
||||||
self.Disabled = disabled
|
self.Disabled = disabled
|
||||||
self.TextColor = text_color or DEFAULT_TEXT_COLOR
|
self.TextColor = text_color or DEFAULT_TEXT_COLOR
|
||||||
self.ChangeSubmits = change_submits or enable_events
|
self.ChangeSubmits = change_submits or enable_events
|
||||||
|
self.EncodedRadioValue = None
|
||||||
super().__init__(ELEM_TYPE_INPUT_RADIO, size=size, auto_size_text=auto_size_text, font=font,
|
super().__init__(ELEM_TYPE_INPUT_RADIO, size=size, auto_size_text=auto_size_text, font=font,
|
||||||
background_color=background_color, text_color=self.TextColor, key=key, pad=pad,
|
background_color=background_color, text_color=self.TextColor, key=key, pad=pad,
|
||||||
tooltip=tooltip, visible=visible)
|
tooltip=tooltip, visible=visible)
|
||||||
|
@ -4460,7 +4460,8 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
|
||||||
value = (value != 0)
|
value = (value != 0)
|
||||||
elif element.Type == ELEM_TYPE_INPUT_RADIO:
|
elif element.Type == ELEM_TYPE_INPUT_RADIO:
|
||||||
RadVar = element.TKIntVar.get()
|
RadVar = element.TKIntVar.get()
|
||||||
this_rowcol = EncodeRadioRowCol(element.ParentForm.ContainerElemementNumber, row_num, col_num)
|
this_rowcol = EncodeRadioRowCol(form.ContainerElemementNumber, row_num, col_num)
|
||||||
|
# this_rowcol = element.EncodedRadioValue # could use the saved one
|
||||||
value = RadVar == this_rowcol
|
value = RadVar == this_rowcol
|
||||||
elif element.Type == ELEM_TYPE_BUTTON:
|
elif element.Type == ELEM_TYPE_BUTTON:
|
||||||
if top_level_form.LastButtonClicked == element.ButtonText:
|
if top_level_form.LastButtonClicked == element.ButtonText:
|
||||||
|
@ -5386,11 +5387,13 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
element.TKProgressBar.TKProgressBarForReal.pack_forget()
|
element.TKProgressBar.TKProgressBarForReal.pack_forget()
|
||||||
# ------------------------- RADIO BUTTON element ------------------------- #
|
# ------------------------- RADIO BUTTON element ------------------------- #
|
||||||
elif element_type == ELEM_TYPE_INPUT_RADIO:
|
elif element_type == ELEM_TYPE_INPUT_RADIO:
|
||||||
|
element = element # type: Radio
|
||||||
width = 0 if auto_size_text else element_size[0]
|
width = 0 if auto_size_text else element_size[0]
|
||||||
default_value = element.InitialState
|
default_value = element.InitialState
|
||||||
ID = element.GroupID
|
ID = element.GroupID
|
||||||
# see if ID has already been placed
|
# see if ID has already been placed
|
||||||
value = EncodeRadioRowCol(form.ContainerElemementNumber, row_num, col_num) # value to set intvar to if this radio is selected
|
value = EncodeRadioRowCol(form.ContainerElemementNumber, row_num, col_num) # value to set intvar to if this radio is selected
|
||||||
|
element.EncodedRadioValue = value
|
||||||
if ID in toplevel_form.RadioDict:
|
if ID in toplevel_form.RadioDict:
|
||||||
RadVar = toplevel_form.RadioDict[ID]
|
RadVar = toplevel_form.RadioDict[ID]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue