mIRC Home    About    Download    Register    News    Help

Print Thread
#58706 01/11/03 08:06 PM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
hi..sorry for having 3 active posts in a row but im just in need of help

how can i have a dropdown menu and have the user be able to edit whats in it? im making a favorites menu for websites, and they can edit the name and url of an entry.

#58707 01/11/03 10:36 PM
R
RAIN
RAIN
R
Usually it`s called combo ,So in yor dialog where is combo you should add edit.
example:
dialog new_table {
title "New Project"
size -1 -1 157 67
option dbu
combo 1, 9 6 60 50, size edit drop
}
Like here combo has id 1 and propertys size edit drop.

#58708 01/11/03 11:07 PM
Joined: Dec 2002
Posts: 416
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 416
This is just a snip off of one of my scripts using Drop down boxes


Menu channel,menubar,query,status {
Color Nick:dialog -mo dcn dcn
}
dialog dcn {
title "Color Nick"
size -1 -1 162 84
option dbu
box "Nick Colors ", 1, 1 0 74 68
box "Other Colors ", 2, 74 0 87 68
box "", 3, 1 64 160 19
combo 4, 4 7 35 70, drop
check "OPed", 5, 41 9 30 10
combo 6, 4 19 35 70, drop
check "Half-OP", 7, 41 21 30 10
combo 8, 4 31 35 70, drop
check "Voiced", 9, 41 32 30 10
combo 10, 4 43 35 70, drop
check "Regular", 11, 41 44 30 10
combo 12, 4 55 35 70, drop
check "My Nick", 13, 41 55 30 10
combo 14, 77 7 35 70, drop
check "IRCops", 15, 114 9 30 10
combo 16, 77 19 35 70, drop
check "Away", 17, 114 21 30 10
combo 18, 77 31 35 70, drop
check "Brackets Color", 19, 114 32 45 10
combo 20, 77 43 35 70, drop
check "Nick Brackets", 21, 114 44 45 10
combo 22, 77 55 35 70, drop
check "Nick Color", 23, 114 55 45 10
button "Create Brackets", 24, 76 70 46 10
button "On/Off", 25, 4 70 35 10
button "Cancel", 26, 123 70 35 10, cancel
button "Update", 27, 40 70 35 10, ok
}
on *:dialog:dcn:*:*:{
if ($devent == init) {
if ($did == 0) {
if (%on.chk == 1) did -c dcn 5
if (%hn.chk == 1) did -c dcn 7
if (%nv.chk == 1) did -c dcn 9
if (%vn.chk == 1) did -c dcn 11
if (%mn.chk == 1) did -c dcn 13
if (%ic.chk == 1) did -c dcn 15
if (%an.chk == 1) did -c dcn 17
if (%chr.chk == 1) did -c dcn 19
if (%brk.chk == 1) did -c dcn 21
if (%nic.chk == 1) did -c dcn 23
dcnon4 | dcnhn6 | dcnvn8 | dcnnv10 | dcnmn12 | dcnic14 | dcnan16 | dcnchr18 | dcnbrk20 | dcnnic22
}
}
if ($devent == sclick) {
if ($did == 4) { if ($did(4).seltext) { set %on.clr $did(4).seltext | dcnon4 } }
if ($did == 6) { if ($did(6).seltext) { set %hn.clr $did(6).seltext | dcnhn6 } }
if ($did == 8) { if ($did(8).seltext) { set %vn.clr $did(8).seltext | dcnvn8 } }
if ($did == 10) { if ($did(10).seltext) { set %nv.clr $did(10).seltext | dcnnv10 } }
if ($did == 12) { if ($did(12).seltext) { set %mn.clr $did(12).seltext | dcnmn12 } }
if ($did == 14) { if ($did(14).seltext) { set %ic.clr $did(14).seltext | dcnic14 } }
if ($did == 16) { if ($did(16).seltext) { set %an.clr $did(16).seltext | dcnan16 } }
if ($did == 18) { if ($did(18).seltext) { set %chrl.clr $did(18).seltext | set %chrr.clr $did(18).seltext | dcnchr18 } }
if ($did == 20) { if ($did(20).seltext) { set %brk.clr $did(20).seltext | dcnbrk20 } }
if ($did == 22) { if ($did(22).seltext) { set %nic.clr $did(22).seltext | dcnnic22 } }
if ($did == 24) { set %chrl.chk $$?="Enter Left Bracket W/Color" | if $?!="Would you like set the right Bracket like the left?" == $true { set %chrr.chk %chrl.chk } | else { set %chrr.chk $$?="Enter Right Bracket W/Color" } }
if ($did == 27) { set %on.chk $did(5).state | set %hn.chk $did(7).state | set %vn.chk $did(9).state | set %nv.chk $did(11).state | set %mn.chk $did(13).state | set %ic.chk $did(15).state | set %an.chk $did(17).state | set %chr.chk $did(19).state | set %brk.chk $did(21).state | set %nic.chk $did(23).state }
}
}
alias -l dcn { dialog -mdo dcn dcn }
alias -l dcnhn6 {
did -c dcn 6 %hn.clr
did -a dcn 6 1 White | set %dcnhn 0
did -a dcn 6 2 Black | set %dcnhn 1
did -a dcn 6 3 Dk Blue | set %dcnhn 2
did -a dcn 6 4 Green | set %dcnhn 3
did -a dcn 6 5 Red | set %dcnhn 4
did -a dcn 6 6 Maroon | set %dcnhn 5
did -a dcn 6 7 Purple | set %dcnhn 6
did -a dcn 6 8 Orange | set %dcnhn 7
did -a dcn 6 9 Yellow | set %dcnhn 8
did -a dcn 6 10 Lt Green | set %dcnhn 9
did -a dcn 6 11 Teal | set %dcnhn 10
did -a dcn 6 12 Cyan | set %dcnhn 11
did -a dcn 6 13 Blue | set %dcnhn 12
did -a dcn 6 14 Pink | set %dcnhn 13
did -a dcn 6 15 Dk Grey | set %dcnhn 14
did -a dcn 6 16 Lt Grey | set %dcnhn 15
}


Last edited by Othello; 01/11/03 11:12 PM.
#58709 02/11/03 04:46 AM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
ok i have a few bugs;
there is a blank line on the first line in the list
and it doesnt load the last line of the file.
Code:
on *:dialog:favsetup:init:*: {
  var %l 0
  var %o $lines($mircdirurrl.txt)
  :loop
  if (%l == %o) { goto end }
  did -a $dname 3 $read($mircdirurrl.txt, %l)
  inc %l 1
  goto loop
  :end
}

#58710 02/11/03 05:47 AM
Joined: Dec 2002
Posts: 1,518
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,518
eww goto loop, have u tried a while loop? it would look much nicer and probably give u less trouble in scripting and even being able to read.

#58711 02/11/03 06:56 AM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
how would i implement a while loop?

#58712 02/11/03 10:08 AM
L
listner
listner
L
Here's a thought on the 'while' loop, although it's untested:
Code:
on *:dialog:favsetup:init:*: {
  var %l 0
  var %o $lines($mircdirurrl.txt)
  while ( %l <= %o {
    did -a $dname 3 $read($mircdirurrl.txt, %l)
    inc %l 1
  }
}


Hope that this helps,

Listner

#58713 03/11/03 01:37 AM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
still does not load the last line of the file.

#58714 03/11/03 02:03 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Code:
on *:dialog:favsetup:init:*: { filter -fo urrl.txt $dname 3 }

#58715 03/11/03 02:24 AM
Joined: Jul 2003
Posts: 733
M
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Jul 2003
Posts: 733
wow. thx grin

#58716 03/11/03 02:42 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
np.


Link Copied to Clipboard