PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Why does a disabled radio button not show which was selected?  (Read 3011 times)

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
I have noticed in PVX version 16 if I select a radio button and then disable the button it no longer shows that it was selected.  Is there a way to have it still show as selected once it is disabled?

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Why does a disabled radio button not show which was selected?
« Reply #1 on: July 16, 2019, 04:54:15 PM »
Dave,

I just tried this here and didn't have a problem (V16 and earlier)
Here is the test program I used.

0010 PRINT 'CS',
0020 PRINT '4D', ! Works with or without this
0030 LET RBT=10
0040 RADIO_BUTTON RBT:1,@(10,10,10,2)="Radio 1"
0050 RADIO_BUTTON RBT:2,@(10,12,10,2)="Radio 2"
0060 PRINT "Click either button and it will be disabled"
0070 WHILE 1
0080 OBTAIN (0)*
0090 IF CTL=4 OR EOM=ESC THEN BREAK
0100 IF CTL=RBT THEN RADIO_BUTTON READ RBT,X; DISABLE CONTROL RBT:X; PRINT X," Pressed"
0110 WEND


When I clicked a button it became disabled but still showed the fact the button had been selected.
Is it possible you are using Nomads and clearing/resetting the variable associated with the radio button which would cause Nomads to clear the setting when it refreshed the screen?
« Last Edit: July 16, 2019, 06:09:26 PM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

G Shauffenburg

  • Member
  • **
  • Posts: 5
    • View Profile
Re: Why does a disabled radio button not show which was selected?
« Reply #2 on: July 17, 2019, 07:31:03 AM »
Mike,

I just realized I posted the message as Dave instead of myself.  Yes, I am using nomads to create the panel, but I am using a call to "*wingrp" to disable the controls. The radio button also has the !16x16/Controls/Check_Box_Uncheck and !16x16/Controls/Check_Box bitmaps being used.  I have tried enabled just that control and then doing a disable control on it.  When it is enabled the selected button is checked.  When it is disable the check mark disappears.  It is because of the bitmaps?

Regards,

Graham Shauffenburg
« Last Edit: July 17, 2019, 07:34:34 AM by G Shauffenburg »

G Shauffenburg

  • Member
  • **
  • Posts: 5
    • View Profile
Re: Why does a disabled radio button not show which was selected?
« Reply #3 on: July 17, 2019, 07:32:52 AM »
Mike,

I just took the bitmap off and it works as in your sample code.  So it is definitely the bitmap that is causing my issue.

Regards,

Graham

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Why does a disabled radio button not show which was selected?
« Reply #4 on: July 18, 2019, 02:54:44 PM »
Hi Mike:

If you try this, you will see that the radio button doesn't stay:

0010 print 'CS',
0020 print '4D', ! Works with or without this
0030 let rbt=10
0040 radio_button rbt:1,@(10,10,10,2)="{!16x16/Controls/Check_Box_Uncheck|!16x16/Controls/Check_Box}Radio 1"
0050 radio_button rbt:2,@(10,12,10,2)="{!16x16/Controls/Check_Box_Uncheck|!16x16/Controls/Check_Box}Radio 2"
0060 print "Click either button and it will be disabled"
0070 while 1
0080 obtain (0)*
0090 if ctl=4 or eom=esc then break
0100 if ctl=rbt then radio_button read rbt,x; disable control rbt:x; print x," Pressed"
0110 wend

Regards

Dave Fullerton

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Why does a disabled radio button not show which was selected?
« Reply #5 on: July 23, 2019, 07:59:11 AM »
Two things,

First you are correct if you use bitmaps the wrong image is used if the button is disabled however that has since been corrected (been that way forever).  The fix will be out in the next update.

Second, by default a disabled bitmap simply shows and etched shadow outline of the bitmap so for the images you selected the outline is identical.  Both show the outline of a square.  If you want to see the contents of the checkbox you likely need to switch to showing disabled images as black and white grayscale instead of shadow outlines.  See the ‘OPTION’ GrayDisabledBmp which was added in PxPlus 2017.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

G Shauffenburg

  • Member
  • **
  • Posts: 5
    • View Profile
Re: Why does a disabled radio button not show which was selected?
« Reply #6 on: July 25, 2019, 07:27:17 AM »
Mike,

We tried adjusting your sample program as shown below, but it still did not work.  Are we missing something else?

0010 print 'CS',
0020 print '4D', ! Works with or without this
0025 print 'option'("GraydisabledBmp","Y")
0030 let rbt=10
0040 radio_button rbt:1,@(10,10,10,2)="{!16x16/Controls/Check_Box_Uncheck|!16x16/Controls/Check_Box}Radio 1"
0050 radio_button rbt:2,@(10,12,10,2)="{!16x16/Controls/Check_Box_Uncheck|!16x16/Controls/Check_Box}Radio 2"
0060 print "Click either button and it will be disabled"
0070 while 1
0080 obtain (0)*
0090 if ctl=4 or eom=esc then break
0100 if ctl=rbt then radio_button read rbt,x; disable control rbt:x; print x," Pressed"
0110 wend

Graham

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Why does a disabled radio button not show which was selected?
« Reply #7 on: July 25, 2019, 10:19:59 AM »
Graham

As per my earlier response:

Quote
First you are correct if you use bitmaps the wrong image is used if the button is disabled however that has since been corrected (been that way forever).  The fix will be out in the next update.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: Why does a disabled radio button not show which was selected?
« Reply #8 on: July 25, 2019, 12:15:23 PM »
Hi Mike:

What is the patch?  The fact that it is in the next release doesn't help us if the client can't go to that release yet. 

Regards

Dave Fullerton

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Why does a disabled radio button not show which was selected?
« Reply #9 on: July 25, 2019, 04:21:02 PM »
The issue has always existed in ProvideX/PxPlus.  We confirmed this issue has existed since at least 5.14.
A disabled radio button always showed an etched/disabled image of the primary (unclicked) bitmap.

As for the changes required to make it display a disabled version of the 'down' image'; its an EXE source code change that will be made and included with the next patch release or build of PxPlus.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com