// =========================================================================== // 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: Aug 15 1996 // // Description: // This script initializes the Help line. Initialization involves // determining the initial Help line preferences, creating the UI and // setting the initial visibility. // { // Declare referenced or returned globals. // global string $gHelpLineForm; global string $gMainProgressBar; global string $gMainAuxButton; global string $gMainAuxText; // Create a layout appropriate for the Help line. // string $helpLine = `frameLayout -parent $gHelpLineForm -borderVisible false -labelVisible false -collapse false -collapsable false helpLineFrame`; string $innerForm = `formLayout -parent $helpLine`; // Now actually create the Help line. // string $helpControl = `helpLine -annotation (uiRes("m_initHelpLine.kHelpLineAnnot"))`; // Now create the embedded progressbar // $gMainProgressBar = `progressBar -isMainProgressBar true -visible false -width 1 -height 10 mainProgressBar`; formLayout -edit -af $helpControl "top" 0 -ac $helpControl "left" 0 $gMainProgressBar -af $helpControl "bottom" 0 -af $helpControl "right" 0 -af $gMainProgressBar "left" 2 -af $gMainProgressBar "top" 4 -af $gMainProgressBar "bottom" 3 -an $gMainProgressBar "right" $innerForm; // Now create the auxillary embedded button and text field // - height was chosen so that when shown the main help line does not grow up // string $innerAuxForm = `formLayout -parent $innerForm`; $gMainAuxButton = `button -visible false -height 8`; $gMainAuxText = `textField -visible false -editable false -width 240 -height 10`; formLayout -edit -af $gMainAuxButton "top" 1 -an $gMainAuxButton "left" -af $gMainAuxButton "bottom" 1 -af $gMainAuxButton "right" 1 -af $gMainAuxText "top" 2 -an $gMainAuxText "left" -af $gMainAuxText "bottom" 2 -ac $gMainAuxText "right" 5 $gMainAuxButton $innerAuxForm; formLayout -edit -af $innerAuxForm "top" 0 -an $innerAuxForm "left" -af $innerAuxForm "bottom" 0 -af $innerAuxForm "right" 15 $innerForm; // Attach Help line to parent. // global int $gPanelHandleOffset; formLayout -edit -attachForm $helpLine "top" 0 -attachForm $helpLine "left" $gPanelHandleOffset -attachForm $helpLine "bottom" 0 -attachForm $helpLine "right" 0 $gHelpLineForm; setUIComponentStateCallback( "Help Line", "helpLineVisibilityStateChange"); // Set the initial height of the Help Line in the main window. // string $helpLineWorkspaceControl = getUIComponentToolBar("Help Line", false); workspaceControl -e -initialHeight 20 -heightProperty "fixed" $helpLineWorkspaceControl; // Set the Help line's initial visibility. // setHelpLineVisible(`optionVar -query helpLineVisible`); } global proc helpLineShowAuxWidgets( int $show, string $buttonName, string $buttonCommand, int $textWidth ) { global string $gMainAuxButton; global string $gMainAuxText; button -edit -visible $show -command $buttonCommand -label $buttonName $gMainAuxButton; textField -edit -visible $show -width $textWidth $gMainAuxText; } global proc helpLineEnableAuxButton( int $enable ) { global string $gMainAuxButton; button -edit -enable $enable $gMainAuxButton; } global proc helpLineSetAuxInfoField( string $text ) { global string $gMainAuxText; textField -edit -text $text $gMainAuxText; } global proc int helpLineVisibilityStateChange( int $newState, string $layout) // // Description: // This procedure is called whenever the visibility state of the // Help Line is changed. // // Arguments: // newState - The new visibile state of the Help Line. // // layout - The parent layout for the Help Line. // // Returns: // true - If the change of state is to be allowed. // // false - If the state change is rejected. // { int $result = true; // Defer these commands because this proc is called when the visibility // state is about to change. This proc must return true to accept // the state change. After this proc returns then restore the // panel focus and update the pref menu. // evalDeferred("restoreLastPanelWithFocus(); updatePrefsMenu();"); return $result; }