// =========================================================================== // 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: 31 May 1997 // // Procedure Name: // toggleMenuBarsInAllPanels // // Description: // Turn the panel menus on or off. // // Input Arguments: // $state - 0 for off, 1 for on. // // Return Value: // None. // global proc toggleMenuBarsInAllPanels ( int $state ) { optionVar -iv allowMenusInPanels $state; global int $gUseMenusInPanels; $gUseMenusInPanels = $state; // Walk through all the panels and switch them // string $panels[] = `getPanel -allPanels`; string $panel; for ( $panel in $panels ) { // Don't toggle for the Material Viewer, since its menu bar visibility is fixed. // NOTE This also covered the ToggledOutliner but not the Outliner panel. // I could not find a reason for this, so I removed the ToggledOutliner check. if(`getPanel -typeOf $panel` != "scriptedPanel" || `scriptedPanel -q -type $panel` != "shaderBallPanel") { panel -e -mbv $state $panel; } } if($state == 0){ inViewMessage -amg (uiRes("m_toggleMenuBarsInAllPanels.kIvmHidePanelMenu")) -fade -pos topCenter; } }