mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I know that in a dialog you can group items, and I've done some searching regarding this, but basically what I want to know, is, what are the advantages (or disadvantages) to grouping items? I know using the group style indicates the start of a group, but how do you indicate the end of a group?

If there's a good tutorial regarding this, a link to the tutorial would be appreciated. I did try a search for dialog tutorials, but got something like 500 responses (not all of them were for mIRC dialogs), and of the one's I checked (about a dozen) if they mentioned groups at all, they didn't explain what I'm after.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Pseudo code:

Radio 1, group
Radio 2
Radio 3
Radio 4, group
Radio 5
Radio 6

There are now two groups. Radio 1, 2 or 3 can be selected and so can 4, 5 or 6. As you can see, there's no need for something to end a group.

Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Based on that, instead of

Radio 1, group
Radio 2
Radio 3 <end group>
Radio 4
Radio 5, group
Radio 6
Radio 7

I'd have to reorder it for
Radio 4
Radio 1, group
Radio 2
Radio 3
Radio 5, group
Radio 6
Radio 7

Also, are groups good for other items (besides radio buttons)? ie: what (if any) advantage would there be in having
List 1, group
List 2
List 3

rather than just
List 1
List 2
List 3

confused

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I think the "group" switch is only available on the radio button object. It simply allows you to choose only one of the radio buttons that are within each group. I can't think of any other object that would benefit directly from having grouping.

In theory you could "link" other objects (list boxes, edit boxes, etc) through code to allow grouped radio boxes to enable/disable those objects.

BTW, it's typical for ALL radio button objects to be grouped in some way. Radio buttons are grouped into one large group in mIRC by default. In your sample code, you have a single radio button that is not in a group. In that case, a check box might be the ideal choice so that the single option can be unselected (in windows style).

-genius_at_work

Last edited by genius_at_work; 05/04/06 02:10 PM.
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks. The help file implies that the group option is available to all items, since it's in this section from /help /dialog
Quote:
Other Styles
In addition to the styles shown in brackets for each type of control, you can also specify these styles:

disable disables the control
hide hides the control
group start of a group
result identifies the control whose value will be used as the return value to the calling script when the user presses the ok button


Now that I understand how the "group" switch works a bit better, I'll have to decide if it's worth the re-write of my dialog to include it or not.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Quote:
I'd have to reorder it for
Radio 4
Radio 1, group
Radio 2
Radio 3
Radio 5, group
Radio 6
Radio 7


I think this would make more sense:

Radio 4, group
Radio 1, group
Radio 2
Radio 3
Radio 5, group
Radio 6
Radio 7

I guess this is just the way I do things, but I think if you use groups you should group everything.

You can group other controls but I can't see any effect it would have on them.


Link Copied to Clipboard