Interface ITagPainter
Interface implemented by components that provide customized rendering of tags in the edit control.
Namespace: Sdl.DesktopEditor.EditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface ITagPainter
Methods
DrawPlaceholderTag(Graphics, Rectangle, IPlaceholderNode, String)
Draw a placeholder node.
Declaration
void DrawPlaceholderTag(Graphics g, Rectangle boundingBox, IPlaceholderNode placeholderNode, string displayText)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The graphics context to use for drawing |
System.Drawing.Rectangle | boundingBox | The bounding rectangle, who's size was determined from a previous call to GetPlaceholderTagSize(Graphics, IPlaceholderNode, String, ref Int32, ref Int32). Any drawing operations should be limited to this area, or they may overlap with other content. |
IPlaceholderNode | placeholderNode | The node to be rendered |
System.String | displayText | The tag's display text according to current tag display settings. |
DrawStartEndTag(Graphics, Rectangle, IStartEndNode, String, Boolean)
Draw a start/end node.
Declaration
void DrawStartEndTag(Graphics g, Rectangle boundingBox, IStartEndNode startEndNode, string displayText, bool rtl)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The graphics context to use for drawing |
System.Drawing.Rectangle | boundingBox | The bounding rectangle, who's size was determined from a previous call to GetStartEndTagSize(Graphics, IStartEndNode, String, ref Int32, ref Int32). Any drawing operations should be limited to this area, or they may overlap with other content. |
IStartEndNode | startEndNode | The node to be rendered |
System.String | displayText | The tag's display text according to current tag display settings. |
System.Boolean | rtl | The local writing direction around the tag pair: true for rtl, false for ltr |
GetDisplayableTagText(String)
Gets the tag text that should be displayed on screen (eg, with line breaks, etc, removed).
Declaration
string GetDisplayableTagText(string tagText)
Parameters
Type | Name | Description |
---|---|---|
System.String | tagText |
Returns
Type | Description |
---|---|
System.String |
GetPlaceholderTagSize(Graphics, IPlaceholderNode, String, ref Int32, ref Int32)
Calculate the size of a placeholder node and and ascent and descent for the tag in relation to any text that appears on it.
Declaration
Size GetPlaceholderTagSize(Graphics g, IPlaceholderNode placeholderNode, string displayText, ref int ascent, ref int descent)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The graphics context to use for drawing |
IPlaceholderNode | placeholderNode | The node to be sized |
System.String | displayText | The tag's display text according to current tag display settings. |
System.Int32 | ascent | Ascent of the font family used for tag display text, adjusted for the location of the text within the returned size |
System.Int32 | descent | Descent of the font family used for tag display text, adjusted for the location of the text within the returned size |
Returns
Type | Description |
---|---|
System.Drawing.Size | The size of the (rectangular) area required to draw the tag. |
Remarks
The sum of ascent and descent should equal the tag height.
GetStartEndTagSize(Graphics, IStartEndNode, String, ref Int32, ref Int32)
Calculate the size of a start/end node and and ascent and descent for the tag in relation to any text that appears on it.
Declaration
Size GetStartEndTagSize(Graphics g, IStartEndNode startEndNode, string displayText, ref int ascent, ref int descent)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | The graphics context to use for drawing |
IStartEndNode | startEndNode | The node to be sized |
System.String | displayText | The tag's display text according to current tag display settings. |
System.Int32 | ascent | Ascent of the font family used for tag display text, adjusted for the location of the text within the returned size |
System.Int32 | descent | Descent of the font family used for tag display text, adjusted for the location of the text within the returned size |
Returns
Type | Description |
---|---|
System.Drawing.Size | The size of the (rectangular) area required to draw the tag. |
Remarks
The sum of ascent and descent should equal the tag height.