Author |
Topic: Property sheet radio buttons (Read 525 times) |
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Property sheet radio buttons
« Thread started on: Oct 16th, 2010, 9:04pm » |
|
I'm building a propertysheet which will have dozens of radio buttons. The buttons are in groups of four, but not in group boxes. I can't figure out a way to link them in fours but not with all. I've tried to use the sys comand: SYS "CheckRadioButton", !dlg%, first%, last%, id%, but this doesn't seem to work. I've changed the '!dlg%' to dlg%() and hdlg%, with and without the pling, but nothing. Even putting a groupbox around them doesn't seem to work. Any idea what I'm doing wrong?
Matt
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Property sheet radio buttons
« Reply #1 on: Oct 16th, 2010, 9:21pm » |
|
on Oct 16th, 2010, 9:04pm, Matt wrote:Any idea what I'm doing wrong? |
|
Not without seeing your code. The CheckRadioButton API certainly works fine; I use it all the time. Obviously it relies on your radio buttons being given consecutive IDs, but I'm sure you've arranged that.
Since the radiobuttons are not in group boxes, you must ensure that the first (but only the first) button in each group has the WS_GROUP style; but no doubt you've arranged that too.
Quote:I've changed the '!dlg%' to dlg%() and hdlg%, with and without the pling, but nothing |
|
As it's a property sheet the correct form is:
Code:SYS "CheckRadioButton", hdlg%(pg%), first%, last%, id% This is all documented in the BB4W manual.
Richard.
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Property sheet radio buttons
« Reply #2 on: Oct 17th, 2010, 07:04am » |
|
Here's the main parts taken from the program and put in a test one. Code: REM TEST
INSTALL @lib$+"WINLIB2"
INSTALL @lib$+"WINLIB4"
datapages%=1
DIM datapage%(datapages%-1),hdlg%(datapages%-1)
PROC_CONTESTANT_INFO_PROP_SHT_SETUP
PROC_showpropsheet(contdlg%,hdlg%())
SYS "CheckRadioButton", hdlg%(0), 25, 28, 25
G=GET
PROC_closedialog(contdlg%)
END
DEF PROC_CONTESTANT_INFO_PROP_SHT_SETUP
datapage%(0)=FN_newdialog("Contestant", 0, 0,500,300, 10,1000)
PROC_static(datapage%(0),"Surname", 10, 5, 6, 43, 12,&2)
PROC_editbox(datapage%(0),"", 20, 50, 5,100, 12,&1000)
PROC_groupbox(datapage%(0),"", 30,155, 0,110, 16,0)
PROC_radiobutton(datapage%(0),"Mr", 25,160, 5, 25, 10,0)
PROC_radiobutton(datapage%(0),"Mrs", 26,185, 5, 25, 10,0)
PROC_radiobutton(datapage%(0),"Miss", 27,210, 5, 25, 10,0)
PROC_radiobutton(datapage%(0),"Ms", 28,235, 5, 25, 10,0)
PROC_static(datapage%(0),"First Name", 11, 5, 21, 43, 12,&2)
PROC_editbox(datapage%(0),"", 21, 50, 20,100, 12,&1000)
PROC_static(datapage%(0),"Membership No.", 12,160, 21, 53, 12,&2)
PROC_editbox(datapage%(0),"", 22,215, 20,150, 12,&1000)
PROC_static(datapage%(0),"Address", 13, 5, 36, 43, 12,&2)
PROC_editbox(datapage%(0),"", 23, 50, 35,315, 12,&1000)
PROC_radiobutton(datapage%(0),"In WI", 29,340, 5, 25, 10,0)
contdlg% = FN_newpropsheet("Contestant Information",1,0,&80,datapage%())
ENDPROC When you click on the 'In WI' button, it deselects the title one.
(FYI. the datapages% is set to 1 but there will be several pages with the many groups of radio buttons on each.)
Matt
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Property sheet radio buttons
« Reply #3 on: Oct 17th, 2010, 09:03am » |
|
on Oct 17th, 2010, 07:04am, Matt wrote:When you click on the 'In WI' button, it deselects the title one. |
|
For a start, a 'lone' radio button makes no sense! Radio buttons must always comes in groups of at least two - that's the whole point of them! It looks to me as though 'In WI' should be a checkbox not a radiobutton.
Secondly, you have not done what I explicitly stated you must do - that is to set the first of each group of radiobuttons to have the WS_GROUP style:
Code: WS_GROUP = &20000
PROC_radiobutton(datapage%(0),"Mr", 25,160, 5, 25, 10, WS_GROUP)
PROC_radiobutton(datapage%(0),"Mrs", 26,185, 5, 25, 10,0)
PROC_radiobutton(datapage%(0),"Miss", 27,210, 5, 25, 10,0)
PROC_radiobutton(datapage%(0),"Ms", 28,235, 5, 25, 10,0)
....
PROC_radiobutton(datapage%(0),"In WI", 29,340, 5, 25, 10, WS_GROUP) But it still makes no sense to have a radiobutton on its own.
Richard.
P.S. If you saw Michael Hutton's reply before I deleted it - it's complete nonsense.
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Property sheet radio buttons
« Reply #4 on: Oct 17th, 2010, 2:52pm » |
|
You're absolutely right on both counts, Richard. I wasn't doing what you said - mainly due to doing too many things rather than concentrating on the single problem - sorry. And the 'WI' button was only a radio button to show it wasn't working how I wanted it to. It will be a checkbox in the finished program.
Thanks again, Richard.
|
|
Logged
|
|
|
|
|