LB Booster
« Error setting a disabled RadioButton »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:35am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Error setting a disabled RadioButton  (Read 585 times)
CirothUngol
New Member
Image


member is offline

Avatar

Odie, Odie, cha cha cha.


PM

Gender: Male
Posts: 44
xx Error setting a disabled RadioButton
« Thread started on: Jan 18th, 2014, 6:42pm »

LB Booster will hang if the program attempts to "set" a disabled RadioButton. This issue popped-up on code that I had successfully executed using a previous version of LBB, so it would seem to be a recent issue. You may test the problem using the following Code:
 NOMAINWIN
 WindowWidth = 175
 WindowHeight = 185
 GROUPBOX    #main.gb1, "    RadioButton Test    ",                10,   5, 150, 80
 RADIOBUTTON #main.rb1,    "RadioButton 1", [rb1Set], [rb1Reset],  25,  20, 100, 20
 RADIOBUTTON #main.rb2,    "RadioButton 2", [rb2Set], [rb2Reset],  25,  40, 100, 20
 RADIOBUTTON #main.rb3,    "RadioButton 3", [rb3Set], [rb3Reset],  25,  60, 100, 20
 BUTTON       #main.b1,           "Enable", [b1Click],        UL,  10,  90,  75, 25
 BUTTON       #main.b2,          "Disable", [b2Click],        UL,  90,  90,  75, 25
 BUTTON       #main.b3,           "SetRB1", [b3Click],        UL,   5, 120,  50, 25
 BUTTON       #main.b4,           "SetRB2", [b4Click],        UL,  60, 120,  50, 25
 BUTTON       #main.b5,           "SetRB3", [b5Click],        UL, 115, 120,  50, 25
 OPEN "RadioButton Test" FOR window_nf AS #main
 #main, "font ms_sans_serif 10"
 #main, "trapclose [main.quit]"

[rb1Set]
[rb1Reset]
[rb2Set]
[rb2Reset]
[rb3Set]
[rb3Reset]
 WAIT

[b1Click]
 #main.rb1, "enable"
 #main.rb2, "enable"
 #main.rb3, "enable"
 WAIT
[b2Click]
 #main.rb1, "disable"
 #main.rb2, "disable"
 #main.rb3, "disable"
 WAIT

[b3Click]
 #main.rb1, "set"
 WAIT
[b4Click]
 #main.rb2, "set"
 WAIT
[b5Click]
 #main.rb3, "set"
 WAIT

[main.quit]
 CLOSE #main
 END 

Use the buttons to enable\disable\set\reset the RadioButtons. Works in both JustBASIC v1.01 and Liberty BASIC v4.04.
User IP Logged

LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Error setting a disabled RadioButton
« Reply #1 on: Jan 18th, 2014, 8:50pm »

on Jan 18th, 2014, 6:42pm, CirothUngol wrote:
LB Booster will hang if the program attempts to "set" a disabled RadioButton.

It doesn't 'hang' here (LBB 2.43). What I do notice is that when you set a disabled radiobutton the others don't automatically reset (as they would when the buttons are enabled), so you end up with more than one indicated at the same time!

Quote:
it would seem to be a recent issue.

There was a problem with an early version of LBB that if you 'programmatically' set a radiobutton (using "set") the other buttons in the same group wouldn't reset. Maybe fixing that has affected your usage.

But I still can't reproduce any serious issue such as LBB 'hanging'.

Richard.
User IP Logged

CirothUngol
New Member
Image


member is offline

Avatar

Odie, Odie, cha cha cha.


PM

Gender: Male
Posts: 44
xx Re: Error setting a disabled RadioButton
« Reply #2 on: Jan 18th, 2014, 11:51pm »

Just upgraded LBB from 2.41 to 2.43 (thanx for the new release), but the test program still stops responding for me.
Windows XP sp3 with all updates and minimal software installed; if the RadioButtons are enabled then clicking a "SetRB#" button sets it appropriately, but does nothing when I click a "SetRB#" button if they are disabled, then goes to hourglass and "Not Responding". I'll check again on Win7 when I get that system back up.

No problem, really. I simply enable the RadioButtons before setting them and now my program works fine. Excellent utility you have here, I'm more than happy to bend with a language's odd little quirks... it's what Liberty BASIC programmers do. ^_^
User IP Logged

LB Booster + LB Workshop + LB Builder = My Programs on Google Drive
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Error setting a disabled RadioButton
« Reply #3 on: Jan 19th, 2014, 09:16am »

on Jan 18th, 2014, 11:51pm, CirothUngol wrote:
clicking a "SetRB#" button sets it appropriately, but does nothing when I click a "SetRB#" button if they are disabled, then goes to hourglass and "Not Responding".

Strange. LBB doesn't do anything different if the button is disabled - the "set" command simply sends a BM_CLICK message, which according to MSDN "Simulates the user clicking a button":

http://msdn.microsoft.com/en-us/library/windows/desktop/bb775985.aspx

So it almost sounds as though the 'crash' is a Windows issue. Nevertheless I'll make a note to investigate further at some point.

Meanwhile, as you say, the workaround is to send a "enable; set; disable" command sequence to change the state of a disabled radiobutton.

Edit: Confirmed crash on Windows XP, no crash on Windows 7, no crash on Windows 8.1. This is looking to be a Windows issue (Windows XP becomes unsupported by Microsoft from April).

Richard.
« Last Edit: Jan 19th, 2014, 09:44am by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls