// Copyright (C) 1997-2014 Autodesk, Inc., and/or its licensors.
// All rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors,
// which is protected by U.S. and Canadian federal copyright law and by
// international treaties.
//
// The Data is provided for use exclusively by You. You have the right to use,
// modify, and incorporate this Data into other products for purposes authorized 
// by the Autodesk software license agreement, without fee.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. AUTODESK
// DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES
// INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT,
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE 
// OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS
// LICENSORS BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
// DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS
// LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.

//
//
//  Creation Date:  November 20, 1996
//
//  Description:
//      This script contains common menu definition routines shared
//	between the graph editor and the dope sheet.
//
//		A call to the proc 'loadAnimPanelLibrary' will make sure that
//	all the other helper procs defined in here are loaded and available
//
//	Procs defined within this script:
//
//  Input Arguments:
//      None.
//
//  Return Value:
//      None.
//

global proc string[]
definePanelElements (string $panel)
//
//	Procedure Name:
//		definePanelElements
//
//	Description:
//		This creates the common widgets for animation panels
//
//	Example:
//		Create a menu that this submenu is to be attached to
//	(make sure that the menu is defined to allow option boxes)
//
//		menuItem -label "Edit"
//			-allowOptionBoxes true
//			-subMenu true
//			editHierItem;
//			defineEditMenu $editor "editHierItem"; 
//		setParent -m ..;
//
//  Input Arguments:
//		string $panel			The name of the panel being created
//		string $parentMenu		The name of the parent menu that this
//								submenu is being attached to
//
//  Return Value:
//      string[] where:
//			[0]		Name of the container layout
//			[1]		Name of the menu frame
//			[2]		Name of the menu form
//			[3]		Name of the toolbar frame
//			[4]		Name of the toolbar form
//			[5]		Name of the toolbar flow layout
//			[6]		Name of the editor layout
//		Note: add new return names below here
//
{
	string $widgetList[];

	$widgetList[2] = `scriptedPanel -query -control $panel`;
	$widgetList[0] = `formLayout`;
	$widgetList[3] = `frameLayout -visible true -borderVisible false
			-labelVisible false -collapsable false -collapse true
			-borderStyle "in"`;
	$widgetList[4] = `formLayout -visible true`;
	$widgetList[5] = `flowLayout -visible true`;
	setParent $widgetList[0];
	$widgetList[6] = `paneLayout -configuration "vertical2" -staticWidthPane 1`;

	formLayout -edit
		-attachForm $widgetList[3] top 0 
		-attachForm $widgetList[3] right 0
		-attachForm $widgetList[3] left 0

		-attachControl $widgetList[6] top 0 $widgetList[3]
		-attachForm $widgetList[6] bottom 0
		-attachForm $widgetList[6] right 0
		-attachForm $widgetList[6] left 0
		$widgetList[0];

	setParent $widgetList[0];
	return ($widgetList);
}

global proc
loadAnimPanelLibrary ()
{
	// Load in the common menu elements library
	//
	loadAnimMenuLibrary;
}
