Home Reference Source
import {TabBar} from './scripts/widgets/ui_tabs.js'
public class | source

TabBar

Extends:

UIBase → TabBar

Static Method Summary

Static Public Methods
public static

define(): {"tagname": string, "style": string}

public static

setDefault(e: *): *

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

canvas: *

public
public

g: *

public
public
public
public
public
public
public
public

tabs: *[]

public get

tool: *

public set
Private Members
private
private
private
private
private
private

_tool: *

Method Summary

Public Methods
public

addIconTab(icon: *, id: *, tooltip: *, movable: boolean): *

public

addTab(name: *, id: *, tooltip: string, movable: *): *

public

clear()

public

getTab(name_or_id: *): *

public

loadData(obj: *): *

public
public
public

on_pointerup(e: *)

public

removeTab(tab: *)

public

saveData(): {"taborder": *, "active": *}

public

setActive(tab: *, event: *)

tab is a TabItem instance

public

setCSS()

public

swapTabs(a: *, b: *)

public

update(force_update: boolean)

public

updateCanvas(force_update: boolean)

public

updateDPI(force_update: boolean)

public

updatePos(force_update: boolean)

public
Private Methods
private

_doclick(e: *)

private

_doelement(e: *, mx: *, my: *)

private

_domouse(e: *)

private
private
private

_getFont(tsize: *): *

private
private

_makeOnSelectEvt(): {"tab": *, "defaultPrevented": *, "preventDefault": function}

private
private

_startMove(tab: *, event: *, pointerId: *, pointerElem: *)

Static Public Methods

public static define(): {"tagname": string, "style": string} source

Return:

{"tagname": string, "style": string}

public static setDefault(e: *): * source

Params:

NameTypeAttributeDescription
e *

Return:

*

Public Constructors

public constructor() source

Public Members

public canvas: * source

public defaultPrevented: boolean source

public g: * source

public horiz: boolean source

public iconsheet: number source

public movableTabs: boolean source

public onchange: * source

public onselect: * source

public r: number source

public tabFontScale: number source

public tabs: *[] source

public get tool: * source

public set tool source

Private Members

private _last_dpi: * source

private _last_p_key: * source

private _last_pos: * source

private _last_style_key: * source

private _size_cb: * source

private _tool: * source

Public Methods

public addIconTab(icon: *, id: *, tooltip: *, movable: boolean): * source

Params:

NameTypeAttributeDescription
icon *
id *
tooltip *
movable boolean
  • optional
  • default: true

Return:

*

public addTab(name: *, id: *, tooltip: string, movable: *): * source

Params:

NameTypeAttributeDescription
name *
id *
tooltip string
  • optional
  • default:
movable *

Return:

*

public clear() source

public getTab(name_or_id: *): * source

Params:

NameTypeAttributeDescription
name_or_id *

Return:

*

public loadData(obj: *): * source

Params:

NameTypeAttributeDescription
obj *

Return:

*

public on_pointerdown(e: *) source

Params:

NameTypeAttributeDescription
e *

public on_pointermove(e: *) source

Params:

NameTypeAttributeDescription
e *

public on_pointerup(e: *) source

Params:

NameTypeAttributeDescription
e *

public removeTab(tab: *) source

Params:

NameTypeAttributeDescription
tab *

public saveData(): {"taborder": *, "active": *} source

Return:

{"taborder": *, "active": *}

public setActive(tab: *, event: *) source

tab is a TabItem instance

Params:

NameTypeAttributeDescription
tab *
event *

public setCSS() source

public swapTabs(a: *, b: *) source

Params:

NameTypeAttributeDescription
a *
b *

public update(force_update: boolean) source

Params:

NameTypeAttributeDescription
force_update boolean
  • optional
  • default: false

public updateCanvas(force_update: boolean) source

Params:

NameTypeAttributeDescription
force_update boolean
  • optional
  • default: false

public updateDPI(force_update: boolean) source

Params:

NameTypeAttributeDescription
force_update boolean
  • optional
  • default: false

public updatePos(force_update: boolean) source

Params:

NameTypeAttributeDescription
force_update boolean
  • optional
  • default: false

public updateStyle() source

Private Methods

private _doclick(e: *) source

Params:

NameTypeAttributeDescription
e *

private _doelement(e: *, mx: *, my: *) source

Params:

NameTypeAttributeDescription
e *
mx *
my *

private _domouse(e: *) source

Params:

NameTypeAttributeDescription
e *

private _ensureNoModal() source

private _fireOnSelect(): * source

Return:

*

private _getFont(tsize: *): * source

Params:

NameTypeAttributeDescription
tsize *

Return:

*

private _layout() source

private _makeOnSelectEvt(): {"tab": *, "defaultPrevented": *, "preventDefault": function} source

Return:

{"tab": *, "defaultPrevented": *, "preventDefault": function}

private _redraw() source

private _startMove(tab: *, event: *, pointerId: *, pointerElem: *) source

Params:

NameTypeAttributeDescription
tab *
  • optional
event *
pointerId *
  • optional
pointerElem *
  • optional
  • default: tab