PDA

View Full Version : about making a drag and drop window with MEL Script


lewissatini
09-23-2005, 03:01 AM
I need help
is there anyone know how to make a drag and drop window that I can just drag my icon to the window and save it? and save the icon for the next use. also i can delete it the icon when it's not used

zhang
09-24-2005, 02:47 AM
You should try shelfLayout.

Creating a custom shelf in your window, you can drag-and-drop shelf ison/button from/to Maya's built-in shelf, you can save or delete the icons in your window. Each icon works as a normal shelf button.

lewissatini
09-24-2005, 07:25 AM
it's not that what i mean
i want to be like the menu when i work will full workspace my shelf is not there, so i have to find or create a menu that i can easily access. you know what i mean

Bonedaddy
09-24-2005, 07:34 AM
it's not that what i mean
i want to be like the menu when i work will full workspace my shelf is not there, so i have to find or create a menu that i can easily access. you know what i mean

Actually, I don't know what you mean.

If I understand you correctly, at the very least, you could probably jury-rig a shelfLayout to do something like that. I'm not sure it's really possible to do the drag-and-drop thing with MEL's GUI.

lewissatini
09-24-2005, 02:21 PM
I already found the script somebody in highend 3d wrote it

CaptainSam
09-24-2005, 02:45 PM
You need to add a -dragCallback to the element youre dragging, and a -dropCallback to the layout you're dragging it to. Like this:

global proc dropCallBackExample( string $dragControl, string $dropControl, string $msg[], int $x, int $y, int $type)
{
print "\ndropCallBackExample\n";
print $dragControl; print "\n";
print $dropControl;print "\n";
print $msg[0];print "\n";
print $x;print "\n";
print $y;print "\n";
print $type;print "\n";
}

// This proc MUST return something for drag/dropCallback to work
global proc string[] dragCallBackExample(string $dragControl, int $x, int $y, int $mods)
{
print "\ndragCallBackExample\n";
print $dragControl; print "\n";
print $x;print "\n";
print $y;print "\n";
print $mods;print "\n";
return{"need to return something here"};
}

global proc dropCallBackExampleWin()
{
window;
gridLayout -numberOfColumns 2 -cellWidthHeight 50 50;
button
-dragCallback dragCallBackExample
-dropCallback dropCallBackExample
button1;
button
-dragCallback dragCallBackExample
-dropCallback dropCallBackExample
button2;
showWindow;
}
}

CGTalk Moderation
09-24-2005, 02:45 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.