// Copyright (C) 1997-2004 Alias Systems Corp.
// 
// The information in this file is provided for the exclusive use of the
// licensees of Alias.  Such users have the right to use, modify,
// and incorporate this code into other products for purposes authorized
// by the Alias license agreement, without fee.
// 
// ALIAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
// EVENT SHALL ALIAS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
// CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.

//
//  Alias Script File
//  MODIFY THIS AT YOUR OWN RISK
//
//  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 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`;
	setParent $widgetList[0];
	$widgetList[5] = `rowLayout -numberOfColumns 2
			-adjustableColumn 2 -columnWidth 1 190
			-rowAttach 1 "both" 0 -columnAttach 1 "both" 0
			-rowAttach 2 "both" 0 -columnAttach 2 "both" 0`;
//	$widgetList[5] = `formLayout -visible true`;

	formLayout -edit
		-attachForm $widgetList[3] top 0 
		-attachForm $widgetList[3] right 0
		-attachForm $widgetList[3] left 0

		-attachControl $widgetList[5] top 0 $widgetList[3]
		-attachForm $widgetList[5] bottom 0
		-attachForm $widgetList[5] right 0
		-attachForm $widgetList[5] left 0
		$widgetList[0];

	setParent $widgetList[0];
	return ($widgetList);
}

global proc
loadAnimPanelLibrary ()
{
	// Load in the common menu elements library
	//
	loadAnimMenuLibrary;
}
