mIRC Home    About    Download    Register    News    Help

Print Thread
Question re dialog radioboxes and auto unchecking #207771 01/01/09 03:55 PM
Joined: Oct 2005
Posts: 122
O
onesikgypo Offline OP
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
Hi,

Ive been using dialogs for quite a while now, and am quite familar with them, but im having a bit of a weird issue at the moment, in that i have 2 sets of enable/disable radio checkboxes (to turn on/off different features), in the same tab, but under different "boxes" The problem im having is that when they turn click enable/disable for one of the features, the radio boxes for the second feature automatically become unchecked (as if the 4 were all for the same group, rather than it being 2 different sets of radio boxes) Im not exactly sure how mirc determines if they are of the same "set" (for want of a better word), and if this is somethign i can fix, or rather if i have to script something in that so when they click a radio box, the script auto determines which radio's should be checked in the other set, and do it manually.

Any help would be greatly appreciated.

Re: Question re dialog radioboxes and auto unchecking [Re: onesikgypo] #207772 01/01/09 04:02 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
They are separated by their ID number. Possibly both IDs are incorrectly used in an "on *:DIALOG:name:sclick:id:" section or something similar.
Posting the script here so people can track down the bug would be helpful.

Re: Question re dialog radioboxes and auto unchecking [Re: 5618] #207773 01/01/09 04:25 PM
Joined: Oct 2005
Posts: 122
O
onesikgypo Offline OP
Vogon poet
OP Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
couldnt copy what im using now because its long and complicated, however this is the same type of thing and gives the same type of problem im having

Code:
dialog example {
  title "example"
  size -1 -1 180 87
  option dbu
  tab "Tab 1", 1, 3 4 171 69
  box "Example 1", 2, 8 22 74 50, tab 1
  radio "Enable", 3, 20 43 50 10, tab 1
  radio "Disable", 4, 20 53 50 10, tab 1
  box "Status", 5, 15 36 57 30, tab 1
  button "Done", 10, 139 76 37 8, tab 1 ok cancel
  box "Status", 6, 96 36 57 30
  box "Example 2", 7, 89 22 74 50
  radio "Enable", 8, 101 43 50 10
  radio "Disable", 9, 101 53 50 10
}
 


if you run it in mirc, you will notice if you check enable in example 1, then check enable in example 2, the checkbox in example 1 automatically unchecks itself.


Edit:

Ive figured it out, using the "Group" option for the dialogs, and applying it to the outer boxes, new dialog is like this:

Code:
dialog example {
  title "example"
  size -1 -1 180 87
  option dbu
  tab "Tab 1", 1, 3 4 171 69
  box "Example 1", 2, 8 22 74 50, group tab 1
  radio "Enable", 3, 20 43 50 10, tab 1
  radio "Disable", 4, 20 53 50 10, tab 1
  box "Status", 5, 15 36 57 30, tab 1
  button "Done", 10, 139 76 37 8, tab 1 ok cancel
  box "Status", 6, 96 36 57 30
  box "Example 1", 7, 89 22 74 50, group
  radio "Enable", 8, 101 43 50 10
  radio "Disable", 9, 101 53 50 10
}

Last edited by onesikgypo; 01/01/09 04:30 PM.
Re: Question re dialog radioboxes and auto unchecking [Re: onesikgypo] #207774 01/01/09 04:35 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In your dialog layout, do you use the group style for the radio buttons? For your description, it sounds like you do, but have the groups set up incorrectly.
1) Look through your layout
2) Find the first button that belongs to the first group (don't worry about the ID #)
3) Ensure that the group style is on that button.
4) Ensure that all of the buttons for the first group are listed before getting to the second group.
5) Repeat steps 2-5 for each following group.
6) If this assigns a different group to all of your radio buttons, then you should be done.
7) If it does not, then you will need to group each button that follows so that they look like they are in a group in and amongst themselves.

As stated, posting your code would be helpful, but I should only need to see the dialog layout, not any of the events.