Forums > MaxMSP

dropfile without region limiting.

August 14, 2006 | 1:15 pm

Hello ,
i ‘am looking for a dropfile like object without a region limited by the
object zone.
I whish to drag a file from the Windows XP or OSX file browser anywhere
in a max window.
Then choose the action to do withe the moustate object.
Is the dropfile customable for this feature ?
If i want to build my own object , do someone knows the way for
recuparate the filename in C language.

Moreover, i would like to build a dragfile object capatible with Windows
XP or OSX file browser.
Do somenone knows the fonction in C language for embark the filename in
the mouse pointer.

I hope that my english was comprehensible.

thanks in advance.

baptiste.DLG


August 14, 2006 | 1:56 pm

Quote: baptiste wrote on Mon, 14 August 2006 07:15
—————————————————-
> Hello ,
> i ‘am looking for a dropfile like object without a region limited by the
> object zone.
> I whish to drag a file from the Windows XP or OSX file browser anywhere
> in a max window.
> Then choose the action to do withe the moustate object.
> Is the dropfile customable for this feature ?

hmmm yes .. when you drag something into a maxpatch,
there is no mousemovement trackable in max, because the
mousemovement happens in finder .. i think you will have
to create multiple drag areas to get something like a
drag and drop behavior all over the patch.

or what about a grid of thousands of drag areas .. each
of 5×5 pixels size :)


August 14, 2006 | 4:25 pm

here is a solution that uses a simple javascript for zone detection in a patcher window. hope this can get you started.

Peter

=====BEGIN JS: zonedetect.js ================
/*
detects zones in your main interface using the mouse
the js is adapted from something similar I did. If you were to do this from scratch, you might do it differently! the nice
thing about all the if’s if that you aren’t far off from making each zone a toggle, if desired.
*/

//autowatch = 1;
outlets = 2;

var zone=0;

function where(x,y){
if(x>=0 && x< =100 && y>=0 && y< =100)
{
zone=1;
}
if(x>=101 && x< =200 && y>=0 && y< =100)
{
zone=2;
}
if(x>=201 && x< =300 && y>=0 && y< =100)
{
zone=3;
}
if(x>=0 && x< =100 && y>=101 && y< =200)
{
zone=4;
}
if(x>=101 && x< =200 && y>=101 && y< =200)
{
zone=5;
}
if(x>=201 && x< =300 && y>=101 && y< =200)
{
zone=6;
}
outlet(0,zone);

}
=====END JS: zonedetect.js ================

=====BEGIN max patch=======

#P window setfont Geneva 9.;
#P window linecount 1;
#P comment 472 443 219 196617 Shift key will multiply the zone number by 10!;
#P comment 447 406 183 196617 all zone detection is done is javascript;
#P window setfont "Sans Serif" 9.;
#P message 342 64 25 131137545 set;
#P window setfont Geneva 9.;
#P comment 258 434 71 196617 current zone:;
#P comment 30 307 219 196617 Shift key will multiply the zone number by 10!;
#P window setfont "Sans Serif" 9.;
#P newex 369 433 27 131137545 * 1;
#P newex 443 485 24 131137545 t 10;
#P newex 422 485 19 131137545 t 1;
#P newex 422 464 40 131137545 sel 0 1;
#P window setfont Geneva 9.;
#P number 468 466 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Geneva 12.;
#P window linecount 3;
#P comment 9 215 296 196620 Drag a file or folder onto a grey square. It will be prepended with the zone# on which you dropped it.;
#P window setfont "Sans Serif" 12.;
#P window linecount 0;
#P message 7 273 303 131137548;
#P window setfont Geneva 9.;
#P number 573 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 447 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 0 337 27 131137545 t l b;
#P newex 17 381 59 131137545 prepend set;
#P newex 17 361 38 131137545 v zone;
#P newex 0 441 59 131137545 prepend set;
#P newex 0 414 51 131137545 prepend x;
#P window setfont Geneva 9.;
#P comment 31 143 41 196617 ZONE 4;
#P comment 125 143 41 196617 ZONE 5;
#P comment 219 142 41 196617 ZONE 6;
#P comment 220 44 41 196617 ZONE 3;
#P comment 130 44 41 196617 ZONE 2;
#P comment 20 43 41 196617 ZONE 1;
#P user panel 198 99 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 99 99 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 0 99 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 198 0 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 99 0 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P newex 520 142 19 131137545 t 1;
#P newex 520 237 51 131137545 s shiftkey;
#P newex 520 208 49 131137545 change -1;
#P newex 520 162 51 131137545 qmetro 66;
#P newex 520 184 66 131137545 modifiers;
#P message 388 62 36 131137545 nopoll;
#P newex 384 104 78 131137545 s mainmouse_b;
#P newex 435 143 79 131137545 s mainmouse_y;
#P newex 401 123 79 131137545 s mainmouse_x;
#P newex 375 30 48 131137545 loadbang;
#P message 432 59 65 131137545 mode 1 , poll;
#P newex 385 82 66 131137545 mousestate;
#P user panel 0 0 100 100;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user dropfile 0 0 303 205 1;
#P window setfont Geneva 9.;
#P number 331 433 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 368 456 38 131137545 v zone;
#P newex 368 376 70 131137545 prepend where;
#P newex 617 317 32 131137545 sel 1;
#P newex 613 296 78 131137545 r mainmouse_b;
#P newex 368 316 48 131137545 pack 0 0;
#P newex 368 400 76 131137545 js zonedetect.js;
#P newex 486 295 79 131137545 r mainmouse_y;
#P newex 368 295 79 131137545 r mainmouse_x;
#P window setfont Geneva 9.;
#P window linecount 5;
#P comment 499 59 100 196617 important! mode 1 is relative to the patcher window , rather than the entire screen.;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 422 442 49 131137545 r shiftkey;
#P connect 11 0 40 0;
#P connect 39 0 36 0;
#P connect 40 0 36 0;
#P connect 36 0 37 0;
#P fasten 52 0 43 0 347 270 12 270;
#P fasten 37 0 43 0 5 464 -6 464 -6 270 12 270;
#P connect 40 1 38 0;
#P connect 38 0 39 0;
#P connect 4 0 10 0;
#P connect 15 0 52 0;
#P connect 2 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 4 0;
#P connect 49 0 9 0;
#P connect 4 0 49 0;
#P connect 13 0 18 0;
#P connect 19 0 13 0;
#P connect 14 0 13 0;
#P connect 47 0 49 1;
#P connect 48 0 49 1;
#P connect 13 1 16 0;
#P connect 3 0 5 1;
#P connect 0 0 46 0;
#P connect 46 0 47 0;
#P connect 15 0 14 0;
#P connect 13 2 17 0;
#P connect 46 1 48 0;
#P connect 2 0 41 0;
#P connect 0 0 45 0;
#P connect 15 0 24 0;
#P connect 24 0 21 0;
#P connect 21 0 20 0;
#P connect 20 0 22 0;
#P connect 22 0 23 0;
#P connect 3 0 42 0;
#P connect 6 0 7 0;
#P window clipboard copycount 55;

=====END max patch=======


August 15, 2006 | 10:23 am

baptiste wrote:
> Hello ,
> i ‘am looking for a dropfile like object without a region limited by the
> object zone.
> I whish to drag a file from the Windows XP or OSX file browser anywhere
> in a max window.

Just make it big enough (bigger than the window if necessary). Include
it into trhe background and lock the background, then you can patch on
top of it whatever you want…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


Viewing 4 posts - 1 through 4 (of 4 total)