Search Results for

    Show / Hide Table of Contents

    Class DocumentStructureInfoColumn

    Custom editor column showing context information for paragraph units.

    Inheritance
    System.Object
    AbstractCustomColumn
    DocumentStructureInfoColumn
    Implements
    IInteractiveCustomColumn
    ICustomColumn
    Inherited Members
    AbstractCustomColumn.CalculateTextSize(Graphics, String, Font)
    AbstractCustomColumn.CalculateTextSize(Graphics, String, Font, Int32)
    AbstractCustomColumn.GetFont()
    AbstractCustomColumn.DrawDefaultBackground(Graphics, Rectangle, IRowInfo)
    AbstractCustomColumn.DrawBorders(Graphics, Rectangle, Pen, Pen, Pen, Pen)
    AbstractCustomColumn.DrawTopBorder(Graphics, Rectangle, Pen)
    AbstractCustomColumn.DrawRightBorder(Graphics, Rectangle, Pen)
    AbstractCustomColumn.DrawBottomBorder(Graphics, Rectangle, Pen)
    AbstractCustomColumn.DrawLeftBorder(Graphics, Rectangle, Pen)
    AbstractCustomColumn.BeginDraw()
    AbstractCustomColumn.SetRowSizeAccessor(RowSizeAccessor)
    AbstractCustomColumn.PrepareRegisterRows()
    AbstractCustomColumn.RegisterRow(IRowInfo)
    AbstractCustomColumn.TextFormat
    AbstractCustomColumn.EditControl
    AbstractCustomColumn.Width
    AbstractCustomColumn.IsComplex
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Sdl.DesktopEditor.EditorApi.Implementation
    Assembly: Sdl.DesktopEditor.EditorApi.dll
    Syntax
    public class DocumentStructureInfoColumn : AbstractCustomColumn, IInteractiveCustomColumn, ICustomColumn
    Remarks

    Contexts are clickable, and the mouse cursor changes to a hand when the user moves the mouse over a cell that has context. Clicking in the column shows extended context information to the user.

    The column shows the context code and uses a background color defined for the most significant context. If several contexts are available a + is appended to the context code to indicate this fact to the user.

    The column also shows a tooltip with the descriptive name of the main context when the user hovers the mouse over a cell with context.

    Cell boundaries are drawn as for paragraphs, i.e. top and bottom borders are only drawn for the first and last row of a paragraph, respectively.

    Constructors

    DocumentStructureInfoColumn()

    Default constructor.

    Declaration
    public DocumentStructureInfoColumn()

    Properties

    EventFlags

    Implementation handles all left mouse click events plus mouse entering and leaving a cell.

    Declaration
    public virtual InteractiveEventFlags EventFlags { get; }
    Property Value
    Type Description
    InteractiveEventFlags

    Methods

    CalculateCellContentHeight(Graphics, IRowInfo)

    Returns the height of the text to be displayed for this row.

    Declaration
    public override int CalculateCellContentHeight(Graphics g, IRowInfo row)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    IRowInfo row
    Returns
    Type Description
    System.Int32
    Overrides
    AbstractCustomColumn.CalculateCellContentHeight(Graphics, IRowInfo)

    DrawCell(Graphics, IRowInfo, Rectangle, Pen, Pen, Pen, Pen)

    Draw the content of the cell, based on context information associated with the row.

    Declaration
    public override void DrawCell(Graphics g, IRowInfo row, Rectangle cellBounds, Pen leftBorderPen, Pen rightBorderPen, Pen topBorderPen, Pen bottomBorderPen)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Drawing.Pen leftBorderPen
    System.Drawing.Pen rightBorderPen
    System.Drawing.Pen topBorderPen
    System.Drawing.Pen bottomBorderPen
    Overrides
    AbstractCustomColumn.DrawCell(Graphics, IRowInfo, Rectangle, Pen, Pen, Pen, Pen)
    Remarks

    The most significant context is used for background and context code.

    If there is no context for this row the default background and the paragraph boundaries are drawn.

    DrawCellBoundaries(IRowInfo, Graphics, Rectangle, Pen, Pen, Pen, Pen)

    Draw cell borders in a way that ensures paragraph boundaries are intact.

    Declaration
    protected void DrawCellBoundaries(IRowInfo row, Graphics g, Rectangle cellBounds, Pen leftBorderPen, Pen rightBorderPen, Pen topBorderPen, Pen bottomBorderPen)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Graphics g
    System.Drawing.Rectangle cellBounds
    System.Drawing.Pen leftBorderPen
    System.Drawing.Pen rightBorderPen
    System.Drawing.Pen topBorderPen
    System.Drawing.Pen bottomBorderPen

    GetContext(IRowInfo)

    Helper function to locate the contexts associated with a row.

    Declaration
    protected IContextProperties GetContext(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row
    Returns
    Type Description
    IContextProperties

    null if the row does not have a context

    GetContextToolTip(IRowInfo)

    Gets the tooltip to display for the current cell by finding the main context. This can be overridden to return a different tooltip.

    Declaration
    protected virtual string GetContextToolTip(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row
    Returns
    Type Description
    System.String

    GetMainContext(IRowInfo)

    The (most significant) context to be shown in the column.

    Declaration
    protected IContextInfo GetMainContext(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row
    Returns
    Type Description
    IContextInfo

    GetOptimalWidth(Graphics)

    Returns the expected maximum width of the content in this column, by default the size of 2 wide capital letters and a plus sign.

    Declaration
    public override int GetOptimalWidth(Graphics g)
    Parameters
    Type Name Description
    System.Drawing.Graphics g
    Returns
    Type Description
    System.Int32
    Overrides
    AbstractCustomColumn.GetOptimalWidth(Graphics)

    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
    System.String

    IsFirstParagraphRow(IRowInfo)

    Helper to determine if the row is the first row shown for a paragraph.

    Declaration
    public static bool IsFirstParagraphRow(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row
    Returns
    Type Description
    System.Boolean

    IsLastParagraphRow(IRowInfo)

    Helper function to determine if the row is the last row to be shown for a paragraph.

    Declaration
    public static bool IsLastParagraphRow(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row
    Returns
    Type Description
    System.Boolean

    OnCellMouseDoubleClick(IRowInfo, Rectangle, MouseEventArgs)

    Handled to avoid this being unintentionally processed by the edit control. The implementation does nothing.

    Declaration
    public virtual void OnCellMouseDoubleClick(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnCellMouseDown(IRowInfo, Rectangle, MouseEventArgs)

    Handled to avoid this being unintentionally processed by the edit control. The implementation does nothing.

    Declaration
    public virtual void OnCellMouseDown(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnCellMouseEntering(IRowInfo, Rectangle, IRowInfo, Rectangle)

    When the mouse enters a cell with context information the cursor is set to a hand and the tooltip is activated with the display name for the main context.

    Declaration
    public void OnCellMouseEntering(IRowInfo row, Rectangle cellBounds, IRowInfo leavingRow, Rectangle leavingCellBounds)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    IRowInfo leavingRow
    System.Drawing.Rectangle leavingCellBounds

    OnCellMouseLeaving(IRowInfo, Rectangle, IRowInfo, Rectangle)

    When the mouse leaves a cell the mouse cursor is restored and the tool tip is hidden.

    Declaration
    public void OnCellMouseLeaving(IRowInfo row, Rectangle cellBounds, IRowInfo enteringRow, Rectangle enteringCellBounds)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    IRowInfo enteringRow
    System.Drawing.Rectangle enteringCellBounds

    OnCellMouseMove(IRowInfo, Rectangle, MouseEventArgs)

    Not used.

    Declaration
    public virtual void OnCellMouseMove(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnCellMouseRightDown(IRowInfo, Rectangle, MouseEventArgs)

    Not used.

    Declaration
    public virtual void OnCellMouseRightDown(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnCellMouseRightUp(IRowInfo, Rectangle, MouseEventArgs)

    Not used.

    Declaration
    public virtual void OnCellMouseRightUp(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnCellMouseUp(IRowInfo, Rectangle, MouseEventArgs)

    Performs the "click on" functionality - i.e. show details about the contexts.

    Declaration
    public virtual void OnCellMouseUp(IRowInfo row, Rectangle cellBounds, MouseEventArgs e)
    Parameters
    Type Name Description
    IRowInfo row
    System.Drawing.Rectangle cellBounds
    System.Windows.Forms.MouseEventArgs e

    OnContentChanged(Object, CustomColumnContentChangedEventArgs)

    Fire the ContentChanged event.

    Declaration
    public virtual void OnContentChanged(object sender, CustomColumnContentChangedEventArgs args)
    Parameters
    Type Name Description
    System.Object sender
    CustomColumnContentChangedEventArgs args

    ShowCellToolTip(IRowInfo)

    Displays the tooltip for the cell using GetContextToolTip(IRowInfo).

    Declaration
    protected void ShowCellToolTip(IRowInfo row)
    Parameters
    Type Name Description
    IRowInfo row

    Events

    ContentChanged

    Currently not used by this column.

    Declaration
    public event EventHandler<CustomColumnContentChangedEventArgs> ContentChanged
    Event Type
    Type Description
    System.EventHandler<CustomColumnContentChangedEventArgs>

    Implements

    IInteractiveCustomColumn
    ICustomColumn

    Extension Methods

    WindowsControlUtils.ForWindowFromFrameworkElement(Object, Action<Window>)

    On this page

    • Constructors
      • DocumentStructureInfoColumn()
    • Properties
      • EventFlags
    • Methods
      • CalculateCellContentHeight(Graphics, IRowInfo)
      • DrawCell(Graphics, IRowInfo, Rectangle, Pen, Pen, Pen, Pen)
      • DrawCellBoundaries(IRowInfo, Graphics, Rectangle, Pen, Pen, Pen, Pen)
      • GetContext(IRowInfo)
      • GetContextToolTip(IRowInfo)
      • GetMainContext(IRowInfo)
      • GetOptimalWidth(Graphics)
      • GetText(IRowInfo)
      • IsFirstParagraphRow(IRowInfo)
      • IsLastParagraphRow(IRowInfo)
      • OnCellMouseDoubleClick(IRowInfo, Rectangle, MouseEventArgs)
      • OnCellMouseDown(IRowInfo, Rectangle, MouseEventArgs)
      • OnCellMouseEntering(IRowInfo, Rectangle, IRowInfo, Rectangle)
      • OnCellMouseLeaving(IRowInfo, Rectangle, IRowInfo, Rectangle)
      • OnCellMouseMove(IRowInfo, Rectangle, MouseEventArgs)
      • OnCellMouseRightDown(IRowInfo, Rectangle, MouseEventArgs)
      • OnCellMouseRightUp(IRowInfo, Rectangle, MouseEventArgs)
      • OnCellMouseUp(IRowInfo, Rectangle, MouseEventArgs)
      • OnContentChanged(Object, CustomColumnContentChangedEventArgs)
      • ShowCellToolTip(IRowInfo)
    • Events
      • ContentChanged
    • Implements
    • Extension Methods
    Back to top Generated by DocFX