Beruflich Dokumente
Kultur Dokumente
/*
* cometAttrEditor() - Main Entry
*/
global proc cometAttrEditor()
{
if (`window -q -ex cometAttrEditorWin`)
{
showWindow cometAttrEditorWin ;
return ;
}
formLayout mainForm ;
formLayout -e
mainForm ;
showWindow cometAttrEditorWin ;
// --------------------------------------------------------------------------
/*
* cAE_moveAttrs() - Adjust attrs
*/
global proc cAE_moveAttrs(int $dir)
{
string $obj ;
for ($obj in $cbObjs)
{
if ($dir == 0) // Work top to bottom if moving up
{
for ($i=0; $i < size($cbAttrs); ++$i)
cAE_moveAttr($obj, $cbAttrs[$i], $dir) ;
}
else if ($dir == 1) // Work bottom to top moving down
{
for ($i=size($cbAttrs)-1; $i >= 0; --$i)
cAE_moveAttr($obj, $cbAttrs[$i], $dir) ;
}
// --------------------------------------------------------------------------
/*
* cAE_moveAttr() - Adjust one attr specified up or down.
* $dir: 0=up 1=down
*/
global proc cAE_moveAttr(string $obj, string $attr, int $dir)
{
string $udAttrs[] = `listAttr -ud $obj` ; // Get just user defined ones.
int $i ;
// First find out where in the order of all the user defined attrs this one is.
int $idx = -1 ;
for ($i=0; $i < size($udAttrs); ++$i)
{
if ($udAttrs[$i] == $attr)
{
$idx = $i;
break ;
}
}
// --------------------------------------------------------------------------
/*
* cAE_dropToBottom() - Drop an attr to bottom by rename and back
*/
global proc cAE_dropToBottom(string $obj, string $attr)
{
renameAttr ($obj+"."+$attr) ($attr+"TEMPREN") ; // there
renameAttr ($obj+"."+$attr+"TEMPREN") ($attr) ; // and back again
}
// --------------------------------------------------------------------------