次のスクリプトは、さまざまなユーザ インタフェース要素での値表示に使用されるテスト ベッドです。このスクリプトは、ユーザにフィードバックをもたらすための、UI プロパティの更新方法を示すことを目的としています。
このコードを新しいスクリプト エディタへコピーし、[Ctrl] + [E]を押して評価します。 続いて、[Generate New RANDOM Value]を複数回押して、ロールアウトに値を表示するさまざまなメソッドを確認します。
スクリプト:
rollout test_digits "Display Values" ( group "Display" ( spinner spinner_item "The Value:" range:[0,1000,0] align:#center fieldwidth:50 edittext edit_text_item "The Value:" text:""width:100 align:#center button button_item "No Value" width:100 align:#center label label_item "No Value" align:#center progressbar progress_bar_item height:10 width:180 color:(color 255 100 100) orient:#horizontal listbox list_box_item items:#() ) button start_test "Generate New RANDOM Value..." progressbar progress_bar2_item height:90 width:10 color:(color 255 100 100) orient:#vertical pos:[12,20] on start_test pressed do ( minValue = 0 maxValue = 100 theValue = random minValue maxValue sliderTime = theValue spinner_item.value = theValue edit_text_item.text = theValue as string button_item.text = theValue as string label_item.text = theValue as string progress_bar_item.value = 100.0*theValue/maxValue progress_bar_item.color = color (255.0*theValue/maxValue) 128 0 progress_bar2_item.value = 100.0*theValue/maxValue list_box_item.items = append list_box_item.items ("Value is now "+theValue as string) list_box_item.selection = list_box_item.items.count )--end on )--end rollout createDialog test_digits 200 300