Skip to content

PixelUI.TabControl

Extends: PixelUI.Widget

A tabbed navigation widget with an optional body renderer. Renders a strip of selectable tabs and a content area beneath them.

Properties

NameTypeDescription
tabsPixelUI.TabControlTab[]Active tabs in display order
selectedIndexintegerIndex of the currently selected tab (0 when none available)
tabSpacingintegerSpacing in characters between adjacent tabs
tabPaddingintegerHorizontal padding applied inside tab labels
tabHeightintegerHeight of the tab strip in characters
tabBgPixelUI.ColorBackground color for inactive tabs
tabFgPixelUI.ColorForeground color for inactive tabs
activeTabBgPixelUI.ColorBackground color for the active tab
activeTabFgPixelUI.ColorForeground color for the active tab
hoverTabBgPixelUI.ColorBackground color for hovered tabs
hoverTabFgPixelUI.ColorForeground color for hovered tabs
disabledTabFgPixelUI.ColorForeground color for disabled tabs
bodyBgPixelUI.ColorBackground color for the body area
bodyFgPixelUI.ColorForeground color for the body area
onSelectfun(self:PixelUI.TabControl,
bodyRendererPixelUI.TabControlRenderer?Optional custom renderer for the content area
emptyTextstring?Message displayed when no tabs are available

Methods

new

lua
new()

_normalizeTabEntry

lua
_normalizeTabEntry()

_normalizeTabs

lua
_normalizeTabs()

_findFirstEnabled

lua
_findFirstEnabled()

_resolveSelectableIndex

lua
_resolveSelectableIndex()

_normalizeSelection

lua
_normalizeSelection()

setTabs

lua
setTabs()

getTabs

lua
getTabs()

addTab

lua
addTab()

removeTab

lua
removeTab()

setTabEnabled

lua
setTabEnabled()

setTabLabel

lua
setTabLabel()

selectTabById

lua
selectTabById()

getSelectedIndex

lua
getSelectedIndex()

getSelectedTab

lua
getSelectedTab()

setSelectedIndex

lua
setSelectedIndex()

setOnSelect

lua
setOnSelect()

setBodyRenderer

lua
setBodyRenderer()

setEmptyText

lua
setEmptyText()

_notifySelect

lua
_notifySelect()

_emitSelect

lua
_emitSelect()

_computeTabLayout

lua
_computeTabLayout()

_tabIndexFromPoint

lua
_tabIndexFromPoint()

_moveSelection

lua
_moveSelection()

_renderBody

lua
_renderBody()

onFocusChanged

lua
onFocusChanged()

draw

lua
draw()

handleEvent

lua
handleEvent()

Released under the MIT License.