TabBar

package
v0.0.0-...-f3deeb4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package TabBar provides methods for working with TabBar object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type AlignmentMode

type AlignmentMode = gdclass.TabBarAlignmentMode //gd:TabBar.AlignmentMode
const (
	/*Places tabs to the left.*/
	AlignmentLeft AlignmentMode = 0
	/*Places tabs in the middle.*/
	AlignmentCenter AlignmentMode = 1
	/*Places tabs to the right.*/
	AlignmentRight AlignmentMode = 2
	/*Represents the size of the [enum AlignmentMode] enum.*/
	AlignmentMax AlignmentMode = 3
)

type Any

type Any interface {
	gd.IsClass
	AsTabBar() Instance
}

type CloseButtonDisplayPolicy

type CloseButtonDisplayPolicy = gdclass.TabBarCloseButtonDisplayPolicy //gd:TabBar.CloseButtonDisplayPolicy
const (
	/*Never show the close buttons.*/
	CloseButtonShowNever CloseButtonDisplayPolicy = 0
	/*Only show the close button on the currently active tab.*/
	CloseButtonShowActiveOnly CloseButtonDisplayPolicy = 1
	/*Show the close button on all tabs.*/
	CloseButtonShowAlways CloseButtonDisplayPolicy = 2
	/*Represents the size of the [enum CloseButtonDisplayPolicy] enum.*/
	CloseButtonMax CloseButtonDisplayPolicy = 3
)

type Instance

type Instance [1]gdclass.TabBar

A control that provides a horizontal bar with tabs. Similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddTab

func (self Instance) AddTab()

Adds a new tab.

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsTabBar

func (self Instance) AsTabBar() Instance

func (Instance) ClearTabs

func (self Instance) ClearTabs()

Clears all tabs.

func (Instance) ClipTabs

func (self Instance) ClipTabs() bool

func (Instance) CurrentTab

func (self Instance) CurrentTab() int

func (Instance) DeselectEnabled

func (self Instance) DeselectEnabled() bool

func (Instance) DragToRearrangeEnabled

func (self Instance) DragToRearrangeEnabled() bool

func (Instance) EnsureTabVisible

func (self Instance) EnsureTabVisible(idx int)

Moves the scroll view to make the tab visible.

func (Instance) GetOffsetButtonsVisible

func (self Instance) GetOffsetButtonsVisible() bool

Returns [code]true[/code] if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.

func (Instance) GetPreviousTab

func (self Instance) GetPreviousTab() int

Returns the previously active tab index.

func (Instance) GetTabButtonIcon

func (self Instance) GetTabButtonIcon(tab_idx int) [1]gdclass.Texture2D

Returns the icon for the right button of the tab at index [param tab_idx] or [code]null[/code] if the right button has no icon.

func (Instance) GetTabIcon

func (self Instance) GetTabIcon(tab_idx int) [1]gdclass.Texture2D

Returns the icon for the tab at index [param tab_idx] or [code]null[/code] if the tab has no icon.

func (Instance) GetTabIconMaxWidth

func (self Instance) GetTabIconMaxWidth(tab_idx int) int

Returns the maximum allowed width of the icon for the tab at index [param tab_idx].

func (Instance) GetTabIdxAtPoint

func (self Instance) GetTabIdxAtPoint(point Vector2.XY) int

Returns the index of the tab at local coordinates [param point]. Returns [code]-1[/code] if the point is outside the control boundaries or if there's no tab at the queried position.

func (Instance) GetTabLanguage

func (self Instance) GetTabLanguage(tab_idx int) string

Returns tab title language code.

func (Instance) GetTabMetadata

func (self Instance) GetTabMetadata(tab_idx int) any

Returns the metadata value set to the tab at index [param tab_idx] using [method set_tab_metadata]. If no metadata was previously set, returns [code]null[/code] by default.

func (Instance) GetTabOffset

func (self Instance) GetTabOffset() int

Returns the number of hidden tabs offsetted to the left.

func (Instance) GetTabRect

func (self Instance) GetTabRect(tab_idx int) Rect2.PositionSize

Returns tab [Rect2] with local position and size.

func (Instance) GetTabTextDirection

func (self Instance) GetTabTextDirection(tab_idx int) gdclass.ControlTextDirection

Returns tab title text base writing direction.

func (Instance) GetTabTitle

func (self Instance) GetTabTitle(tab_idx int) string

Returns the title of the tab at index [param tab_idx].

func (Instance) GetTabTooltip

func (self Instance) GetTabTooltip(tab_idx int) string

Returns the tooltip text of the tab at index [param tab_idx].

func (Instance) IsTabDisabled

func (self Instance) IsTabDisabled(tab_idx int) bool

Returns [code]true[/code] if the tab at index [param tab_idx] is disabled.

func (Instance) IsTabHidden

func (self Instance) IsTabHidden(tab_idx int) bool

Returns [code]true[/code] if the tab at index [param tab_idx] is hidden.

func (Instance) MaxTabWidth

func (self Instance) MaxTabWidth() int

func (Instance) MoveTab

func (self Instance) MoveTab(from int, to int)

Moves a tab from [param from] to [param to].

func (Instance) OnActiveTabRearranged

func (self Instance) OnActiveTabRearranged(cb func(idx_to int))

func (Instance) OnTabButtonPressed

func (self Instance) OnTabButtonPressed(cb func(tab int))

