CODE
//demo to highendn 27.1.06 repeated in 22.1.07
global proc showOut(){
paneLayout -e -cn "single" ChannelsLayersPaneLayout;
paneLayout -e -setPane ChannelsLayersOutliner 1 ChannelsLayersPaneLayout;
updateChannelsLayers();
}
global proc updateChannelsLayers()
// Update the Channel Box / Layer Editor area.
//
// Call this method to make sure the state of the Channel Box and
// Layer Editor buttons are in sync with the actual state of these
// components. This is only needed for the main (docked) window,
// NOT for the separate Layer Editor window.
//
{
global string $gChannelsLayersForm;
setParent $gChannelsLayersForm;
string $childArray[], $configuration, $pane;
// Determine the current pane layout configuration.
//
$configuration = paneLayout -query -configuration ChannelsLayersPaneLayout
;
int $channels = false, $layers = false, $both = false, $outliner= false;
int $attrEd = false, $tools = false;
if (isUIComponentVisible("Channel Box / Layer Editor")
){
if ("horizontal2" == $configuration) {
//
// If the pane layout configuration is split then both
// Channel Box and Layer Editor are visible.
//
$channels = false;
$layers = false;
$both = true;
} else if ("single" == $configuration) {
//
// If only one pane is visible the determine what is the visible
// pane. Not that due to order of creation the first child in the
// array is the Channel Box and the second is the Layer Editor.
// EDITY: a bit sloppy edit here switch woyuld be better joojaa
//
$pane = paneLayout -query -pane1 ChannelsLayersPaneLayout
;
$childArray = paneLayout -query -childArray ChannelsLayersPaneLayout
;
$both = false;
if ($pane == $childArray[0]) {
$channels = true;
$layers = false;
$outliner= false;
} else if ($pane == $childArray[1]){
$channels = false;
$layers = true;
$outliner= false;
} else {
$channels = false;
$layers = false;
$outliner= true;
}
} else {
error ("Unexpected pane layout configuration. " +
"Should be \"single\" or \"horizontal2\"");
return;
}
} else if (isUIComponentVisible("Attribute Editor")
) {
$attrEd = true;
} else if (isUIComponentVisible("Tool Settings")
) {
$tools = true;
}
// Update the check boxes.
//
iconTextCheckBox -edit -value $channels ChannelsLayersChannelsCheckBox;
iconTextCheckBox -edit -value $layers ChannelsLayersLayersCheckBox;
iconTextCheckBox -edit -value $both ChannelsLayersBothCheckBox;
iconTextCheckBox -edit -value $outliner ChannelsLayersOulineCheckBox;
// Update the enable state of the channel box buttons
//
if ($layers) {
symbolButton -edit -enable false cbManipsButton;
symbolButton -edit -enable false cbSpeedButton;
symbolCheckBox -edit -enable false cbHyperbolicButton;
} else {
initChannelBoxButtons;
}
}
global proc jooAddOutlinerToChannelbox()
{
global string $gChannelsLayersForm;
$butline = formLayout -query -childArray $gChannelsLayersForm
;
setParent ($gChannelsLayersForm+"|"+$butline[0]);
$array=layout -q -ca ($gChannelsLayersForm+"|"+$butline[0])
;
int $topSpacing = 0;
int $botSpacing = 1;
$outliner=iconTextCheckBox -cc "showOut()" -image1 "layers.xpm" -width 23 -height 23 -ann "OUTLINER" ChannelsLayersOulineCheckBox
;
formLayout -edit
-attachNone $outliner "top"
-attachControl $outliner "left" 0 $array[2]
-attachForm $outliner "bottom" $botSpacing
-attachNone $outliner "right"
($gChannelsLayersForm+"|"+$butline[0]);
setParent ChannelsLayersPaneLayout;
outlinerPanel -copy outlinerPanel ChannelsLayersOutliner;
}
jooAddOutlinerToChannelbox()
// this uses partly aliases code but thing is i add one more button to the top
// of the channelbox wich is used to activate outliner.
// alternative strategy is to make a panel that accepts 2 more panls