一、角度
rollout fu04 "角度测试"
(
angle fu01 "角度" color:red diameter:40 align:#center range:[-180,180,45] dir:#cw startdegrees:270
on fu01 changed a do box pos:[0,0,a]
)
createdialog fu04 120 110
二、位图
rollout fu06 "位图"
(
bitmap KK "" pos:[40,10] width:100 height:90 fileName:"G:\KK\Internet\Web\can_ora.gif"
)
createdialog fu06 180 110
三
utility my01 "checkbox"
--实用工具程序
(
checkbox mybox01 "点击这里"
on mybox01 changed theState do
messagebox ("checkbox state is "+theState as string)
)
四、
utility my02 "checkbutton"
--实用工具程序
(
checkbutton mybutton01 "check me"
on mybutton01 changed theState do
(
if theState ==true then
mybutton01.text="uncheck me"
else
mybutton01.text="check me"
)
五、标签
--用来在卷展栏中放置静态文本
rollout fu01 "标签"
(
label lab01 "这是一个标签!"
)
createdialog fu01 200 50
六、继承
a=box()
b=teapot pos:[100,0,0]
c=sphere pos:[-100,0,0]
a.parent=b--a的上级-父对象
b.parent=c
c.children--C的子对象
c.children.count--C的子对象的个数
select $Teapot01--选择teapot
animate on--可见性动画
(
at time 0 $sphere01.visibility=on
at time 40 $sphere01.visibility=off
at time 70 $sphere01.visibility=on
)
七、
rollout fu02 "进度条"
(
button doit "进度条过程!"--开始进度条
progressBar doit_prog color:red--红色进度条
on doit pressed do--点击按钮时
(
objArray=geometry as array--将所有的几何对象化成字符串数组
for i=1 to objArray.count-1 do--对每一个对象都执行下列脚本
(
doit_prog.value=100*i/objArray.count--更新进度条进度百分比
print objArray[i].name--打印几何体名称
)
--doit_prog.value=0 --进度条百分比重新设置为0
)
)
createdialog fu02 200 60
八、
utility my03 "radiobuttons"
(
--定义三个按钮,并且选中第一项
radiobuttons mybt02 labels:#("第一项","第二项","第三项") default:1
button setToNone "清除选项"
on settonone pressed do mybt02.state=0
)
九、
rollout fu02 "滑动条"
(
slider tilt "滑动" orient:#vertical ticks:5 range:[-30,30,0]--默认为横向滑动条
on tilt changed val do
x=teapot pos:[val*100,0,0]
)
createdialog fu02 120 110
十、
rollout fu03 "微调器"
(
spinner poschanged "微调"
on poschanged changed val do
(
selection.pos=[val*100,0,0]
)
)
createdialog fu03 200 50
十一、
utility fu04 "定时器"
(
timer clock "时钟" interval:400
label test "1"
on clock tick do
(
valup=(test.text as integer)+1
test.text=valup as string
)
)