Toggle menu
913
3.8K
30.2K
279.2K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

TabulationTextStyle class: Difference between revisions

From Catglobe Wiki
No edit summary
No edit summary
 
(6 intermediate revisions by one other user not shown)
Line 2: Line 2:
|Name=<nowiki>TabulationTextStyle</nowiki>
|Name=<nowiki>TabulationTextStyle</nowiki>
|Description=<nowiki>Styles for use on a portion of text</nowiki>
|Description=<nowiki>Styles for use on a portion of text</nowiki>
|InheritsFrom=object|Constructors=
|InheritsFrom=Array|Constructors=
{{CGscriptConstructors_Template|Description=<nowiki>Create a new TabulationTextStyle</nowiki>}}
{{CGscriptConstructors_Template|Description=<nowiki>Create a new TabulationTextStyle</nowiki>}}
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=bool|Name=<nowiki>isDefault</nowiki>|Description=<nowiki>load default text style</nowiki>}}
|Description=<nowiki>Create a default TabulationTextStyle</nowiki>}}
|Methods=
|Methods=
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
{{CGscriptMethods_Template|ReturnType=TabulationTextStyle|Name=<nowiki>Clone</nowiki>|Description=<nowiki>Deep copy TabulationTextStyle object</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
{{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>this[] { get; }</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>}}
|Description=<nowiki>Backward-compatible indexer</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>this[] { get; }</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to set</nowiki>}}
|Description=<nowiki>Backward-compatible indexer</nowiki>}}
|Properties=
|Properties=
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Average</nowiki>|HasGetter=1|Description=<nowiki>Average of the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Bold</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Bold to string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Bold</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Bold to string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=Color|Name=<nowiki>Color</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Color of string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=Color|Name=<nowiki>Color</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Color of string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>FontFace</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set FontFace of string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>FontFace</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set FontFace of string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>FontSize</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set FontSize of string in points.  Must be 1-400 points</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>FontSize</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set FontSize of string in points.  Must be 1-400 points</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsInherit</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set IsInherit.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Italic</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Italic to string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Italic</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Italic to string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Max</nowiki>|HasGetter=1|Description=<nowiki>Largest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Min</nowiki>|HasGetter=1|Description=<nowiki>Smallest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Sum</nowiki>|HasGetter=1|Description=<nowiki>Sum of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Underline</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Underline to string.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Underline</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set Underline to string.</nowiki>}}
|StaticMethods=
{{CGscriptMethods_Template|ReturnType=TabulationTextStyle|Name=<nowiki>TabulationTextStyle_getDefault</nowiki>|Description=<nowiki>Get default text style for diagram types</nowiki>}}
}}
}}


Line 22: Line 39:


<source lang="javascript">
<source lang="javascript">
//*** Set textStyle for paragraph ***//
TabulationParagraphStyle paragraphStyle = new TabulationParagraphStyle();
TabulationParagraphStyle paragraphStyle = new TabulationParagraphStyle();
paragraphStyle.Alignment = "center"; //left, right, center.
paragraphStyle.Alignment = "center"; //left, right, center.
Line 40: Line 59:


Tabulation_addParagraph(paragraph);
Tabulation_addParagraph(paragraph);
//new Tabulation().AddToBody(paragraph);
</source>
<source lang="javascript">
//*** Set textStyle for ColumnHeaderLevel2 (other diagramStyle still keep using from styleSheet) ***//
//** Use SetTableDiagramStyle ***//
TabulationDiagramParameter p = new TabulationDiagramParameter();
p.DataCacheId = 17116726;
TabulationTextStyle textStyle = new TabulationTextStyle(); 
//TabulationDiagramStyle diagramStyle = new TabulationDiagramStyle();
//TabulationTextStyle textStyle = diagramStyle.Text;
textStyle.Color = new Color ("red", false);
//print(Tabulation_getAvailableFonts());
textStyle.FontFace = "Comic Sans MS";
textStyle.FontSize = 8;
textStyle.Bold = true;
textStyle.Italic = true;
textStyle.Underline = true;
p.SetTableDiagramStyle(TableDiagram_ColumnHeaderLevel2,  TABLE_DIAGRAM_STYLE_FONT, textStyle);
Tabulation t = new Tabulation ();
t.StyleSheet = new ReportStyleSheet(11060624);
t.CreateCrossDiagram({"Rit_3"}, {"VilStemme"}, p);
</source>
[[File:2022-05-12_10-24-58.jpg]]
<br>
<br>
<source lang="javascript">
//*** Set textStyle for ColumnHeaderLevel2 (other diagramStyle if not set will using from default) ***//
//** Use SetDiagramStyle ***//
TabulationDiagramParameter p = new TabulationDiagramParameter();
p.DataCacheId = 17116726;
TabulationDiagramStyle diagramStyle = new TabulationDiagramStyle();
diagramStyle.Text.Color = new Color ("red", false);
//print(Tabulation_getAvailableFonts());
diagramStyle.Text.FontFace = "Comic Sans MS";
diagramStyle.Text.FontSize = 8;
diagramStyle.Text.Bold = true;
diagramStyle.Text.Italic = true;
diagramStyle.Text.Underline = true;
p.SetDiagramStyle(TableDiagram_ColumnHeaderLevel2, diagramStyle);
Tabulation t = new Tabulation ();
t.StyleSheet = new ReportStyleSheet(11060624);
t.CreateCrossDiagram({"Rit_3"}, {"VilStemme"}, p);
</source>
</source>
[[ File:2022-05-12 10-26-24.jpg]]

