Class SegmentIdColumn
Column that shows the segment ID for segment rows. For non-segment rows it shows only the default background color.
Inheritance
Inherited Members
Namespace: Sdl.DesktopEditor.EditorApi.Implementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public class SegmentIdColumn : RowNumberColumn, IInteractiveCustomColumn, ICustomColumn
Remarks
The optimal column width is determined by measuring the size of the text in the MaxWidthRowId property. If this property is not set it is estimated in the same manner as for the row number column, where it is calculated as the width of a number consisting entirely of digits '8', where the max number of digits is estimated to the same number of digits as total number of rows (not segments) in the edit control. I.e. if the edit control contains 0-9 rows the column is sized to fit the number '8', for 10-99 rows the number '88' is used to determine the optimal column width, for 100-999 rows '888' is used, etc.
If segment IDs other than sequential numbers are used this will mean that the segment ID may not fit on a single line in the column. If this is the case the ID will be wrapped across multiple lines.
Constructors
SegmentIdColumn()
Default constructor.
Declaration
public SegmentIdColumn()
Properties
MaxWidthRowId
If set the text of this property will be measured to determine the optimal column width.
Declaration
public string MaxWidthRowId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
If not set the optimal column width is determined from the number of rows in the document, where it is assumed that segments are numbered sequentially and that the largest segment number that may need to be shown is less than the total number of rows in the edit control.
Methods
GetOptimalWidth(Graphics)
Overridden to measure the text in MaxWidthRowId if set.
Declaration
public override int GetOptimalWidth(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetText(IRowInfo)
Overridden to return the segment ID for segment rows and null
for other rows.
Declaration
protected override string GetText(IRowInfo row)
Parameters
Type | Name | Description |
---|---|---|
IRowInfo | row |
Returns
Type | Description |
---|---|
System.String |