Skip to main content

UI.TabbedWindow

Class used to create windows with multiple tabs.

Implements

Index

Constructors

constructor

Properties

closeOnBackPressed

closeOnBackPressed: boolean

currentTab

currentTab: number

Methods

close

  • close(): void
  • Closes window without container. Use only if the window was opened without container.


    Returns void

frame

  • frame(time: number): void
  • Called up to 66 times a second to update window's content.


    Parameters

    • time: number

      current time in milliseconds

    Returns void

getContainer

  • Returns UiAbstractContainer

    New UI.Container that was used to open this window or null, if the window wasn't opened in container.

getContent

  • Returns TabbedWindowContent

    Window's content object (usually specified in the window's constructor).

getDefaultTab

  • getDefaultTab(): number

getElements

  • Gets all the elements in the window.


    Returns HashMap<string, IElement>

    HashMap containing string element name as keys and element instances as values.

getGlobalTabSize

  • getGlobalTabSize(): number
  • Returns number

    Tab selector window width in global units.

getInnerWindowHeight

  • getInnerWindowHeight(): number
  • Returns number

    Tab content window height in units.

getInnerWindowWidth

  • getInnerWindowWidth(): number
  • Returns number

    Tab content window width in units.

getStyle

  • Returns Style

    Object containing current style of the window.

getStyleSafe

  • since: 3.1.0b126 (availabled for all windows, before it appears to be only in

    Returns Style

getWindowForTab

  • getWindowForTab(index: number): Window
  • Parameters

    • index: number

      index of the tab

    Returns Window

    New UI.Window instance created for the specified tab or null if no window was created for specified window.

getWindowTabSize

  • getWindowTabSize(): number
  • Returns number

    Tab selector window width in units.

invalidateDrawing

  • invalidateDrawing(onCurrentThread: boolean): void
  • Forces ui drawables of the window to refresh.


    Parameters

    • onCurrentThread: boolean

      if true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you pass true as the parameter

    Returns void

invalidateElements

  • invalidateElements(onCurrentThread: boolean): void
  • Forces ui elements of the window to refresh.


    Parameters

    • onCurrentThread: boolean

      if true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you pass true as the parameter

    Returns void

isDynamic

  • isDynamic(): boolean
  • Returns boolean

    true if the window can change it's contents position.

isInventoryNeeded

  • isInventoryNeeded(): boolean
  • Returns boolean

    true if the window has an inventory that should be updated.

isOpened

  • isOpened(): boolean
  • Returns boolean

    true if the window is opened, false otherwise.

onBackPressed

  • onBackPressed(): boolean
  • Returns boolean

    Whether the window can be closed on pressing back navigation button.

onTabSelected

  • onTabSelected(index: number): void
  • Parameters

    • index: number

    Returns void

open

  • open(): void
  • Opens window without container.


    Returns void

setBlockingBackground

  • setBlockingBackground(enabled: boolean): void
  • Specifies whether the window should darken and block background.


    Parameters

    • enabled: boolean

      pass true if you want the window to block background

    Returns void

setCloseOnBackPressed

  • setCloseOnBackPressed(cobp: boolean): void
  • Parameters

    • cobp: boolean

    Returns void

setContainer

  • Sets container for the current window. Be careful when calling it manually. You should prefer opening the window via UI.Container.openAs call.


    Parameters

    Returns void

setDebugEnabled

  • setDebugEnabled(debug: boolean): void
  • Turns debug mode for the window on and off.


    Parameters

    • debug: boolean

      if true, additional debug information will be drawn on the window canvas

    Returns void

setDefaultTab

  • setDefaultTab(tab: number): void
  • Sets default tab index.


    Parameters

    • tab: number

      index of the tab to be opened by default

    Returns void

setEventListener

  • Sets listener to be notified about window opening/closing events.


    Parameters

    Returns void

setFakeTab

  • setFakeTab(index: number, tabOverlay: ElementSet): void
  • Creates fake tab with no content.


    Parameters

    Returns void

setLocation

  • Sets window location (bounds) to draw window within.


    Parameters

    Returns void

setStyle

  • Sets new style object as current window's style. If the new style is a different object then an old one, forces window invalidation.


    Parameters

    Returns void

setTab

  • Sets content of the tab.

    More about capabilities

    The location of the tabs is as follows:

    0 6
    1 7
    2 8
    3 9
    4 10
    5 11

    Parameters

    • index: number

      index of the tab; there are 12 tabs available, from 0 to 11

    • tabOverlay: ElementSet

      content of the tab selector

    • tabContent: WindowContent

      content of the window to be created for the tab

    • isAlwaysSelected: boolean

      if true, tab is always displayed as selected; default value is false

    Returns void

setTabEventListener

  • Sets listener to be notified about tab with specified index opening/closing events.


    Parameters

    Returns void