Difference between revisions of "TabulationBulletNumeric class"

From Catglobe Wiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=TabulationBulletNumeric
+
|Name=<nowiki>TabulationBulletNumeric</nowiki>
|Description=Settings for Numericbullets on paragraph
+
|Description=<nowiki>Settings for Numericbullets on paragraph</nowiki>
|Constructors=
+
|InheritsFrom=TabulationBullet|Constructors=
{{CGscriptConstructors_Template|Description=Create a new BulletSetting for a Numeric list}}
+
{{CGscriptConstructors_Template|Description=<nowiki>Create a new BulletSetting for a Numeric list</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=array|Name=Color|HasGetter=1|HasSetter=1|Description=Get/Set Color of bullets and numbers}}
+
{{CGscriptProperties_Template|ReturnType=Color|Name=<nowiki>Color</nowiki>|HasGetter=1|HasSetter=1|Inherited=TabulationBullet|Description=<nowiki>Get/Set Color of bullets and numbers</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=IsInList|HasGetter=1|HasSetter=1|Description=Get/Set if the paragraph is used in a list.}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsPrefixed</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set if the number is prefixed with parent numbers.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=IsPrefixed|HasGetter=1|HasSetter=1|Description=Get/Set if the number is prefixed with parent numbers.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Level</nowiki>|HasGetter=1|HasSetter=1|Inherited=TabulationBullet|Description=<nowiki>Get/Set Level of nesting of list element</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=Level|HasGetter=1|HasSetter=1|Description=Get/Set Level of nesting of list element}}
+
{{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=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>StartNumber</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Get/Set startnumber for this sequence - set to -1 for not set</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=StartNumber|HasGetter=1|HasSetter=1|Description=Get/Set startnumber for this sequence - set to -1 for not set}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
 
}}
 
}}
  
 +
Relevant Classes and function: [[TabulationParagraphStyle class|TabulationParagraphStyle]], [[TabulationTextStyle class|TabulationTextStyle]], [[TabulationParagraph class|TabulationParagraph]], [[Tabulation_addParagraph]]
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
  
Line 23: Line 23:
 
bulletNum.Level = 1;//Defines what level of the list we want the paragraph.  
 
bulletNum.Level = 1;//Defines what level of the list we want the paragraph.  
 
bulletNum.Color = Color_getByName("green");
 
bulletNum.Color = Color_getByName("green");
bulletNum.IsInList = true;//Defines if the bullet point is in a list.
 
 
 
bulletNum.StartNumber = 1;//The number the list should start with. Must only be set for the first element.  
 
bulletNum.StartNumber = 1;//The number the list should start with. Must only be set for the first element.  
 
bulletNum.IsPrefixed = false; //Indicates if the list in the pdf shoud prefix the number with higher levels ie: true: 1.1.2. false: 2.
 
bulletNum.IsPrefixed = false; //Indicates if the list in the pdf shoud prefix the number with higher levels ie: true: 1.1.2. false: 2.
  
 +
TabulationParagraphStyle paragraphStyle = new TabulationParagraphStyle();
 
paragraphStyle.SetBulletSetting(bulletNum);
 
paragraphStyle.SetBulletSetting(bulletNum);
Tabulation_addParagraph(new TabulationParagraph(paragraphStyle,"A numbered list item",textStyle));</source>
+
paragraphStyle.Alignment = "center"; //left, right, center.
 +
paragraphStyle.MarginTopPoints = 10; //0-400
 +
paragraphStyle.MarginLeftPoints = 10;//0-400
 +
 
 +
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);
 +
</source>

Latest revision as of 08:13, 2 July 2020

TabulationBulletNumeric


Settings for Numericbullets on paragraph

Parent class

Inherits from TabulationBullet

Constructors

  • () - Create a new BulletSetting for a Numeric list

Methods

  • (From object) string ToString() - The string representation of the object.

Properties

  • (From TabulationBullet) Color Color { get; set; } - Get/Set Color of bullets and numbers
  • bool IsPrefixed { get; set; } - Get/Set if the number is prefixed with parent numbers.
  • (From TabulationBullet) int Level { get; set; } - Get/Set Level of nesting of list element
  • string ObjectTypeName { get; } - The name of the type of object.
  • int StartNumber { get; set; } - Get/Set startnumber for this sequence - set to -1 for not set
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Relevant Classes and function: TabulationParagraphStyle, TabulationTextStyle, TabulationParagraph, Tabulation_addParagraph

Examples

TabulationBulletNumeric bulletNum = new TabulationBulletNumeric();
//For all bullet types
bulletNum.Level = 1;//Defines what level of the list we want the paragraph. 
bulletNum.Color = Color_getByName("green");
bulletNum.StartNumber = 1;//The number the list should start with. Must only be set for the first element. 
bulletNum.IsPrefixed = false; //Indicates if the list in the pdf shoud prefix the number with higher levels ie: true: 1.1.2. false: 2.

TabulationParagraphStyle paragraphStyle = new TabulationParagraphStyle();
paragraphStyle.SetBulletSetting(bulletNum);
paragraphStyle.Alignment = "center"; //left, right, center.
paragraphStyle.MarginTopPoints = 10; //0-400
paragraphStyle.MarginLeftPoints = 10;//0-400

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);