about making a drag and drop window with MEL Script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2005   #1
about making a drag and drop window with MEL Script

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
 
Old 09 September 2005   #2
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.
__________________
///:
Zhang Jian
zhang_mdev@163.com
zjprogramming.com
imaginecube.com
//:~

Last edited by zhang : 09 September 2005 at 07:39 AM.
 
Old 09 September 2005   #3
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
 
Old 09 September 2005   #4
Originally Posted by andylou17: 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.
__________________
BREAK
 
Old 09 September 2005   #5
I already found the script somebody in highend 3d wrote it
 
Old 09 September 2005   #6
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;
}
}
__________________
CaptainSam
 
Old 09 September 2005   #7
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:30 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.