|
Joined: Dec 2006
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 39 |
alias editor if (!$dialog(editor)) dialog -m editor editor
dialog editor {
title "Word editor"
size -1 -1 80 160
option dbu
list 1, 5 5 70 60
edit "", 2, 5 62 70 10, autohs
text "user1" 3, 5 76 70 60
button "add", 4, 5 85 20 10
button "rem", 5, 26 85 20 10
button "list user1", 6, 48 85 27 10
text "user2" 7, 5 96 70 60
button "add", 8, 5 105 20 10
button "rem", 9, 26 105 20 10
button "list user2", 10, 48 105 27 10
text "var1" 11, 5 116 70 60
button "add", 12, 5 125 20 10
button "rem", 13, 26 125 20 10
button "list var1", 14, 48 125 27 10
text "var2" 15, 5 136 70 60
button "add", 16, 5 145 20 10
button "rem", 17, 26 145 20 10
button "list var2", 18, 48 145 27 10
}
eg: user1:*abc* user1:*def* user2:*!*ghi*@* user2:*!*jkl*@* %var1 mno|pqr|stu %var2 vwx|yza|bcd todo: user1 [add] if add button clicked base on edit (2). it will add into user1 level, then list box will show lates list. [rem] same as above but it will remove from user1 level [user1 list] show all user1 list on listbox. user2 same as user1 but now using another level (user2) var1: same as user1 but now using variables (%var1). "|" as saparator. var2: same as var2 but now using %var2 as variables. thanks Help me to make this dialog completed and i will learn from it. Your kindness really appriciated. Thanks
|
|
|
|
Joined: Dec 2006
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 39 |
I hope with example so that i can learn besides refer mirc.help. Thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
It would help if we knew just what you wanted to happen in the dialog.
|
|
|
|
Joined: Dec 2006
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 39 |
Sorry, RusselB
user1 [add] if add button clicked base on edit (2). it will add into user1 level, then list box will show lates list.
[rem] same as above but it will remove from user1 level
[user1 list] show all user1 list on listbox.
user2 same as user1 but now using another level (user2)
var1: same as user1 but now using variables (%var1). "|" as saparator.
var2: same as var2 but now using %var2 as variables.
thanks
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
I showed you this in an earlier post today...
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Dec 2006
Posts: 39
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2006
Posts: 39 |
I made the dialog for you, I included text, how to use my script is type /xlev it will pull up the dialog, now you code References of mirc help file /help dialogs /help $ulevel /help $level etc... Here you go
dialog Ulev {
title "ulevel"
size -1 -1 94 73
option dbu
list 1, -1 -1 48 50, size vsbar
list 2, 46 -1 48 50, size vsbar
button "[Add]", 3, 1 50 19 12, flat
button "[Del]", 4, 25 50 19 12, flat
button "[List 1]", 5, 49 50 19 12, flat
button "[List 2]", 6, 73 50 19 12, flat
check "On/Off", 7, 2 63 31 10, flat
}
alias xlev { dialog -md ulev ulev }
on *:dialog:ulev:*:*:{
if ($devent == INIT) {
did -a $dname 1 Adding stuff to list
did -a $dname 2 At Startup :P
;This area of the called INIT is where you put stuff when your dialog starts maybe a stored var or command?
}
elseif ($devent == Sclick) {
if ($did == 3) { did -a $dname 1,2 Added stuff to both list }
;Added item to both list 1 and 2 by using 1 and 2
elseif ($did == 4) { did -r $dname 1 $did($dname,1).sel }
;deleted selected item from list 1
elseif ($did == 5) { did -a $dname 1 Added whatever command or text to list 1 }
elseif ($did == 6) { did -a $dname 2 Added whatever command or text to list 2 }
elseif ($did == 7) {
if (!%this) || (%this == off) { %this = on }
else { %this = off }
;Now you choosed this way to use that checkmark to set a var but its not needed because
;You can check to see if the checkmark is on or off by using $did($dname,7).state
;This will return either 0 or 1 if unchecked or checked :)
}
}
}
Now it's your turn i modified to this size -1 -1 94 93
edit "", 8, 2 63 90 10, autohs The problem here. When i click del. It will del all list in list 1 not selected list. Then i want to know how to show all $level(level1) in list 1 by clicking [list1]. Then show all %list2 in list 2 by clicking list 2 level1:abc level1:def level1:ghi level1:jkl %level2 abc|def|ghi|jkl| Lastly, [ add ] [ rem ] will add@remove text@number (%var@$level) base on edit "", 8, 2 63 90 10, autohs this edit box. Thanks.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Most likely you will have to loop through $ulist to show it in the list here...
elseif ($did == 5) {
var %x = 1
while (%x <= $ulist(*,0)) {
did -a $dname 1 $ulist(*,%x)
inc %x
}
}
elseif ($did == 6) {
var %f = 1
while (%f <= $numtok(%level2,124)) {
did -a $dname 2 $gettok(%level2,%f,124)
inc %f
}
}
This code will be replaced in the 5/6 section this will loop through your userlist, and loop through your %level2 variable HOWEVER!!!! being that the format is exactly shown so if your variable is set like this apple|bravo|charlie it will work but if its apple bravo charlie it will not work without changing the CHR equivelant to 32 instead of 124 and sorry about the delete function i was thinking of something else at the moment the switch should be -d to delete selected line -r is to clear elseif ($did == 4) { did -d $dname 1 $did($dname,1).sel } as for the [add] [rem] im sure you can figure out what you need by coding it just pay attention to the dialog... you have to script it in the dialog try it without the dialog if you achieve to code your script without the use of the dialog, you can easily put it in the dialog in the proper areas, *hint* /help $? I'll let you try to make this part on your own, you have the tools in front of you, you should be able to achieve your end result.
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
|