"rowFontType"
Sets font types per line in a table at runtime. The attribute rowFontType is used in connection with appendLine, appendLines, updateLine, updateLines and insertLineN.
Synopsis
Table.rowFontType(dyn_int rows, dyn_int fonttypes);
Parameters
Parameter | Description |
---|---|
rows | The number of the row, for example, 1 |
fonttypes |
The font type. There are 4 different font types available: 0 - Normal (default) 1 - Bold 2 - Italic 3 - Italic bold |
Description
Used to set the font for a row in a table at runtime.
All fonts cannot be displayed in italic type under Linux. If you want to display a font in italic type under Linux, choose a font such as Adobe Helvetica that can be displayed in italic type.
Example
This example adds rows to a table with appendLine and then sets the fonts for the rows through rowFontType. A button is used to set the fonts in the table. The first code example below will be executed when the panel containing the table opens (add the code to the Initialize of a table). The second code sample sets the fonts for the rows and is executed when a button is clicked (Clicked). You have to create a table "Table1" containing the columns "Name" and "Last name".
main()
{
Table1.appendLine("Name","Peter", "Last name","Bauer");
/*Adds the line Matt Davis. "Name" and "Last name" are the names of the table columns */
Table1.appendLine("Name","Martin","Last name","Müller");
Table1.appendLine("Name","Christian","Last name","Schmidt");
Table1.appendLine("Name","Maria","Last name","Mayer");
}
Sets the fonts for the rows when a button is clicked. Add the code to the "Clicked" event of a button.
main()
{
dyn_int rows, type;
rows[1] = 1;
rows[2] = 2;
rows[3] = 3;
type[1] = 1; //font type bold
type[2] = 2; //font type italic
type[3] = 3;
//font type italic bold
Table1.rowFontType(rows,type);
/* changes the font of the second row to bold, the font of the third row to italic
and the font of the fourth row to italic bold */
}
Assignment
Table