- 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();
- }