Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Alias List.Start {
- If (!$Dialog(List)) { Dialog -m List List }
- Else { Dialog -x List List | Dialog -m List List }
- }
- dialog List {
- title ""
- size -1 -1 54 260
- option dbu
- list 1, 2 1 52 270, hsbar size
- }
- On *:Dialog:List:*:*:{
- If ($devent == Init) {
- $mdxin
- dll $mdx SetMircVersion $version
- dll $mdx MarkDialog $dname
- dll $mdx SetControlMDX $dname 1 showsel rowselect > $views
- dll $mdx SetFont $dname 1, -18 400 Times New Roman
- dll $mdx SetColor $dname 1, background $color(1)
- dll $mdx SetColor $dname 1, textbg $color(1)
- dll $mdx SetColor $dname 1, text $color(0)
- Dll $hos Dock $dname Right -1
- Var %Server.List 1
- While (%Server.List <= $Lines(Documents\Servers.Txt)) {
- Did -a $dname 1 $Gettok($read(Documents\Servers.txt,%Server.List),1,95)
- Tokenize 45 $read(Documents\Servers.txt,%Server.List)
- Inc %Server.List
- }
- Did -z $dname 1
- }
- If ($devent == Dclick) {
- Set %Selx $did(1).sel
- Set %Linn $Read(Documents\Servers.txt,%Selx)
- Unset %Selx
- Set %Server.New $Gettok(%Linn,2,95)
- Unset %Linn
- Server %Server.New
- Unset %Server.New
- }
- }
- Alias Servadd {
- If (!$dialog(Servadd)) { Dialog -m ServAdd ServAdd }
- }
- dialog Servadd {
- title "Server add and remove"
- size -1 -1 164 89
- option dbu
- list 1, 2 19 160 69, hsbar vsbar size
- edit "Server:port", 2, 2 4 80 10, autohs
- button "Add", 3, 85 3 32 12
- button "Remove", 4, 120 3 32 12
- }
- On *:Dialog:Servadd:*:*:{
- If ($devent == Init) {
- Var %List.Servadd 1
- While (%List.Servadd <= $Lines(Documents\Servers.Txt)) {
- Did -a $dname 1 $read(Documents\Servers.txt,%List.Servadd)
- Inc %List.Servadd
- }
- }
- If ($devent == Sclick) {
- If ($did = 3) {
- Did -a $dname 1 $Gettok($did(2),1,95)
- Did -a List 1 $Gettok($did(2),1,95)
- Write Documents\Servers.txt $did(2)
- Did -z List 1
- }
- If ($did = 4) {
- Did -d $dname 1 $did(1).sel
- Write -dl $did(1).sel Documents\Servers.txt
- List.start
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement