mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I would like to prevent a dialog from being closed when it's "doing it's work"... It would be nice if haltdef could be used in the sclick event (if the $did == the OK or Cancel $did) to prevent dialogs from closing....
Code:
on *:dialog:Sample:sclick:*:{
  if ($did == 1) && (%InProgress) { haltdef }
}
dialog Sample {
  title "Sample"
  size -1 -1 215 135
  option dbu
  button "&Cancel", 1, 136 119 37 12, cancel hide
}

Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Code:
on *:dialog:Sample:sclick:*:{
  if ($did == 1) { halt }
}
dialog Sample {
  title "Sample"
  size -1 -1 215 135 
  option dbu
  button "&Cancel", 1, 136 119 37 12, cancel hide
}


The dialog will not close since you halt'd the event. I don't know if it'll work, but it works with OK buttons.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
you can also kill the "cancel" property making it a normal button. mirc 6.03 doens't require an ok or cancel button. >:D

C
codemastr
codemastr
C
And for older versions that do require it just make one that is hidden or size 0 0 and use regular buttons for the ok and cancel buttons.

Z
ZeroCarontE
ZeroCarontE
Z
i dont know if it was what he suggested in the first post, but what about a on dialog queryunload event? it is activated when the user try to close the dialog (the X button on the titlebar) and the script can HALT it...

by the way... it would be nice to have a $MessageBox too 8P

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
/help $input
You have one laugh

Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Coldfusion: Nope doesn't work with cancel

Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
KingTomatoe & Codemastr: This doesn't stop the dialog from closing then if the [X] or Escape is clicked/pressed...

Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
ZeroCarontE: Yeah I Think that the dialog close, like the init event, should be seperate from the sclick event...


Link Copied to Clipboard