Curl
 

Menu
 Chapter.1
 Chapter.2
 Chapter.3
 Chapter.4
 Chapter.5
 Chapter.6
 Chapter.7
 Chapter.8
 Chapter.9
 Chapter.10
 
 
■Elasticクラスの使用

Elasticのプロパティについては、言葉で説明するよりも具体例を示すほうが簡単です。
次に紹介するリストではでは赤色の(左側の)バーのユーザー設定サイズが2cm、伸長係数が50に設定されているのに対して、青色の(右側の)バーのユーザー設定サイズは4cm、伸長係数は100に設定されています。

【伸長係数の例】

{curl 6.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}
{let red-elastic:Elastic = {make-elastic
minimum-size = 2cm,
preferred-size = 2cm,
stretchiness = 50
}
}
{let blue-elastic:Elastic = {make-elastic
minimum-size = 1cm,
preferred-size = 4cm,
stretchiness = 100
}
}
赤: 最小サイズ=2, ユーザー設定サイズ=2, 伸長係数=50 {br}
青: 最小サイズ=1, ユーザー設定サイズ=4, 伸長係数=100 {br}
{HBox width =2cm,
{Frame width = red-elastic, height=3mm,background="red"},
{Frame width = blue-elastic, height=3mm,background="blue"}
}
{br}
{HBox width =3cm,
{Frame width = red-elastic, height=3mm,background="red"},
{Frame width = blue-elastic, height=3mm,background="blue"}
}
{br}
{HBox width =5cm,
{Frame width = red-elastic, height=3mm,background="red"},
{Frame width = blue-elastic, height=3mm,background="blue"}
}
{br}
{HBox width =6cm,
{Frame width = red-elastic, height=3mm,background="red"},
{Frame width = blue-elastic, height=3mm,background="blue"}
}
{br}
{HBox width =9cm,
{Frame width = red-elastic, height=3mm,background="red"},
{Frame width = blue-elastic, height=3mm,background="blue"}
}
{br}
|| 1cm単位で交互に色が変わるルーラーを描きます。
{HBox
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm},
{Fill background="red", height=3mm, width=1cm},
{Fill background="blue", height=3mm, width=1cm}
}
{br}



Chapter.9(Part.1)へ戻る
Chapter.9(Part.3)へ進む