mIRC Homepage
Posted By: Skeletor Enabling groups through dialog "Items" - 09/11/08 04:42 PM
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.
Posted By: DJ_Sol Re: Enabling groups through dialog "Items" - 09/11/08 04:48 PM
The only issue I see is that there is no checkbox 'id100' in the dialog ...
Posted By: Skeletor Re: Enabling groups through dialog "Items" - 09/11/08 05:12 PM
"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.
Posted By: RusselB Re: Enabling groups through dialog "Items" - 09/11/08 05:31 PM
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.
Posted By: Skeletor Re: Enabling groups through dialog "Items" - 09/11/08 05:58 PM
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.
Posted By: RusselB Re: Enabling groups through dialog "Items" - 09/11/08 07:08 PM
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
}
Posted By: Skeletor Re: Enabling groups through dialog "Items" - 09/11/08 07:25 PM
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.
© mIRC Discussion Forums