// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // updatePrefsMenu // // Description: // Ensure that the check boxes that control the visibility of // the main window UI components are in sync with the actual // visibility of those components. // // Input Arguments: // None // // Return Value: // None. // global proc updatePrefsMenu() { global string $gMainOptionsMenu; // Only update the menu if it exists if (`menu -exists $gMainOptionsMenu` && `menu -query -numberOfItems $gMainOptionsMenu` > 0) { setParent -menu $gMainOptionsMenu; // Query the visibility of the main window UI components. // int $visShelf = isUIComponentVisible("Shelf"); int $visStatusLine = isUIComponentVisible("Status Line"); int $visTimeSlider = isUIComponentVisible("Time Slider"); int $visPlaybackRange = isUIComponentVisible("Range Slider"); int $visCommandLine = isUIComponentVisible("Command Line"); int $visHelpLine = isUIComponentVisible("Help Line"); int $visToolbox = isUIComponentVisible("Tool Box"); // Now update the menu item check boxes. // menuItem -edit -checkBox $visStatusLine statusLineItem; menuItem -edit -checkBox $visShelf shelfItem; menuItem -edit -checkBox $visTimeSlider timelineItem; menuItem -edit -checkBox $visPlaybackRange playbackRangeItem; menuItem -edit -checkBox $visCommandLine commandLineItem; menuItem -edit -checkBox $visHelpLine helpLineItem; menuItem -edit -checkBox $visToolbox toolboxItem; } }