// =========================================================================== // 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. // =========================================================================== // // Description: // Simple proc that restores the last panel that had focus. // Most often used when hiding/showing components in Maya's main // window. Doing so will remove focus from the panels. Calling // this procedure will ensure that focus is restored. // // Notes: // Required mainly for historical reasons because NT doesn't lose the // panel focus when items are made invisible or visible. // // Arguments: // None // global proc restoreLastPanelWithFocus() { string $lastPanelWithFocus = `getPanel -withFocus`; if ("" != $lastPanelWithFocus) { setFocus $lastPanelWithFocus; } }