canvas-gui
    Preparing search index...

    Class CvsPaneAbstract

    An offscreen placeholder for other controls

    Panes are controls that can slide into and out the display area along with any other controls placed on them.

    Panes are attached to one of the 4 display sides with only a tab visible. Clicking on the tab will cause the pane to slide into the display area. Clicking on the pane background or on it's tab will close the pane.

    Only one pane can be open at a time, so opening a second pane will close any open pane.

    This control is useful for freeing up the dsplay area for other purposes.

    Hierarchy (View Summary)

    Index

    Accessors

    • get id(): string

      The unique identifier for this control.

      Returns string

    • get isClosed(): boolean

      True if the pane is closed else false.

      Returns boolean

    • get isClosing(): boolean

      True if the pane is closing else false.

      Returns boolean

    • get isEnabled(): boolean

      This is true if the control can respond to UI events else false.

      Use enable() and disable() to enable and disable it.

      Returns boolean

    • get isOpaque(): boolean

      This is true if the control background is opaque else false.

      Use opaque() and transparent() display / hide the background.

      Returns boolean

    • get isOpen(): boolean

      True if the pane is open else false.

      Returns boolean

    • get isOpening(): boolean

      true if the pane is opening else false.

      Returns boolean

    • get isVisible(): boolean

      This is true if the control is visible else false.

      Use hide() and show() to set visibility.

      Returns boolean

    • get type(): string

      The type name for this control.
      (type name = class name without the Cvs prefix)

      Returns string

    Methods

    • Add a child to this control using its relative position [rx, ry]. If rx and ry are not provided then it uses the values set in the child.

      Parameters

      • child: any

        is the actual control or its id

      • Optionalrx: number
      • Optionalry: number

      Returns any

      this control

    • Close this pane.

      Returns CvsPane

      this control

    • Execute one or more configuration methods on this control.

      The parameter is a user defined object where each field is the name of a configuration method and its value is the method's parameter(s). Multiple parameters should be in an array and use 'undefined' if the method expects no parameters.

      This object will change the color scheme, text size and alignment, it will also make sure it is visible.

      { scheme : 'red', textSize : 12, textAlign: ['left', 'top'], show : undefined }
      
      If the field name does not exist or not a valid function of this control it will be silently ignored.

      There is no error checking on the parameters, it is up to the user to ensure they are valid for the control method.

      Parameters

      • cfg: any

        the configuration object

      Returns CvsPane

      this control

    • Parameters

      • orient: string
      • corners: number[]

      Returns void

    • Get the 'depth' the pane will intrude into the canvas when open.

      Returns number

      the depth

    • Sets the icon and its alignment relative to any text in the control.

      Processing constants are used to define the icon alignment.

      Parameters

      • i: cvsIcon

        the icon to use for this control

      • OptionalalignH: string

        'left', 'right' or 'center'

      • OptionalalignV: string

        'top', 'bottom' or 'center'

      Returns CvsPane

      this control

    • Removes the icon from the pane tab.

      Returns CvsPane

      this control

    • Removes the text from the pane tab.

      Returns CvsPane

      this control

    • Open this pane.

      Returns void

      this control

    • Remove a child control from this one so that it stays in same screen position.

      Parameters

      • child: any

        the control to remove or its id

      Returns CvsPane

      this control

    • Sets or gets the color scheme used by the pane's tab and the translucent background. Controls on the pane are not affected.

      Parameters

      • Optionalname: string

        the color scheme name e.g. 'blue'

      Returns ColorScheme | CvsControl

      this pane or its color scheme

    • This sets the event handler to be used when this control fires an event. The parameter can take one of three forms:

      1. Arrow function definition
      2. Anonymous function definition
      3. Named function declaration

      Parameters

      • event_handler: Function

        the function to handle this control's events.

      Returns CvsPane

      this control

    • An alternative to the enable / disable methods.

      Parameters

      • enable: boolean

        true / false

      • Optionalcascade: boolean

        true apply to all children

      Returns CvsPin

      this control

    • An alternative to the show / hide methods.

      Parameters

      • visible: boolean

        true / false

      • Optionalcascade: boolean

        if true hide children

      Returns CvsPin

      this control

    • Gets or sets the global minimum height for pane tabs.

      Parameters

      • th: number

        the minimum tab height (must be ≥10)

      Returns number | CvsPane

      this gui instance

    • Sets the current text.

      Processing constants are used to define the alignment.

      Parameters

      • t: string

        the text toset

      Returns CvsPane

      this control

    • Sets the text font for the pane tab.

      Parameters

      • Optionalfont: string

        the text font to use

      Returns CvsPane

      this control

    • Sets the text size for the pane tab.

      Parameters

      • Optionalts: number

        the text size to use

      Returns CvsPane

      this control

    • Sets the text style for the pane tab.

      Parameters

      • Optionalstyle: string

        the text style to use

      • Optionalslant: number

      Returns CvsPane

      this control