Home Technical Talk
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

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.



  1. global proc Nut() {
  2.  
  3. if ( `window -exists "nameWindowss"` ) {
  4. deleteUI "nameWindowss"; windowPref -remove "nameWindowss";
  5. }
  6. window -title "3DG NUT" -s 1 -widthHeight 220 100 "nameWindowss";
  7.  
  8. //--------------------------------------------------------------
  9. //Floating system
  10. //--------------------------------------------------------------
  11. int $floating = 0; // 0=docked 1=floating
  12. if(`optionVar -exists "NutToolsDocked"`)
  13. {
  14. if(`optionVar -q "NutToolsDocked"`)
  15. $floating = 0;
  16. else
  17. $floating = 1;
  18. }
  19. //--------------------------------------------------------------
  20. //window settigns
  21. //--------------------------------------------------------------
  22. string $defaultDockArea = "right"; // "top", "left", "bottom", "right";
  23. string $dock = "dockNutTools";
  24. int $winw = 202 + 16;
  25.  
  26. if( `dockControl -exists $dock` )
  27. deleteUI -control $dock;
  28. //Docking/Undocking
  29. columnLayout;
  30. string $floatform = `formLayout`;
  31. checkBox
  32. -l "Docked | Floating"
  33. -v 1 -ann "Docked/Floating window"
  34. -cc "NutToolsToggleDock"
  35. Nut_check_dock;
  36. setParent ..;
  37.  
  38. formLayout -e
  39. -attachPosition Nut_check_dock left 0 36
  40. $floatform;
  41.  
  42. if(`optionVar -exists "NutToolsDocked"`)
  43. {
  44. if(`optionVar -q "NutToolsDocked"`)
  45. checkBox -e -v 1 Nut_check_dock;
  46. else
  47. checkBox -e -v 0 Nut_check_dock;
  48. }
  49. setParent ..;
  50.  
  51.  
  52.  
  53. string $form = `formLayout`;
  54. string $tabs = `tabLayout -innerMarginWidth 30 -innerMarginHeight 30`;
  55.  
  56. string $child0 = ` frameLayout -collapsable true -label "Screw" -cc "window -e -height 100 nameWindowss" `;
  57. flowLayout -columnSpacing 1 -w 220 -h 100;
  58. // add the other controls
  59. symbolButton -w 35 -h 35 -image "3D_Ghost_Script/polyCylinder.png" -command "sample_Proc";
  60. symbolButton -w 35 -h 35 -image "3D_Ghost_Script/polyCylinder.png" -command "sample_Proc";
  61. setParent ..;
  62. setParent ..;
  63.  
  64. string $child1 = `rowColumnLayout -numberOfColumns 5`;
  65. symbolButton -image "mayabutton.png" -command "sample_Proc";
  66. symbolButton -image "mayabutton.png" -command "sample_Proc";
  67. symbolButton -image "mayabutton.png" -command "sample_Proc";
  68. symbolButton -image "mayabutton.png" -command "sample_Proc";
  69. symbolButton -image "mayabutton.png" -command "sample_Proc";
  70. symbolButton -image "mayabutton.png" -command "sample_Proc";
  71. setParent ..;
  72. string $child2 = `rowColumnLayout -numberOfColumns 3`;
  73. button; button; button;
  74. button; button; button;
  75. setParent ..;
  76.  
  77. tabLayout -edit
  78. -tabLabel $child0 " Screw " -tabLabel $child1 " Nut " -tabLabel $child2 " Pipe "
  79.  
  80. $tabs;
  81.  
  82. showWindow;
  83. }
  84.  
  85. proc NutToolsToggleDock()
  86. {
  87. if(!`checkBox -q -v Nut_check_dock`)
  88. {
  89. optionVar -intValue "NutToolsDocked" 0;
  90. print `optionVar -q "NutToolsDocked"`;
  91. }
  92. else
  93. {
  94. optionVar -intValue "NutToolsDocked" 1;
  95. print `optionVar -q "NutToolsDocked"`;
  96. }
  97.  
  98. Nut();
  99. }
Sign In or Register to comment.