Latest revision as of 10:24, 28 May 2026

TabulationTextStyle


Styles for use on a portion of text

Parent class

Inherits from Array

Constructors

  • () - Create a new TabulationTextStyle
  • (bool isDefault "load default text style") - Create a default TabulationTextStyle

Methods

  • TabulationTextStyle Clone() - Deep copy TabulationTextStyle object
  • string ToString() - The string representation of the object.
  • object this[] { get; }(int index "Index") - Backward-compatible indexer
  • Empty this[] { get; }(int index "Index", object value "Value to set") - Backward-compatible indexer

Properties

  • number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
  • bool Bold { get; set; } - Get/Set Bold to string.
  • Color Color { get; set; } - Get/Set Color of string.
  • string FontFace { get; set; } - Get/Set FontFace of string.
  • int FontSize { get; set; } - Get/Set FontSize of string in points. Must be 1-400 points
  • bool IsInherit { get; set; } - Get/Set IsInherit.
  • bool Italic { get; set; } - Get/Set Italic to string.
  • number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
  • number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
  • string ObjectTypeName { get; } - The name of the type of object.
  • number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
  • TypeInformation TypeInformation { get; } - Get information about this class.
  • bool Underline { get; set; } - Get/Set Underline to string.

Static Methods

  • TabulationTextStyle TabulationTextStyle_getDefault() - Get default text style for diagram types

Relevant classes and function : TabulationParagraphStyle, TabulationParagraph, Tabulation_addParagraph

Examples

//*** Set textStyle for paragraph ***//

TabulationParagraphStyle paragraphStyle = new TabulationParagraphStyle();
paragraphStyle.Alignment = "center"; //left, right, center.

//TabulationTextStyle 
TabulationTextStyle textStyle = new TabulationTextStyle();
textStyle.Color = Color_getByName("red"); //Takes a color array-
//textStyle.Color = Color_getByRGB(255,0,0); // can also be set from rgb.
//textStyle.Color = new Color("red",false); // can also be set by Color object
textStyle.FontFace = "Bariol Regular";
textStyle.FontSize = 40; //1-399
textStyle.Bold = false;
textStyle.Italic = false;
textStyle.Underline = false;

TabulationParagraph paragraph = new TabulationParagraph(paragraphStyle);
paragraph.AddPortion("Some text", textStyle);

Tabulation_addParagraph(paragraph);
//new Tabulation().AddToBody(paragraph);
//*** Set textStyle for ColumnHeaderLevel2 (other diagramStyle still keep using from styleSheet) ***//
//** Use SetTableDiagramStyle ***//

TabulationDiagramParameter p = new TabulationDiagramParameter();
p.DataCacheId = 17116726;
TabulationTextStyle textStyle = new TabulationTextStyle();  
//TabulationDiagramStyle diagramStyle = new TabulationDiagramStyle();
//TabulationTextStyle textStyle = diagramStyle.Text;
textStyle.Color = new Color ("red", false);
//print(Tabulation_getAvailableFonts());
textStyle.FontFace = "Comic Sans MS";
textStyle.FontSize = 8;
textStyle.Bold = true;
textStyle.Italic = true;
textStyle.Underline = true;
p.SetTableDiagramStyle(TableDiagram_ColumnHeaderLevel2,  TABLE_DIAGRAM_STYLE_FONT, textStyle);
Tabulation t = new Tabulation ();
t.StyleSheet = new ReportStyleSheet(11060624);
t.CreateCrossDiagram({"Rit_3"}, {"VilStemme"}, p);



//*** Set textStyle for ColumnHeaderLevel2 (other diagramStyle if not set will using from default) ***//
//** Use SetDiagramStyle ***//

TabulationDiagramParameter p = new TabulationDiagramParameter();
p.DataCacheId = 17116726;
TabulationDiagramStyle diagramStyle = new TabulationDiagramStyle();
diagramStyle.Text.Color = new Color ("red", false);
//print(Tabulation_getAvailableFonts());
diagramStyle.Text.FontFace = "Comic Sans MS";
diagramStyle.Text.FontSize = 8;
diagramStyle.Text.Bold = true;
diagramStyle.Text.Italic = true;
diagramStyle.Text.Underline = true;
p.SetDiagramStyle(TableDiagram_ColumnHeaderLevel2, diagramStyle);
Tabulation t = new Tabulation ();
t.StyleSheet = new ReportStyleSheet(11060624);
t.CreateCrossDiagram({"Rit_3"}, {"VilStemme"}, p);