// =========================================================================== // 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: Oct 1999 // // // // // // // createNewShelf // // // int : 1 if a shelf tab was created, otherwise 0 // // // Create an empty new shelf tab. Prompt the user for the name. // If the name is invalid then it will re-prompt until the user cancels. // // // None. // // // createNewShelf; // // global proc int createNewShelf() { int $returnStatus = false; int $tryAgain = true; while ($tryAgain) { string $ok = (uiRes("m_createNewShelf.kOk")); string $cancel = (uiRes("m_createNewShelf.kCancel")); string $result = `promptDialog -title (uiRes("m_createNewShelf.kCreateNewShelf")) -message (uiRes("m_createNewShelf.kNewShelfName")) -button $ok -button $cancel -defaultButton $ok -cancelButton $cancel -dismissString $cancel`; // If the result was "OK", then proceed // if ( $result == $ok ) { string $shelfName = `promptDialog -q`; if (validateShelfName($shelfName)) { addNewShelfTab $shelfName; $returnStatus = true; $tryAgain = false; } else { $returnStatus = false; } } else { $tryAgain = false; } } return $returnStatus; }