mIRC Homepage
Posted By: vasil_michev dialog menu problem - 09/02/03 12:57 PM
blabla
how can i create DYNAMIC menus?
I just want to move $style(1) from one menu item to another depending on the selection
The only possible way (at least the only I can think of) involves variables for all the items, and this suks
I can't use $iif in menu definition, I can't rename menu item, i can't do that, and the other thing also blabla
I wonder can it be even more restrictive ;b
if anyone can help I'll be very thankfull
Posted By: Collective Re: dialog menu problem - 09/02/03 01:26 PM
Menus as in popup menus?
Code:
menu channel {
  $iif(%var == 1,$style(1) Turn Off,Turn On):$iif(%var == 1,set %var 0,set %var 1) 
}
Posted By: vasil_michev Re: dialog menu problem - 09/02/03 01:38 PM
the topic says DIALOG smile
Posted By: Collective Re: dialog menu problem - 09/02/03 01:39 PM
It does? Oh yeah, I'm in dumbass mode today...
Posted By: Frozen_Hell Re: dialog menu problem - 09/02/03 03:35 PM
Code:
dialog test {
  title "mIRC"
  size -1 -1 110 100
  option dbu

  menu "&File", 60
  item %menu1, 70

  item break, 180

  item "Save && &exit", 190, ok
  item "&Cancel", 200, cancel
}

on *:dialog:test:menu:70:{
  if ( %menu1 == on ) /set %menu1 off
  else /set %menu1 on
}

open dialog and click "File / (empty space)" then close dialog. open again and see "File/off" try again and changed to "on".
u mean this?
Posted By: Hammer Re: dialog menu problem - 10/02/03 03:24 AM
Dialog menus aren't dynamic in the same way that popup menu labels are. In order to get the check mark beside the dialog menu item, you have to /did -c $dname ID it, and /did -u $dname ID to uncheck it. You do this when you :init: the dialog or when something in your script changes to enable/disable that menu item. Here is an example of the Pause function from my MP3 Player dialog.
Code:

  check "Pause", 1054, 32 18 23 11, push
  item "&Pause", 1016, 1014
 
;  Pause
;
on *:DIALOG:dMP3Player:menu:1016: dMP3Player.Pause
on *:DIALOG:dMP3Player:sclick:1054: dMP3Player.Pause
alias dMP3Player.Pause {
  if (($insong) && ($group(#MP3.Paused).status == on)) {
    .disable #MP3.Paused
    if (!$1) .splay resume
    did -u $dname 1016,1054
  }
  else {
    .enable #MP3.Paused
    if (!$1) .splay pause
    did -c $dname 1016,1054
  }
}
Posted By: vasil_michev Re: dialog menu problem - 10/02/03 10:13 AM
Hammer I love you! smile
but where did you dig this from?
I can't find in anywhere in the help file
Posted By: Hammer Re: dialog menu problem - 11/02/03 06:22 AM
It's from my MP3 Player dialog.
© mIRC Discussion Forums