Class RowNumberColumn
Custom column implementation that shows row numbers.
Inherited Members
Namespace: SdlSdl.DesktopEditorEditorApiImplementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public class RowNumberColumn : AbstractRowSelectionColumn, IInteractiveCustomColumn, ICustomColumn
Remarks
This column shows the actual row numbers used in the implementation. Row numbers will be sequential but in most cases not all rows will be shown, as depending on display settings typically only rows corresponding to segments and rows with file boundaries are shown.
The row numbers are shown right aligned by default (to fit well on the left side of an edit control) but you can set the text alignment explicitly using the TextFormat property.
Constructors
RowNumberColumn()
Default constructor.
Declaration
public RowNumberColumn()
Properties
HorizontalPadding
If set this number of pixels will be used as total horizontal padding for this column. I.e. if the text is centered half of this padding will appear to the left and half of it to the right of the text in the column.
Declaration
public int HorizontalPadding { get; set; }
Property Value
Type | Description |
---|---|
int |
VerticalPadding
If set this number of pixels will be used as total vertical padding for this column. I.e. if the text is centered half of this padding will appear above and half of it below the text in the column.
Declaration
public int VerticalPadding { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
CalculateCellContentHeight(Graphics, IRowInfo)
Called by the framework during layout to determine the minimum height of the content for a specific cell.
Declaration
public override int CalculateCellContentHeight(Graphics g, IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | |
IRowInfo | row |
Returns
Type | Description |
---|---|
int | The height of the text to be shown for this row |
Overrides
DrawCell(Graphics, IRowInfo, Rectangle, Pen, Pen, Pen, Pen)
Called by the framework during painting to draw the content of the specified cell.
Declaration
public override void DrawCell(Graphics g, IRowInfo row, Rectangle cellBounds, Pen leftBorderPen, Pen rightBorderPen, Pen topBorderPen, Pen bottomBorderPen)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | |
IRowInfo | row | |
Rectangle | cellBounds | |
Pen | leftBorderPen | |
Pen | rightBorderPen | |
Pen | topBorderPen | |
Pen | bottomBorderPen |
Overrides
Remarks
The implementation draws the cell with the appropriate background and borders, and displays the row number as text using the current text properties.
GetOptimalWidth(Graphics)
Called by the edit control to determine the optimal width of the column.
Declaration
public override int GetOptimalWidth(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g |
Returns
Type | Description |
---|---|
int | The width of the largest number expected to be shown in the column. |
Overrides
GetText(IRowInfo)
The text to be shown in the column.
Declaration
protected virtual string GetText(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row |
Returns
Type | Description |
---|---|
string |