PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Radio Button Disabling  (Read 1706 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 290
    • View Profile
Radio Button Disabling
« on: August 23, 2018, 06:55:35 PM »
A couple of questions on this:
  • Is it possible to Disable or Enable an entire Radio Button group with one statement, other than setting the group up in Group Assignment and using *wingrp?
  • Is it possible to "uncheck" all of the Radio Buttons in a group once one of them has been selected?
Thanks!
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

James Zukowski

  • Diamond Member
  • *****
  • Posts: 290
    • View Profile
Re: Radio Button Disabling
« Reply #1 on: August 27, 2018, 09:55:39 AM »
Any insights?
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3773
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Radio Button Disabling
« Reply #2 on: August 27, 2018, 10:21:32 AM »
Regarding your questions:
  • The easiest way to disable/enable all radio buttons in a group is issue a DISABLE CONTROL nnn (or ENABLE CONTROL nnn) where nnn is the radio button CTL value. 
  • To uncheck try setting the 'Value$ property to ""

James Zukowski

  • Diamond Member
  • *****
  • Posts: 290
    • View Profile
Re: Radio Button Disabling
« Reply #3 on: August 27, 2018, 10:32:16 AM »
Mike:
The Enable/Disable Control works perfectly. Thanks!
The null assignment, however, not so much. Yes, it does clear the RB's, but it also throws Error #65.
I've also tried setting the 'ID to 0, but not apparent effect.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3773
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Radio Button Disabling
« Reply #4 on: August 27, 2018, 04:08:52 PM »
Setting the Value$ to "" seems to work for me.

Code: [Select]
print '4D','B?','CS',
rb=10
radio_button rb:1,@(10,10,10,1)="One"
radio_button rb:2,@(10,11,10,1)="Two"
radio_button rb:3,@(10,12,10,1)="Three"
button 11,@(10,14,10,2)="Reset"
while 1
obtain (0,siz=1)'ME',*,'MN'
if ctl=4 or eom=esc then break
print "Ctl ",ctl," received"
if ctl=11 then rb'value$=""
wend
I can select any of these buttons and then press the Reset to clear.

James Zukowski

  • Diamond Member
  • *****
  • Posts: 290
    • View Profile
Re: Radio Button Disabling
« Reply #5 on: August 27, 2018, 05:44:45 PM »
Your code worked here, too, so I took it even SLOOOOOOWer...

It turns out I was calling the reset routine twice: first when a Button is clicked, and again when the Tab exits. The first one worked fine (it had a valid value set). The second one failed (No longer a valid value, so it Errored). This has been corrected.

Thank you for your insistence! (And assistance!)
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services