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
}


NaquadaBomb
www.mirc-dll.com
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.


- cF
Dedicated helper for rent.
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
you can also kill the "cancel" property making it a normal button. mirc 6.03 doens't require an ok or cancel button. >:D


-KingTomato
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.

Joined: Jul 2003
Posts: 11
Z
Pikka bird
Offline
Pikka bird
Z
Joined: Jul 2003
Posts: 11
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: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
/help $input
You have one laugh


-KingTomato
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


NaquadaBomb
www.mirc-dll.com
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...


NaquadaBomb
www.mirc-dll.com
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...


NaquadaBomb
www.mirc-dll.com

Link Copied to Clipboard