C# Class Xwt.Drawing.TextLayout

Inheritance: XwtObject, IDisposable
ファイルを表示 Open project: TheBrainTech/xwt Class Usage Examples

Private Properties

Property Type Description
GetData TextLayoutData
InitForToolkit void
Setup void
TextLayout System

Public Methods

Method Description
AddAttribute ( Xwt.Drawing.TextAttribute attribute ) : void
ClearAttributes ( ) : void
Dispose ( ) : void
GetCoordinateFromIndex ( int index ) : System.Point

Obtains the graphical coordinate of an character in the layout.

GetIndexFromCoordinates ( System.Point p ) : int

Converts from a Position within the layout to the character at this position.

GetIndexFromCoordinates ( double x, double y ) : int

Converts from a X and Y position within the layout to the character at this position.

GetSize ( ) : Size

measures the text if Width is other than -1, it measures the height according to Width Height is ignored

SetBackground ( Color color, int startIndex, int count ) : void

Sets the background color of a part of text inside the T:Xwt.Drawing.TextLayout object.

SetFontStyle ( FontStyle style, int startIndex, int count ) : void

Sets the font style of a part of text inside the T:Xwt.Drawing.TextLayout object.

SetFontWeight ( FontWeight weight, int startIndex, int count ) : void

Sets the font weight of a part of text inside the T:Xwt.Drawing.TextLayout object.

SetForeground ( Color color, int startIndex, int count ) : void

Sets the foreground color of a part of text inside the T:Xwt.Drawing.TextLayout object.

SetStrikethrough ( int startIndex, int count ) : void

Adds a strike-through to a part of text inside the T:Xwt.Drawing.TextLayout object.

SetUnderline ( int startIndex, int count ) : void

Underlines a part of text inside the T:Xwt.Drawing.TextLayout object.

TextLayout ( ) : System
TextLayout ( Canvas canvas ) : System

Private Methods

Method Description
GetData ( ) : TextLayoutData
InitForToolkit ( Toolkit tk ) : void
Setup ( ) : void
TextLayout ( Toolkit tk ) : System

Method Details

AddAttribute() public method

public AddAttribute ( Xwt.Drawing.TextAttribute attribute ) : void
attribute Xwt.Drawing.TextAttribute
return void

ClearAttributes() public method

public ClearAttributes ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

GetCoordinateFromIndex() public method

Obtains the graphical coordinate of an character in the layout.
public GetCoordinateFromIndex ( int index ) : System.Point
index int The index of the character.
return System.Point

GetIndexFromCoordinates() public method

Converts from a Position within the layout to the character at this position.
public GetIndexFromCoordinates ( System.Point p ) : int
p System.Point The position.
return int

GetIndexFromCoordinates() public method

Converts from a X and Y position within the layout to the character at this position.
public GetIndexFromCoordinates ( double x, double y ) : int
x double The x coordinate.
y double The y coordinate.
return int

GetSize() public method

measures the text if Width is other than -1, it measures the height according to Width Height is ignored
public GetSize ( ) : Size
return Size

SetBackground() public method

Sets the background color of a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetBackground ( Color color, int startIndex, int count ) : void
color Color The color of the text background.
startIndex int Start index of the first character to apply the background color to.
count int The number of characters to apply the background color to.
return void

SetFontStyle() public method

Sets the font style of a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetFontStyle ( FontStyle style, int startIndex, int count ) : void
style FontStyle The font style of the text.
startIndex int Start index of the first character to apply the font style to.
count int The number of characters to apply the font style to.
return void

SetFontWeight() public method

Sets the font weight of a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetFontWeight ( FontWeight weight, int startIndex, int count ) : void
weight FontWeight The font weight of the text.
startIndex int Start index of the first character to apply the font weight to.
count int The number of characters to apply the font weight to.
return void

SetForeground() public method

Sets the foreground color of a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetForeground ( Color color, int startIndex, int count ) : void
color Color The color of the text.
startIndex int Start index of the first character to apply the foreground color to.
count int The number of characters to apply the foreground color to.
return void

SetStrikethrough() public method

Adds a strike-through to a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetStrikethrough ( int startIndex, int count ) : void
startIndex int Start index of the first character to strike-through.
count int The number of characters to strike-through.
return void

SetUnderline() public method

Underlines a part of text inside the T:Xwt.Drawing.TextLayout object.
public SetUnderline ( int startIndex, int count ) : void
startIndex int Start index of the first character to underline.
count int The number of characters to underline.
return void

TextLayout() public method

public TextLayout ( ) : System
return System

TextLayout() public method

public TextLayout ( Canvas canvas ) : System
canvas Canvas
return System