mIRC Home    About    Download    Register    News    Help

Print Thread
#128224 22/08/05 04:32 PM
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
Hi, I would like this. When I click into a dialog but not in a ID the dialog should drop whenever I want. I have made this:

Code:
if ($devent == sclick) { if !$did { dialog -s $dname $mouse.x $mouse.y * * }


But it won't work. Someone can help me? laugh

#128225 22/08/05 04:36 PM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
did you try:
if ($devent == sclick) echo -a clicked: $did


then take the output of the did and use it in your script. im not sure if it's posible to do this, but you cal always give it a try, or use a dll

#128226 22/08/05 04:39 PM
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
You haven't understood. My code work, but only a thing. When the dialog moved, it won't drop but it got resized. I don't want this, but only the dialog moved in $mouse.x and $mouse.y coordinates. smirk

#128227 22/08/05 04:56 PM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
so you want the dialog to drop to the taskbar? minimize?

im not that experienced with dialogs, i only made a few and i didnt finish them eather smirk

also, i dont have a mIRC helpfile handy, (well i do have one or 2) but then wont open on my mac laptop frown

#128228 22/08/05 05:00 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I do not quite understand what you are trying to do... are you trying to make the dialog centre at the point you are clicking? if not please try to explain exactly what you want to do a little more clearly.

However i must note, that using * * for the width and height values in the /dialog -s command is wrong and is what is causing your dialog size to mess up

Last edited by Om3n; 22/08/05 05:01 PM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#128229 22/08/05 05:03 PM
Joined: Nov 2003
Posts: 157
RuFy Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2003
Posts: 157
I want this:

When you click over the titlebar and drag a dialog, it follow your mouse.
I want the same with /dialog -s command.
Understood? shocked

(I'm not english, I don't know how explain better)

#128230 22/08/05 05:14 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You need to work with the DROP event rather than the SCLICK event. I've not managed to get this working properly (it only drags if your start/end are within the dialog).

Code:
on *:dialog:yourdialog:drop:*:{
  dialog -s $dname $mouse.mx $mouse.my $dialog($dname).cw $dialog($dname).ch
}


This will cause it to center on your final mouse position. To have it put the top left corner on your final mouse position, use $mouse.dx and $mouse.dy instead.

Still, like I said, I can't make it work if you leave the dialog while dragging. It will at least get you started.


Invision Support
#Invision on irc.irchighway.net
#128231 22/08/05 05:43 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Correctly duplicating the drag drop behavior like this is not possible with dialogs.

The only way i can see of duplicating the drag drop behavior correctly would be to use mouse events with a picwin instead of a dialog. You could script it to 'follow' the pointer upon click-hold-drag, about the closest you will get to a normal dragdrop behavior.

Riamus2's code will also not move the dialog if drop location is over a non-disabled dialog id/control. (and will need to be altered if you are using dbu's instead of pixels, or will reposition incorrectly)


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#128232 22/08/05 07:13 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Actually, I'm using DBUs in my test and it repositions just fine.

Like I said, it's not a good way to do it, but was there as an example to possibly lead into a better direction.

Most likely, a DLL would need to be used for the most accurate drag/drop method.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard