2010年9月19日

发几个常用窗口代码,需要的可以取用2

5.文本text的MEL应用;



global proc nrCreateYaoTestWindow(){ string $nrWindowName
= "YaoTestWindow"; if(`window -exists
$nrWindowName`) deleteUI
$nrWindowName; if(`windowPref -exists
$nrWindowName`) windowPref -remove
$nrWindowName; $nrWindowName = `window -t "YaoTestWindow"
-s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0
-tlb 0 -rtf 1 -mnc
"" -rc ""
$nrWindowName`;
string $newObject1 = `formLayout -en
1 -w 262 -h 354 -nd 100
formLayout91`;
string $newObject2 = `text -en 1 -w 26 -h 16 -l "文本" -al "left" -fn
"plainLabelFont" -rs 1
text2`;
formLayout -e -attachPosition $newObject2 "top" 4 0 -attachPosition $newObject2
"left" 8 0 $newObject1; setParent
..; showWindow $nrWindowName;}nrCreateYaoTestWindow;



6.勾选主要语法及flag可以参见help中checkBox的MEL;

global proc nrCreateYaoTestWindow(){ string $nrWindowName = "YaoTestWindow"; if(`window -exists $nrWindowName`) deleteUI $nrWindowName; if(`windowPref -exists $nrWindowName`) windowPref -remove $nrWindowName; $nrWindowName = `window -t "YaoTestWindow" -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1 -mnc "" -rc "" $nrWindowName`; string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`; string $newObject2 = `checkBox -en 1 -w 84 -h 16 -l "Yes" -al "left" -v 0 -ed 1 -rs 1 checkBox36`; formLayout -e -attachPosition $newObject2 "top" 6 0 -attachPosition $newObject2 "left" 12 0 $newObject1; string $newObject3 = `checkBox -en 1 -w 84 -h 16 -l "No" -al "left" -v 0 -ed 1 -rs 1 checkBox37`; formLayout -e -attachPosition $newObject3 "top" 6 0 -attachPosition $newObject3 "left" 116 0 $newObject1; setParent ..; showWindow $nrWindowName;}nrCreateYaoTestWindow;






7.文本输入框注意textField的用法,很容易和intSliderGrp中的-field混淆;


global proc nrCreateYaoTestWindow(){ string $nrWindowName = "YaoTestWindow"; if(`window -exists $nrWindowName`) deleteUI $nrWindowName; if(`windowPref -exists $nrWindowName`) windowPref -remove $nrWindowName; $nrWindowName = `window -t "YaoTestWindow" -s 1 -tb 1 -mnb 1 -mxb 1 -mb 0 -mbv 0 -tlb 0 -rtf 1 -mnc "" -rc "" $nrWindowName`; string $newObject1 = `formLayout -en 1 -w 262 -h 354 -nd 100 formLayout91`; string $newObject2 = `textField -en 1 -w 150 -h 22 -tx "" -fn "plainLabelFont" -ed 1 -ec "" -rfc "" textField140`; formLayout -e -attachPosition $newObject2 "top" 3 0 -attachPosition $newObject2 "left" 57 0 $newObject1; setParent ..; showWindow $nrWindowName;}nrCreateYaoTestWindow;









沒有留言:

張貼留言