XSIユーザーから観たMELスクリプトについて 其の九
ではwindow関係の最後にレイアウト関係を。
とりあえずMELの説明。
まずは行、列の扱い方。
window -title "レイアウト 1"; columnLayout; button -label "A"; rowLayout -numberOfColumns 2 -columnWidth2 20 20; button -label "B"; button -label "C"; setParent ..; rowLayout -numberOfColumns 3 -columnWidth3 20 20 20; button -label "D"; button -label "E"; button -label "F"; setParent ..; rowLayout -numberOfColumns 4 -columnWidth4 20 20 20 20; button -label "G"; button -label "H"; button -label "I"; button -label "J"; setParent ..; rowLayout -numberOfColumns 5 -columnWidth5 20 20 20 20 20; button -label "K"; button -label "l"; button -label "n"; button -label "M"; button -label "o"; setParent ..; showWindow;
「columnLayout」は行
「rowLayout」は列
これさえ覚えておけばどうとでもなりますね。
少しひっかかったのが、この部分
rowLayout -numberOfColumns 5 -columnWidth5 20 20 20 20 20;
列に5つ サイズが20Pxの物を配置します。
という文なんですが、少し戸惑いました。
で一応SI版も
var oP = XSIFactory.CreateObject( "CustomProperty" ); /////////////////////////////////////////////////////////////////////////////////// var oL, oItem;//空の宣言 oL = oP.PPGLayout;//PPGを追加 oL.AddGroup( "", true, 100 ); oItem = oL.AddButton( "A", "A" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oL.AddRow(); oItem = oL.AddButton( "B", "B" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "C", "C" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oL.EndRow(); oL.AddRow(); oItem = oL.AddButton( "D", "D" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "E", "E" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ) oItem = oL.AddButton( "F", "F" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oL.EndRow(); oL.AddRow(); oItem = oL.AddButton( "G", "G" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "H", "H" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ) oItem = oL.AddButton( "J", "J" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "K", "K" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oL.EndRow(); oL.AddRow(); oItem = oL.AddButton( "L", "L" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "N", "N" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ) oItem = oL.AddButton( "M", "M" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "O", "O" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oItem = oL.AddButton( "P", "P" ); oItem.SetAttribute( siUICX, 20 ); oItem.SetAttribute( siUICY, 20 ); oL.EndRow(); oL.EndGroup(); /////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////// //実行分 oL.Language = "JScript"; ///////////////////////////////////// InspectObj( oP, null, null, siLock );
はは。長いねw
けどこれはSIの方がわかりやすいかも。。。
WebとかでJavascriptに慣れてるのが最大の理由でしょうが。。。
こんな感じで行と列の扱い方でした。
次はWindow最後の部分として、
Formを使った応用版をやってみます。
では…