Einrückung des COLBOX-TextesIch verwende Colboxes innerhalb einer Tablebox.Die Colboxen enthalten eine Reihe von Textfeldern, mit denen ich die Vorder- und Hintergrundfarbe sowie die Fettschrift des Textes steuern kann.Das Problem ist, dass der Text zu nahe an der linken Seite seiner Spalte steht.Hier ist ein Beispiel, bei dem die erste Spalte eine Colbox mit Symbolfeldern, die zweite eine Stringcolbox und die dritte eine Colbox mit Textfeldern ist:

Ich konnte die Icon-Boxen in der verschieben Status Spalte über Verwendung << Polsterung(links10)) , aber ohne ein oder zwei führende Leerzeichen hinzuzufügen Beispieltext Spalte Ich weiß nicht, wie ich sie etwas nach rechts verschieben soll.Der Symbolname Spalte ist in Ordnung, da es sich um eine Stringcolbox handelt.Hier ist der Code:
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 ));
Betreff: Einrückung von COLBOX-TextDanke Justin und Jim. Die Borderbox-Lösung ist ziemlich sauber.Betreff: Einrückung von COLBOX-TextEin kurzer Tipp. Sie können die Auffüllung auf alle IconBoxes in der ColBox anwenden, indem Sie XPath verwenden, anstatt die Variablen zu verfolgen und die Padding-Variablen an jede einzelne zu senden.
Das alles in einer Zeile:
(cb << Xpath( "//IconBox" )) << Padding( Left( 10 ) );
Betreff: Einrückung von COLBOX-TextSie können ein H List Box() und ein Spacer Box() vor jedem Text Box() in der ColBox() hinzufügen.

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 ) );Betreff: Einrückung von COLBOX-TextIch würde dies tun, indem ich eine BorderBox um jedes der Textfelder setze. Ich habe Ihr Beispiel aktualisiert, um eine Funktion zum Generieren der BorderBox zu verwenden, die eine TextBox enthält und eine linke Auffüllung von 10 hat.
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 ));

Bearbeiten: Einen Fehler in meinem Code behoben, der darauf zurückzuführen ist, dass die t(n)-Variablen jetzt eine BorderBox sind.
Bearbeiten 2: Eine weitere Änderung vorgenommen, um die gesamte Zelle hervorzuheben, anstatt nur die TextBox.