mIRC Home    About    Download    Register    News    Help

Print Thread
Enabling groups through dialog "Items" #206205 09/11/08 04:42 PM
Joined: Feb 2005
Posts: 185
S
Skeletor Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Hey all, I am sorting out some of my dialogs and came across my main control panel which I had put in some "Items" but I can't seem to enable my #groups which I used to enable via a check box.

Code:
dialog control {
  title "Control Panel"
  size -1 -1 187 109
  option dbu
  list 1, 0 2 174 93, size
  list 3, 0 96 174 11, size
  menu "File", 2
  item "Intro Music", 5, 2
  item "Sound Effects", 6, 2
  item "Notify Sounds", 7, 2
  item break, 12, 2
  item "Coloured Nicks", 8, 2
  item "Op Grabber", 9, 2
  item break, 13, 2
  item "Exit", 10, 2
  menu "Help", 4
  item "Credits", 11, 4
}


If you could show me an example for "Intro Music" that would be fantastic!

This is the code from the check box options:

Code:
on *:dialog:control:sclick:100:{
  if ($did(100).state == 0) { .disable #tunes }
  elseif ($did(100).state == 1) { .enable #tunes }
}
on *:Dialog:control:init:0: {
  if ($group(#tunes) == on) { did -c $dname 100 }
}

#tunes off
on *:start:{ splay music.wav | Halt }
#tunes end



Matt.


sub-zero.homeip.net:6667

Re: Enabling groups through dialog "Items" [Re: Skeletor] #206206 09/11/08 04:48 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
The only issue I see is that there is no checkbox 'id100' in the dialog ...

Re: Enabling groups through dialog "Items" [Re: DJ_Sol] #206207 09/11/08 05:12 PM
Joined: Feb 2005
Posts: 185
S
Skeletor Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
"but I can't seem to enable my #groups which I used to enable via a check box."

I was using check boxes, however I have now decided to use "list" instead.

Sorry for the mis-understanding.


Matt.

Last edited by Skeletor; 09/11/08 05:15 PM.

sub-zero.homeip.net:6667

Re: Enabling groups through dialog "Items" [Re: Skeletor] #206208 09/11/08 05:31 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
use the "check" parameter for the list box in your dialog layout.

This will give you your list, with a check box beside each item.

Note that these check boxes are a simple on/off format, and changes when you select the item in the list.

You will still have to change the sclick event so that it references the clicked item in the list.

See /help /did for more reading.

Last edited by RusselB; 09/11/08 05:32 PM.
Re: Enabling groups through dialog "Items" [Re: RusselB] #206210 09/11/08 05:58 PM
Joined: Feb 2005
Posts: 185
S
Skeletor Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
I am not using check boxes at all any more.

I was using check boxes, to enable the /splay event, I put them in a group and they worked. I have now decided to delete the dialog, and use a "list"

Ie: File... "Intro music", then when I Click on "intro music" It will enable it with a tick next to it, or disable it without a tick. I was only giving an example of my previous code for the groups/check boxes groups.

The question that I am asking is... How do you code a list item:

menu "File", 2
item "Intro Music", 5, 2
item "Sound Effects", 6, 2
item "Notify Sounds", 7, 2
item break, 12, 2
item "Coloured Nicks", 8, 2
item "Op Grabber", 9, 2
item break, 13, 2
item "Exit", 10, 2
menu "Help", 4
item "Credits", 11, 4

So when I click on the menu item, it will enable the following:

Code:
on *:start:{ splay vtec.wav | Halt }


Sorry my previous posts were not clear enough.

Matt.


sub-zero.homeip.net:6667

Re: Enabling groups through dialog "Items" [Re: Skeletor] #206218 09/11/08 07:08 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You keep mentioning list items, yet the dialog code you show (in your last post) shows menu items only,

These are two different items.

In your earlier dialog code you have a couple of list boxes, which, as I stated, can have the check parameter, allowing you to use the items in the list box as a checked/unchecked item.

To my knowledge, dialog menus cannot have marks indicating Enabled/disabled, unlike right-click menus, where you can use different $style options.

If you don't care about the visual aspect, then you might try something like
Code:
on *:dialog:control:sclick:5:{
  $iif($group(#tunes) == on,.disable,.enable) #tunes
}

Re: Enabling groups through dialog "Items" [Re: RusselB] #206224 09/11/08 07:25 PM
Joined: Feb 2005
Posts: 185
S
Skeletor Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
No that didn't work, thanks anyway. I will just recode the dialog to enable my groups via check boxes, unlike the "item" method that I intended to use.

Matt.


sub-zero.homeip.net:6667