Indentation du texte COLBOXJ'utilise des colboxes à l'intérieur d'une tablebox.Les colboxes contiennent un ensemble de zones de texte, ce qui me permet de contrôler la couleur de premier plan et d'arrière-plan ainsi que la mise en gras du texte.Le problème est que le texte est trop proche du côté gauche de sa colonne.Voici un exemple où la première colonne est une colbox contenant des boîtes d'icônes, la seconde une chaîne de caractères colbox et la troisième une colbox contenant des zones de texte :

J'ai pu déplacer les boîtes d'icônes dans le Statut colonne sur l'utilisation << rembourrage (left10)) , mais à moins d'ajouter un ou deux espaces de début à la Exemple de texte colonne Je ne sais pas comment la déplacer un peu vers la droite.Le Nom de l'icône colonne est OK, car c'est un stringcolbox.Voici le 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 ));
Re : Indentation du texte COLBOXMerci Justin et Jim. La solution de la boîte à bordure est assez propre.Re : Indentation du texte COLBOXUn petit conseil. Vous pouvez appliquer le rembourrage à toutes les IconBoxes dans le ColBox en utilisant XPath au lieu de garder une trace des variables et d'envoyer les variables de remplissage à chacune.
Cela fait tout en une seule ligne:
(cb << Xpath( "//IconBox" )) << Padding( Left( 10 ) );
Re : Indentation du texte COLBOXvous pouvez ajouter une H List Box() et une Spacer Box() devant chaque Text Box() dans ColBox().

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 ) );Re : Indentation du texte COLBOXJe ferais cela en mettant un BorderBox autour de chacune des zones de texte. J'ai mis à jour votre exemple pour utiliser une fonction pour générer le BorderBox contenant un TextBox et a un rembourrage gauche de 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 ));

Edit : Correction d'une erreur dans mon code en raison du fait que les variables t(n) sont désormais une BorderBox.
Edit 2 : fait une autre modification pour mettre en surbrillance toute la cellule au lieu de simplement la zone de texte.