// =========================================================================== // 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: 29 Sept 1996 // // Description: // This file contains a proc that interactively asks a user for a tab label // and sets the label of the active tab on the given tab layout to be that. // Most logical use for this script is to attach as the double click command // onto a tab layout - that way, double clicking on any tab in the layout // will allow the user to change its label. global proc setActiveTabLabel (string $tabLayout) // // Procedure Name: // setActiveTabLabel // // Description: // proc to set the active tab in a layout to a value input by the user. // // Input Arguments: // $tabLayout - the tabLayout name // // Return Value: // None. // { // get the active tab information string $activeTab = `tabLayout -q -selectTab $tabLayout`; int $activeTabIndex = `tabLayout -q -selectTabIndex $tabLayout`; string $ok = (uiRes("m_setActiveTabLabel.kOk")); string $cancel = (uiRes("m_setActiveTabLabel.kCancel")); string $exitVal = `promptDialog -title (uiRes("m_setActiveTabLabel.kRenameTab")) -message (uiRes("m_setActiveTabLabel.kEnterTabLabel")) -button $ok -button $cancel -defaultButton $ok -cancelButton $cancel -dismissString $cancel`; if( $exitVal == $ok ){ string $nuLabel = `promptDialog -q`; tabLayout -e -tabLabel $activeTab $nuLabel $tabLayout; } }