func (Instance) OnTabChanged

func (self Instance) OnTabChanged(cb func(tab int))

func (Instance) OnTabClicked

func (self Instance) OnTabClicked(cb func(tab int))

func (Instance) OnTabClosePressed

func (self Instance) OnTabClosePressed(cb func(tab int))

func (Instance) OnTabHovered

func (self Instance) OnTabHovered(cb func(tab int))

func (Instance) OnTabRmbClicked

func (self Instance) OnTabRmbClicked(cb func(tab int))

func (Instance) OnTabSelected

func (self Instance) OnTabSelected(cb func(tab int))

func (Instance) RemoveTab

func (self Instance) RemoveTab(tab_idx int)

Removes the tab at index [param tab_idx].

func (Instance) ScrollToSelected

func (self Instance) ScrollToSelected() bool

func (Instance) ScrollingEnabled

func (self Instance) ScrollingEnabled() bool

func (Instance) SelectNextAvailable

func (self Instance) SelectNextAvailable() bool

Selects the first available tab with greater index than the currently selected. Returns [code]true[/code] if tab selection changed.

func (Instance) SelectPreviousAvailable

func (self Instance) SelectPreviousAvailable() bool

Selects the first available tab with lower index than the currently selected. Returns [code]true[/code] if tab selection changed.

func (Instance) SelectWithRmb

func (self Instance) SelectWithRmb() bool

func (Instance) SetClipTabs

func (self Instance) SetClipTabs(value bool)

func (Instance) SetCurrentTab

func (self Instance) SetCurrentTab(value int)

func (Instance) SetDeselectEnabled

func (self Instance) SetDeselectEnabled(value bool)

func (Instance) SetDragToRearrangeEnabled

func (self Instance) SetDragToRearrangeEnabled(value bool)

func (Instance) SetMaxTabWidth

func (self Instance) SetMaxTabWidth(value int)

func (Instance) SetScrollToSelected

func (self Instance) SetScrollToSelected(value bool)

func (Instance) SetScrollingEnabled

func (self Instance) SetScrollingEnabled(value bool)

func (Instance) SetSelectWithRmb

func (self Instance) SetSelectWithRmb(value bool)

func (Instance) SetTabAlignment

func (self Instance) SetTabAlignment(value gdclass.TabBarAlignmentMode)

func (Instance) SetTabButtonIcon

func (self Instance) SetTabButtonIcon(tab_idx int, icon [1]gdclass.Texture2D)

Sets an [param icon] for the button of the tab at index [param tab_idx] (located to the right, before the close button), making it visible and clickable (See [signal tab_button_pressed]). Giving it a [code]null[/code] value will hide the button.

func (Instance) SetTabCloseDisplayPolicy

func (self Instance) SetTabCloseDisplayPolicy(value gdclass.TabBarCloseButtonDisplayPolicy)

func (Instance) SetTabCount

func (self Instance) SetTabCount(value int)

func (Instance) SetTabDisabled

func (self Instance) SetTabDisabled(tab_idx int, disabled bool)

If [param disabled] is [code]true[/code], disables the tab at index [param tab_idx], making it non-interactable.

func (Instance) SetTabHidden

func (self Instance) SetTabHidden(tab_idx int, hidden bool)

If [param hidden] is [code]true[/code], hides the tab at index [param tab_idx], making it disappear from the tab area.

func (Instance) SetTabIcon

func (self Instance) SetTabIcon(tab_idx int, icon [1]gdclass.Texture2D)

Sets an [param icon] for the tab at index [param tab_idx].

func (Instance) SetTabIconMaxWidth

func (self Instance) SetTabIconMaxWidth(tab_idx int, width int)

Sets the maximum allowed width of the icon for the tab at index [param tab_idx]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio.

func (Instance) SetTabLanguage

func (self Instance) SetTabLanguage(tab_idx int, language string)

Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.

func (Instance) SetTabMetadata

func (self Instance) SetTabMetadata(tab_idx int, metadata any)

Sets the metadata value for the tab at index [param tab_idx], which can be retrieved later using [method get_tab_metadata].

func (Instance) SetTabTextDirection

func (self Instance) SetTabTextDirection(tab_idx int, direction gdclass.ControlTextDirection)

Sets tab title base writing direction.

func (Instance) SetTabTitle

func (self Instance) SetTabTitle(tab_idx int, title string)

Sets a [param title] for the tab at index [param tab_idx].

func (Instance) SetTabTooltip

func (self Instance) SetTabTooltip(tab_idx int, tooltip string)

Sets a [param tooltip] for tab at index [param tab_idx]. [b]Note:[/b] By default, if the [param tooltip] is empty and the tab text is truncated (not all characters fit into the tab), the title will be displayed as a tooltip. To hide the tooltip, assign [code]" "[/code] as the [param tooltip] text.

func (Instance) SetTabsRearrangeGroup

func (self Instance) SetTabsRearrangeGroup(value int)

func (Instance) TabAlignment

func (self Instance) TabAlignment() gdclass.TabBarAlignmentMode

func (Instance) TabCloseDisplayPolicy

func (self Instance) TabCloseDisplayPolicy() gdclass.TabBarCloseButtonDisplayPolicy

func (Instance) TabCount

func (self Instance) TabCount() int

func (Instance) TabsRearrangeGroup

func (self Instance) TabsRearrangeGroup() int

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL