COLBOXテキストの字下げ私はテーブルボックスの中でコルボックスを使っています。 コルボックスにはテキストボックスのセットが含まれており、これを使用して前景色と背景色、およびテキストの太字を制御できます。 問題は、テキストがその列の左側に近すぎることです。 次の例は、最初の列がアイコンボックスを含むコルボックス、2番目の列がテキストボックス、3番目の列がテキストボックスを含むコルボックスです。

アイコンボックスを移動することができました。状態使用上のコラム <<パディング(左10)) ただし、先頭に1〜2個のスペースを追加するだけでは不十分です。サンプルテキストコラムそれを少し右に動かす方法がわからない。 のアイコン名 stringcolboxなので、columnはOKです。 これがコードです:
nw = new window("Test Col Box Justification",
tb = table box(
cb = col box("Status",
i1 = icon box("Go"),
i2 = icon box("DebuggerRunWithoutBreakpoints"),
i3 = icon box("Locked"),
i4 = icon box("WinRelaunchAnalysis"),
i5 = icon box("Excluded"),
i6 = icon box("SASTableMeta"),
i7 = icon box("ColStack"),
i8 = icon box("DataTableBox"),
i9 = icon box("WinFileNewDT"),
i10 = icon box("SASExportData"),
),
sb = string col box("Icon Name", {"Go", "DebuggerRunWithoutBreakpoints",
"Locked", "WinRelaunchAnalysis", "Excluded", "SASTableMeta", "ColStack",
"DataTableBox", "WinFileNewDT", "SASExportData"}),
tcb = col box("Sample Text",
t1 = text box("The"),
t2 = text box("quick"),
t3 = text box("red"),
t4 = text box("fox"),
t5 = text box("jumped"),
t6 = text box("over"),
t7 = text box("the"),
t8 = text box("oak"),
t9 = text box("brown"),
t10 = text box("log"),
),
)
);
t1 << font color(51) << Set Font Style("Bold") << background color(73);
t3 << font color(51);
t9 << font color(54);
tb << set underline headings(1) << set column borders(1) << set row borders(1) << set shade alternate rows(1);
i1 << Padding( Left( 10 )); i2 << Padding( Left( 10 ));
i3 << Padding( Left( 10 )); i4 << Padding( Left( 10 ));
i5 << Padding( Left( 10 )); i6 << Padding( Left( 10 ));
i7 << Padding( Left( 10 )); i8 << Padding( Left( 10 ));
i9 << Padding( Left( 10 )); i10 << Padding( Left( 10 ));
再:COLBOXテキストの字下げJustinとJimに感謝します。ボーダーボックスソリューションはかなりきれいです。再:COLBOXテキストの字下げちょっとしたコツ。変数を追跡してそれぞれにPadding変数を送信する代わりに、XPathを使用してColBox内のすべてのIconBoxにパディングを適用できます。
これはすべて一行で行います。
(cb << Xpath( "//IconBox" )) << Padding( Left( 10 ) );
再:COLBOXテキストの字下げColBox()の各テキストボックス()の前にHリストボックス()とスペーサーボックス()を追加することができます。

nw = New Window( "Test Col Box Justification",
tb = Table Box(
cb = Col Box(
"Status",
i1 = Icon Box( "Go" ),
i2 = Icon Box( "DebuggerRunWithoutBreakpoints" ),
i3 = Icon Box( "Locked" ),
i4 = Icon Box( "WinRelaunchAnalysis" ),
i5 = Icon Box( "Excluded" ),
i6 = Icon Box( "SASTableMeta" ),
i7 = Icon Box( "ColStack" ),
i8 = Icon Box( "DataTableBox" ),
i9 = Icon Box( "WinFileNewDT" ),
i10 = Icon Box( "SASExportData" ),
),
sb = String Col Box( "Icon Name",
{"Go", "DebuggerRunWithoutBreakpoints", "Locked", "WinRelaunchAnalysis", "Excluded",
"SASTableMeta", "ColStack", "DataTableBox", "WinFileNewDT", "SASExportData"}
),
tcb = Col Box(
"Sample Text",
H List Box( Spacer Box( size( 5, 0 ) ), t1 = Text Box( "The" ) ),
t2 = Text Box( "quick" ),
t3 = Text Box( "red" ),
t4 = Text Box( "fox" ),
t5 = Text Box( "jumped" ),
t6 = Text Box( "over" ),
t7 = Text Box( "the" ),
t8 = Text Box( "oak" ),
t9 = Text Box( "brown" ),
t10 = Text Box( "log" ),
),
)
);
t1 << font color( 51 ) << Set Font Style( "Bold" ) << background color( 73 );
t3 << font color( 51 );
t9 << font color( 54 );
tb << set underline headings( 1 ) << set column borders( 1 ) << set row borders( 1 ) <<
set shade alternate rows( 1 );
i1 << Padding( Left( 10 ) );
i2 << Padding( Left( 10 ) );
i3 << Padding( Left( 10 ) );
i4 << Padding( Left( 10 ) );
i5 << Padding( Left( 10 ) );
i6 << Padding( Left( 10 ) );
i7 << Padding( Left( 10 ) );
i8 << Padding( Left( 10 ) );
i9 << Padding( Left( 10 ) );
i10 << Padding( Left( 10 ) );再:COLBOXテキストの字下げこれは、各テキストボックスの周囲にBorderBoxを配置して行います。TextBoxを含むBorderBoxを生成する関数を使用するように例を更新しました。左パディングは10です。
borderedText = Function( {txt},
Border Box( Left( 10 ), Text Box( txt ) )
);
nw = new window("Test Col Box Justification",
tb = table box(
cb = col box("Status",
i1 = icon box("Go"),
i2 = icon box("DebuggerRunWithoutBreakpoints"),
i3 = icon box("Locked"),
i4 = icon box("WinRelaunchAnalysis"),
i5 = icon box("Excluded"),
i6 = icon box("SASTableMeta"),
i7 = icon box("ColStack"),
i8 = icon box("DataTableBox"),
i9 = icon box("WinFileNewDT"),
i10 = icon box("SASExportData"),
),
sb = string col box("Icon Name", {"Go", "DebuggerRunWithoutBreakpoints",
"Locked", "WinRelaunchAnalysis", "Excluded", "SASTableMeta", "ColStack",
"DataTableBox", "WinFileNewDT", "SASExportData"}),
tcb = col box("Sample Text",
t1 = borderedText("The"),
t2 = borderedText("quick"),
t3 = borderedText("red"),
t4 = borderedText("fox"),
t5 = borderedText("jumped"),
t6 = borderedText("over"),
t7 = borderedText("the"),
t8 = borderedText("oak"),
t9 = borderedText("brown"),
t10 = borderedText("log"),
),
)
);
t1 << background color(73);
t1[Text Box(1)] << font color(51) << Set Font Style("Bold");
t3[Text Box(1)] << font color(51);
t9[Text Box(1)] << font color(54);
tb << set underline headings(1) << set column borders(1) << set row borders(1) << set shade alternate rows(1);
i1 << Padding( Left( 10 )); i2 << Padding( Left( 10 ));
i3 << Padding( Left( 10 )); i4 << Padding( Left( 10 ));
i5 << Padding( Left( 10 )); i6 << Padding( Left( 10 ));
i7 << Padding( Left( 10 )); i8 << Padding( Left( 10 ));
i9 << Padding( Left( 10 )); i10 << Padding( Left( 10 ));

編集:t(n)変数がBorderBoxになったことによる私のコードの間違いを修正しました。
編集2:テキストボックスだけでなく、セル全体を強調表示するようにもう1つ変更を加えました。