Skip to main content

cursors

Index

Namespaces

elementCursor

elementCursor:

hideElementCursor

  • hideElementCursor(element: HTMLDivElement): void
  • Parameters

    • element: HTMLDivElement

    Returns void

initElementCursor

  • initElementCursor(element: HTMLDivElement, cursor: default): void
  • Parameters

    • element: HTMLDivElement
    • cursor: default

    Returns void

resetElementCursor

  • resetElementCursor(element: HTMLDivElement): void
  • Parameters

    • element: HTMLDivElement

    Returns void

setElementCursor

  • setElementCursor(element: HTMLDivElement, cursor: default): void
  • Parameters

    • element: HTMLDivElement
    • cursor: default

    Returns void

Classes

ImageMouseCursor

ImageMouseCursor:

constructor

  • new ImageMouseCursor(url: string, x?: number, y?: number, name?: string, fallback?: default): default
  • Parameters

    • url: string
    • optionalx: number
    • optionaly: number
    • optionalname: string
    • optionalfallback: default

    Returns default

addFallbackStyleProperty

  • addFallbackStyleProperty(style: string): string
  • Parameters

    • style: string

    Returns string

getName

  • getName(): string
  • Returns string

getStyleProperty

  • getStyleProperty(): string
  • Returns string

staticgetDefinedCursor

  • getDefinedCursor(name: string): default
  • Parameters

    • name: string

    Returns default

staticgetUniqueInstanceName

  • getUniqueInstanceName(prefix: string): string
  • Parameters

    • prefix: string

    Returns string

staticsetDefinedCursor

  • setDefinedCursor(name: string, cursor: default): boolean
  • Parameters

    Returns boolean

MouseCursor

MouseCursor:

constructor

addFallbackStyleProperty

  • addFallbackStyleProperty(style: string): string
  • Parameters

    • style: string

    Returns string

getName

  • getName(): string
  • Returns string

getStyleProperty

  • getStyleProperty(): string
  • Returns string

staticgetDefinedCursor

  • getDefinedCursor(name: string): default
  • Parameters

    • name: string

    Returns default

staticsetDefinedCursor

  • setDefinedCursor(name: string, cursor: default): boolean
  • Parameters

    Returns boolean

SVGMouseCursor

SVGMouseCursor:

constructor

  • new SVGMouseCursor(url: string, x?: number, y?: number, name?: string, fallback?: default): default
  • Parameters

    • url: string
    • optionalx: number
    • optionaly: number
    • optionalname: string
    • optionalfallback: default

    Returns default

addFallbackStyleProperty

  • addFallbackStyleProperty(style: string): string
  • Parameters

    • style: string

    Returns string

getName

  • getName(): string
  • Returns string

getStyleProperty

  • getStyleProperty(): string
  • Returns string

staticgetDefinedCursor

  • getDefinedCursor(name: string, pointer?: boolean, color?: string): default
  • Get a shared instance of the SVGMouseCursor class satisfying the given parameters.


    Parameters

    • name: string

      The name of the cursor (defined in SVGCursorDescriptor.ts);

    • pointer: boolean = false

      Should be true to use the version of the cursor containing a mouse pointer. Defaults to false (which does not add a pointer to the cursor);

    • optionalcolor: string

      The color of the cursor. Defaults to tool.style.colorHighlightedActive;

    Returns default

    a SVGMouseCursor instance or undefined if no SVG cursor descriptor was found with the given name;

staticgetUniqueInstanceName

  • getUniqueInstanceName(prefix: string): string
  • Parameters

    • prefix: string

    Returns string

staticsetDefinedCursor

  • setDefinedCursor(name: string, cursor: default): boolean
  • Parameters

    Returns boolean

Variables

constCursorNames

CursorNames: string[] = ...

Functions

registerCursor

  • registerCursor(toolName: string, iconContent: string, viewBox: { x: number; y: number }): void
  • Registers a cursor to the list, so that it will be used for the given toolName. Overwrites the given cursor if it is already set.


    Parameters

    • toolName: string

      The name of the tool to assign a cursor to.

    • iconContent: string

      The SVG icon content of the cursor.

    • viewBox: { x: number; y: number }

      The viewBox of the cursor object.

    Returns void

setCursorForElement

  • setCursorForElement(element: HTMLDivElement, cursorName: string): void
  • Set the cursor for an HTML element. cursorNames can be either cornerstone3DTools cursors or standard cursors.


    Parameters

    • element: HTMLDivElement

      The element to set the cursor on.

    • cursorName: string

      The name of the cursor to set. This can be any cursor name either Cornerstone-specific cursor names or the standard CSS cursor names.

    Returns void