mIRC Home    About    Download    Register    News    Help

Print Thread
#137138 08/12/05 10:21 AM
Joined: Jul 2005
Posts: 56
W
whoami Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Jul 2005
Posts: 56
Hi, i want to know how to make a submenu appears when i press a button.
thats all.

#137139 11/12/05 07:16 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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
}

#137140 13/12/05 10:45 AM
Joined: Jul 2005
Posts: 56
W
whoami Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Jul 2005
Posts: 56
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

#137141 13/12/05 05:54 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Last edited by genius_at_work; 13/12/05 06:38 PM.

Link Copied to Clipboard