Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GridLayoutRegion

Hierarchy

Index

Constructors

constructor

Properties

content

content: Panel

Protected metadata

typeName

typeName: GridPanelLayoutRegion = LayoutTypes.GridPanelLayoutRegion

Static ColSpan

ColSpan: AttachedProperty<DashboardLayoutRegion<IDashboardLayoutProperties>, number> = new AttachedProperty<DashboardLayoutRegion, number>({create: () => 1,name: "Grid Panel.Column Span",changed: updateOwner})

Static Column

Column: AttachedProperty<DashboardLayoutRegion<IDashboardLayoutProperties>, number> = new AttachedProperty<DashboardLayoutRegion, number>({create: () => 1,name: "Grid Panel.Column",changed: updateOwner})

Static Row

Row: AttachedProperty<DashboardLayoutRegion<IDashboardLayoutProperties>, number> = new AttachedProperty<DashboardLayoutRegion, number>({create: () => 1,name: "Grid Panel.Row",changed: updateOwner})

Static RowSpan

RowSpan: AttachedProperty<DashboardLayoutRegion<IDashboardLayoutProperties>, number> = new AttachedProperty<DashboardLayoutRegion, number>({create: () => 1,name: "Grid Panel.Row Span",changed: updateOwner})

Accessors

widgets

Methods

Private _markSubtreeForUpdate

  • _markSubtreeForUpdate(): void

Private _updateSkippedSubtrees

  • _updateSkippedSubtrees(): void

addChild

clearAttachedProperties

copyAttachedProperties

createDragShadow

  • Create a drag shadow for one of this region's children.

    remarks

    Drag shadows are signifiers of the region being dragged, and indicate to the user what the dragged region is. For some regions (like the Canvas), it's useful to customize this shadow to expose more information (such as how it will be positioned in the CanvasPanel).

    The shadow must be completely static- it will not recieve any events, and will be destroyed at the end of the drag operation.

    Parameters

    • child: DashboardLayoutRegion<any>

      The region that is being dragged

    • clientX: number

      The X coordinate that the drag will start from

    • clientY: number

      The Y coordinate that the drag will start from

    Returns HTMLElement

    A valid HTML node that will follow the mouse during the drag.

getAttachedPropertyForChild

Protected getDefault

  • getDefault(propertyName: string): unknown

insertChild

  • Insert a new child into this container at a particular index.

    Notes

    If the widget is already in this region's children, then the widget is moved instead. This matches the behavior of Phosphor panels.

    This function also sets the parentRegion of the widget to this region.

    Parameters

    Returns void

Protected installContentTap

  • installContentTap(): void
  • Installs a message tap on the content to listen for child-removed.

    This tap is necessary for regions that use a custom layout algorithm, since the parent won't necessarily be notified when a Panel child is removed.

    Returns void

layoutChildren

  • layoutChildren(): void
  • Function to layout the grid panel's children

    Layout Algorithm

    1. Let colWidth = (CalculatedWidth - 2 * [[padding]]) / nCols - [[spacing]].
    2. Let rowHeight = (CalculatedHeight - 2 * [[padding]]) / nRows - [[spacing]].
    3. For each element:
      1. If element does not have showRegion:
        1. Skip this element.
      2. Read the attached properties to generate a CellConfig.
        1. Let col = Clamp([[Grid.Column]], 0, nCols).
        2. Let colSpan = Clamp([[Grid.ColumnSpan]], 1, nCols - col).
        3. Let row = Clamp([[Grid.Row]], 0, nRows).
        4. Let rowSpan = Clamp([[Grid.RowSpan]], 1, nRows - row).
      3. Set the size and position of the element
        1. Set width = (colSpan * colWidth + (colSpan - 1) * [[spacing]]).
        2. Set height = (rowSpan * rowHeight + (rowSpan - 1) * [[spacing]]).
        3. Set top = row * rowHeight + row * [[spacing]].
        4. Set left = col * colWidth + col * [[spacing]].
      4. Send a fit-request to the element.
    4. Return.

    Returns void

Protected onChildRegionAdded

Protected onChildRegionRemoved

  • Handle that gets called when a child is removed from this region.

    remarks

    Subclassers can override this method to implement custom logic, such as removing CSS classes or event handlers. Custom chroming elements added via Region Chroming will be removed automatically.

    This function is not called until after the oldChild has been moved, and will not be called if the old child is disposed. It will also not be called when this region is being disposed.

    The default implementation of this function is a no-op.

    Parameters

    Returns void

Protected onCloseRequest

  • onCloseRequest(): void

processMessage

  • processMessage(msg: Message): void

pruneSubtree

  • pruneSubtree(): void
  • Clean up this subtree by removing auto-generated empty regions.

    Notes

    This is a framework function and not meant to be called by user code. The MavenWorks framework will automatically manage the health of the layout, pruning when useful.

    Whether a region is "prunable" or not is specified by the <a href="../interfaces/regionwithchildren.iprops.html#prunable">prunable</a> layout property. For regions created with SurroundWith, this property is true.

    see

    IRegionWithChildrenProps.prunable

    see

    DashboardActions.SurroundWith

    Returns void

setFresh

  • setFresh(): void

sizeContentToFit

  • sizeContentToFit(bounds: object): void

subtree

updateFromProperties

  • updateFromProperties(): void

Static GetMetadata

Static updateOwner

Generated using TypeDoc