mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
is there some way to disable the close event of the dialog?
like, add in an input box which asks "do you want to close this dialog? Yes/No"
and if the user clicks no, it'll keep the dialog open

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
If you add a button tot he dialog like...

button "Close", 99, 0 0 0 0

then do..

on 1:DIALOG:myDialog:SCLICK:99: {
/set -u0 %close $input(Would you like to close the dialoig?, yvq, Close Dialog?)
if (%close == $yes) /dialog -c $dname
}


-KingTomato
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
nah i meant, like when the person cilcks the "X" on the top right corner
is there any way to cancel that?

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
No, in my book that's a "forced close" Nothing u can really do about it, other then do a check sum. Basically, have a timer check every second if the window is open. If it isn't, and it wasn't authorised, recall the dialog window to open. The only way to close the dialog would be the "correct" way or specified way.. If you give me a few, i'll wirte an example.


-KingTomato
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
[snip]

alias closeMe {
if ($dialog(closeMe)) { /dialog -vie closeMe closeMe }
else { /dialog -md closeMe closeMe }
}

alias closeMe.check {
if (!$dialog($$1)) {
/set -u0 %err $input(Please close the dialog the correct way., ow, Invalid Closure)
/dialog -md $$1 $$1
}
}

dialog closeMe {
title "Close Me!"
size -1 -1 100 55
option dbu
box "My Really Cool Dialog", 1, 5 5 90 45
button "Close", 10, 10 15 20 10
button "Close", 20, 30 15 20 10
button "Close", 30, 50 15 20 10
button "Close", 40, 70 15 20 10
button "Close", 50, 10 25 20 10
button "Close", 60, 30 25 20 10
button "Close", 70, 50 25 20 10
button "Close", 80, 70 25 20 10
button "Close", 90, 10 35 20 10
button "Close", 100, 30 35 20 10
button "Close", 110, 50 35 20 10
button "Close", 120, 70 35 20 10, okay
}

on 1:DIALOG:closeMe:INIT:*: {
.timer [ $+ [ $dname ] ] 0 1 /closeMe.check $dname
}

on 1:DIALOG:closeMe:SCLICK:*: {
if ($did == 120) .timer [ $+ [ $dname ] ] off
/dialog -c $dname
}

[/snip]


-KingTomato
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
thanks for that tomato-king, but it wasnt necessary
i was just asking if there was a way to halt that in the dialog:close event

ill just request it as a feature now lol

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
1: you coulsnt halt the dialog closing using the on close feature as the on close is to trigger a script for when the dialog is closed smile
2:
i think you can halt the x button using mdx.dll


new username: tidy_trax
Joined: Jan 2003
Posts: 98
T
twigboy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 98
ahh mdx? thanks!
thats the reason i asked about it in the first place, because i grabbed a window onto a button, but when i close the dialog, everything int he window is reset
(the window logs text for me, and it gets cleared when i close the dialog)


Link Copied to Clipboard