Home Technical Talk

Dockable window error maya

polycounter lvl 8
Offline / Send Message
Pinned
jayantbhatt007 polycounter lvl 8
Hi, I'm trying to create a dockable window but I couldn't figure it out. Check the code.



global proc  Nut() {

   if ( `window -exists "nameWindowss"` ) {
    deleteUI "nameWindowss"; windowPref -remove "nameWindowss";
    }
    
    
window -title "3DG NUT"  -s 1  -widthHeight 220 100 "nameWindowss"; 

	//--------------------------------------------------------------
	//Floating system
	//--------------------------------------------------------------
	int	$floating = 0;		// 0=docked		1=floating
	if(`optionVar -exists "NutToolsDocked"`)
	{
		if(`optionVar -q "NutToolsDocked"`)
			$floating = 0;
		else
			$floating = 1;
	}
	
	
		//--------------------------------------------------------------
	//window settigns
	//--------------------------------------------------------------
	string	$defaultDockArea	= "right";	// "top", "left", "bottom", "right";
		
	string 	$dock				= "dockNutTools";
	int 	$winw 				= 202 + 16;

	if( `dockControl -exists $dock` )
		deleteUI -control $dock;
		
		
		//Docking/Undocking
	columnLayout;
		string $floatform = `formLayout`;
		checkBox
				-l "Docked | Floating"
				-v 1 -ann "Docked/Floating window"
				-cc "NutToolsToggleDock"
				Nut_check_dock;
		setParent ..;

		formLayout -e
		-attachPosition  Nut_check_dock    left    0  36
		$floatform;

		if(`optionVar -exists "NutToolsDocked"`)
		{
			if(`optionVar -q "NutToolsDocked"`)
				checkBox -e -v 1 Nut_check_dock;
			else
				checkBox -e -v 0 Nut_check_dock;
		}
	setParent ..;



string $form = `formLayout`;
string $tabs = `tabLayout   -innerMarginWidth 30 -innerMarginHeight 30`;

     
 string $child0 = ` frameLayout -collapsable true -label "Screw" -cc "window -e -height 100 nameWindowss"  `;
         flowLayout -columnSpacing 1 -w 220 -h 100;
         // add the other controls
    		        
        symbolButton -w 35 -h 35 -image "3D_Ghost_Script/polyCylinder.png" -command "sample_Proc";
        symbolButton -w 35 -h 35 -image "3D_Ghost_Script/polyCylinder.png" -command "sample_Proc";
           
            setParent ..;        
            setParent ..;    

 string $child1 = `rowColumnLayout -numberOfColumns 5`;
         symbolButton -image "mayabutton.png" -command "sample_Proc";
         symbolButton -image "mayabutton.png" -command "sample_Proc";
          symbolButton -image "mayabutton.png" -command "sample_Proc";
         symbolButton -image "mayabutton.png" -command "sample_Proc";
         symbolButton -image "mayabutton.png" -command "sample_Proc";
         symbolButton -image "mayabutton.png" -command "sample_Proc";
         setParent ..;
         
string $child2 = `rowColumnLayout -numberOfColumns 3`;
         button; button; button;
         button; button; button;
         setParent ..;

     tabLayout -edit
         -tabLabel $child0  "     Screw    "   -tabLabel $child1 "     Nut    "   -tabLabel $child2 "     Pipe    "
         

         $tabs;

 showWindow;
  
}

 proc NutToolsToggleDock()
{
	if(!`checkBox -q -v Nut_check_dock`)
	{
		optionVar -intValue "NutToolsDocked" 0;
		print `optionVar -q "NutToolsDocked"`;
	}
	else
	{
		optionVar -intValue "NutToolsDocked" 1;
		print `optionVar -q "NutToolsDocked"`;
	}

	Nut();
}
Sign In or Register to comment.