mIRC Homepage
Posted By: whoami dialog's submenu - 08/12/05 10:21 AM
Hi, i want to know how to make a submenu appears when i press a button.
thats all.
Posted By: MikeChat Re: dialog's submenu - 11/12/05 07:16 AM
Code:
dialog menu {
  Title Sample Menu
  size -1 -1 100 50
  option dbu
  menu "Menu", 1000
  item "text", 1001, 1000
  item "Item 2", 1002
  item "Item 3", 1003
  item break, 1901
  menu "New menu", 1021, 1000
  item "Item 1", 1022, 1021
  item "Item 2", 1023
  item "Item 3", 1024
}
Posted By: whoami Re: dialog's submenu - 13/12/05 10:45 AM
thanks for answering me mikey but this is not the thing i want to do crazy

i want...
dialog menu {
Title Sample Menu
size -1 -1 100 50
option dbu
menu "Menu", 1000
button "text"
}
if i pressed the button "text" a submenu appears
Posted By: genius_at_work Re: dialog's submenu - 13/12/05 05:54 PM
Where do you want the submenu to appear? In the dialog menu, in the mirc menu, in a channel/nicklist menu, in a custom window menu?

If you are looking to add a submenu in the dialog, as far as I can tell, mIRC doesn't allow you to add/insert menus. You can add/insert/delete/enable/disable items within existing menus.

Here is a possible answer I came up with. It isn't perfect, because existing menus can't be overwritten, disabled, or hidden, apparently.
Code:
alias tmenu dialog -m testmenu testmenu

dialog testmenu {
  Title Sample Menu
  size -1 -1 100 50
  option dbu
  menu "Menu 1",1000
  item "Item 1",1001
  item "Item 2",1002

  menu "Submenu",2000,1000

  item "Item 3",1003,1000
  item "Item 4",1004

  button "Submenu",5,5 5 30 10
}

on *:DIALOG:testmenu:init:0:{
  %submenu = 0
}

on *:DIALOG:testmenu:sclick:5:{
  if (!%submenu) {
    %submenu = 1
    did -a $dname 2000 2001 Subitem 1
    did -a $dname 2000 2002 Subitem 2
  }
  else {
    %submenu = 0
    did -d $dname 2001
    did -d $dname 2002
  }
}


The above example uses existing an existing submenu that has no items. When the Submenu button is pressed once, two new item are added into the Submenu. When the Submenu button is pressed again, those two new items are deleted.

-genius_at_work
© mIRC Discussion Forums