mIRC Homepage
Posted By: RuFy Help /dialog -s - 22/08/05 04:32 PM
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
Posted By: IR_n00b Re: Help /dialog -s - 22/08/05 04:36 PM
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
Posted By: RuFy Re: Help /dialog -s - 22/08/05 04:39 PM
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
Posted By: IR_n00b Re: Help /dialog -s - 22/08/05 04:56 PM
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
Posted By: Om3n Re: Help /dialog -s - 22/08/05 05:00 PM
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
Posted By: RuFy Re: Help /dialog -s - 22/08/05 05:03 PM
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)
Posted By: Riamus2 Re: Help /dialog -s - 22/08/05 05:14 PM
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.
Posted By: Om3n Re: Help /dialog -s - 22/08/05 05:43 PM
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)
Posted By: Riamus2 Re: Help /dialog -s - 22/08/05 07:13 PM
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.
© mIRC Discussion Forums