// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: November 6, 1996 // // Description: // This script defines the appearance for option box dialogs // // Input Arguments: // string $optionBoxTitle The title of the option box dialog // int $numPages The number of pages that this dialog // will display // string $options Options for this dialog // Option words are specified within the // the string, with each option seperated // by a space (e.g. "noScroll otherOption") // // Current options: // noOptions A nice "do nothing" string to pass // noScroll Make the tabLayout non-scrollable // // Return Value: // string[] where: // [0] Name of the window // [1] Name of the formLayout // [2] Name of the tabLayout // [3] Name of the help menu item // Note: add new return names below here // global proc string[] getStandardWindow (string $optionBoxTitle, int $numPages, string $options) { // Global variables... from getOptionBox // global string $gOptionBox; global string $gOptionBoxTabLayout; global string $gOptionBoxApplyBtn; global string $gOptionBoxResetBtn; global string $gOptionBoxCloseBtn; global string $gOptionBoxSaveBtn; global string $gOptionBoxOptions; $gOptionBoxOptions = $options; global int $gStandardWindowWidthIndex; string $widgetList[4]; // Get the new standard option box // string $optionBoxTab = getOptionBox(); string $optionBoxName = $gOptionBox; string $topLayoutName = "BoxLayout"; // See if the option box window already exists // if ( `window -exists $optionBoxName` ){ // It exists. // $widgetList[0] = $optionBoxName; // Put the new title on it // setOptionBoxTitle ($optionBoxTitle); // Create the new top level layout // setParent $optionBoxName; setParent $optionBoxTab; $widgetList[1] = `formLayout $topLayoutName`; // Get rid of the old content; add in the new layout // setParent $widgetList[1]; } else { error -showLineNumber 1 (uiRes("m_getStandardWindow.kNoOptionBoxWin")); } $widgetList[2] = `tabLayout -scrollable (match ("noScroll", $options) == "") -minChildWidth 100 -childResizable true`; if ($numPages < 2) { tabLayout -edit -tabsVisible false $widgetList[2]; } formLayout -edit -attachForm $widgetList[2] "top" 0 -attachForm $widgetList[2] "left" 0 -attachForm $widgetList[2] "bottom" 0 -attachForm $widgetList[2] "right" 0 $widgetList[1]; $widgetList[3] = getOptionBoxHelpItem(); menuItem -edit -label (uiRes("m_getStandardWindow.kHelpWith")) $widgetList[3]; return ($widgetList); }