Documentation
¶
Overview ¶
A control that provides a horizontal bar with tabs. Similar to graphics.gd/classdb/TabContainer but is only in charge of drawing tabs, not interacting with children.
Index ¶
- type Advanced
- type AlignmentMode
- type Any
- type CloseButtonDisplayPolicy
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddTab()
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsTabBar() Instance
- func (self Instance) ClearTabs()
- func (self Instance) ClipTabs() bool
- func (self Instance) CloseWithMiddleMouse() bool
- func (self Instance) CurrentTab() int
- func (self Instance) DeselectEnabled() bool
- func (self Instance) DragToRearrangeEnabled() bool
- func (self Instance) EnsureTabVisible(idx int)
- func (self Instance) GetOffsetButtonsVisible() bool
- func (self Instance) GetPreviousTab() int
- func (self Instance) GetTabButtonIcon(tab_idx int) Texture2D.Instance
- func (self Instance) GetTabIcon(tab_idx int) Texture2D.Instance
- func (self Instance) GetTabIconMaxWidth(tab_idx int) int
- func (self Instance) GetTabIdxAtPoint(point Vector2.XY) int
- func (self Instance) GetTabLanguage(tab_idx int) string
- func (self Instance) GetTabMetadata(tab_idx int) any
- func (self Instance) GetTabOffset() int
- func (self Instance) GetTabRect(tab_idx int) Rect2.PositionSize
- func (self Instance) GetTabTextDirection(tab_idx int) Control.TextDirection
- func (self Instance) GetTabTitle(tab_idx int) string
- func (self Instance) GetTabTooltip(tab_idx int) string
- func (self Instance) ID() ID
- func (self Instance) IsTabDisabled(tab_idx int) bool
- func (self Instance) IsTabHidden(tab_idx int) bool
- func (self Instance) MaxTabWidth() int
- func (self Instance) MoveTab(from int, to int)
- func (self Instance) OnActiveTabRearranged(cb func(idx_to int), flags ...Signal.Flags)
- func (self Instance) OnTabButtonPressed(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabChanged(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabClicked(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabClosePressed(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabHovered(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabRmbClicked(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) OnTabSelected(cb func(tab int), flags ...Signal.Flags)
- func (self Instance) RemoveTab(tab_idx int)
- func (self Instance) ScrollToSelected() bool
- func (self Instance) ScrollingEnabled() bool
- func (self Instance) SelectNextAvailable() bool
- func (self Instance) SelectPreviousAvailable() bool
- func (self Instance) SelectWithRmb() bool
- func (self Instance) SetClipTabs(value bool)
- func (self Instance) SetCloseWithMiddleMouse(value bool)
- func (self Instance) SetCurrentTab(value int)
- func (self Instance) SetDeselectEnabled(value bool)
- func (self Instance) SetDragToRearrangeEnabled(value bool)
- func (self Instance) SetMaxTabWidth(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetScrollToSelected(value bool)
- func (self Instance) SetScrollingEnabled(value bool)
- func (self Instance) SetSelectWithRmb(value bool)
- func (self Instance) SetTabAlignment(value AlignmentMode)
- func (self Instance) SetTabButtonIcon(tab_idx int, icon Texture2D.Instance)
- func (self Instance) SetTabCloseDisplayPolicy(value CloseButtonDisplayPolicy)
- func (self Instance) SetTabCount(value int)
- func (self Instance) SetTabDisabled(tab_idx int, disabled bool)
- func (self Instance) SetTabHidden(tab_idx int, hidden bool)
- func (self Instance) SetTabIcon(tab_idx int, icon Texture2D.Instance)
- func (self Instance) SetTabIconMaxWidth(tab_idx int, width int)
- func (self Instance) SetTabLanguage(tab_idx int, language string)
- func (self Instance) SetTabMetadata(tab_idx int, metadata any)
- func (self Instance) SetTabTextDirection(tab_idx int, direction Control.TextDirection)
- func (self Instance) SetTabTitle(tab_idx int, title string)
- func (self Instance) SetTabTooltip(tab_idx int, tooltip string)
- func (self Instance) SetTabsRearrangeGroup(value int)
- func (self Instance) TabAlignment() AlignmentMode
- func (self Instance) TabCloseDisplayPolicy() CloseButtonDisplayPolicy
- func (self Instance) TabCount() int
- func (self Instance) TabsRearrangeGroup() int
- func (self Instance) Virtual(name string) reflect.Value
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 int //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 [AlignmentMode] enum. AlignmentMax AlignmentMode = 3 )
type CloseButtonDisplayPolicy ¶
type CloseButtonDisplayPolicy int //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 [CloseButtonDisplayPolicy] enum. CloseButtonMax CloseButtonDisplayPolicy = 3 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) CloseWithMiddleMouse ¶
func (Instance) CurrentTab ¶
func (Instance) DeselectEnabled ¶
func (Instance) DragToRearrangeEnabled ¶
func (Instance) EnsureTabVisible ¶
Moves the scroll view to make the tab visible.
func (Instance) GetOffsetButtonsVisible ¶
Returns true if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
func (Instance) GetPreviousTab ¶
Returns the previously active tab index.
func (Instance) GetTabButtonIcon ¶
Returns the icon for the right button of the tab at index 'tab_idx' or null if the right button has no icon.
func (Instance) GetTabIcon ¶
Returns the icon for the tab at index 'tab_idx' or null if the tab has no icon.
func (Instance) GetTabIconMaxWidth ¶
Returns the maximum allowed width of the icon for the tab at index 'tab_idx'.
func (Instance) GetTabIdxAtPoint ¶
Returns the index of the tab at local coordinates 'point'. Returns -1 if the point is outside the control boundaries or if there's no tab at the queried position.
func (Instance) GetTabLanguage ¶
Returns tab title language code.
func (Instance) GetTabMetadata ¶
Returns the metadata value set to the tab at index 'tab_idx' using Instance.SetTabMetadata. If no metadata was previously set, returns null by default.
func (Instance) GetTabOffset ¶
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.PositionSize] with local position and size.
func (Instance) GetTabTextDirection ¶
func (self Instance) GetTabTextDirection(tab_idx int) Control.TextDirection
Returns tab title text base writing direction.
func (Instance) GetTabTitle ¶
Returns the title of the tab at index 'tab_idx'.
func (Instance) GetTabTooltip ¶
Returns the tooltip text of the tab at index 'tab_idx'.
func (Instance) IsTabDisabled ¶
Returns true if the tab at index 'tab_idx' is disabled.
func (Instance) IsTabHidden ¶
Returns true if the tab at index 'tab_idx' is hidden.
func (Instance) MaxTabWidth ¶
func (Instance) OnActiveTabRearranged ¶
func (Instance) OnTabButtonPressed ¶
func (Instance) OnTabChanged ¶
func (Instance) OnTabClicked ¶
func (Instance) OnTabClosePressed ¶
func (Instance) OnTabHovered ¶
func (Instance) OnTabRmbClicked ¶
func (Instance) OnTabSelected ¶
func (Instance) ScrollToSelected ¶
func (Instance) ScrollingEnabled ¶
func (Instance) SelectNextAvailable ¶
Selects the first available tab with greater index than the currently selected. Returns true if tab selection changed.
func (Instance) SelectPreviousAvailable ¶
Selects the first available tab with lower index than the currently selected. Returns true if tab selection changed.
func (Instance) SelectWithRmb ¶
func (Instance) SetClipTabs ¶
func (Instance) SetCloseWithMiddleMouse ¶
func (Instance) SetCurrentTab ¶
func (Instance) SetDeselectEnabled ¶
func (Instance) SetDragToRearrangeEnabled ¶
func (Instance) SetMaxTabWidth ¶
func (Instance) SetScrollToSelected ¶
func (Instance) SetScrollingEnabled ¶
func (Instance) SetSelectWithRmb ¶
func (Instance) SetTabAlignment ¶
func (self Instance) SetTabAlignment(value AlignmentMode)
func (Instance) SetTabButtonIcon ¶
Sets an 'icon' for the button of the tab at index 'tab_idx' (located to the right, before the close button), making it visible and clickable (See Instance.OnTabButtonPressed). Giving it a null value will hide the button.
func (Instance) SetTabCloseDisplayPolicy ¶
func (self Instance) SetTabCloseDisplayPolicy(value CloseButtonDisplayPolicy)
func (Instance) SetTabCount ¶
func (Instance) SetTabDisabled ¶
If 'disabled' is true, disables the tab at index 'tab_idx', making it non-interactable.
func (Instance) SetTabHidden ¶
If 'hidden' is true, hides the tab at index 'tab_idx', making it disappear from the tab area.
func (Instance) SetTabIcon ¶
Sets an 'icon' for the tab at index 'tab_idx'.
func (Instance) SetTabIconMaxWidth ¶
Sets the maximum allowed width of the icon for the tab at index 'tab_idx'. This limit is applied on top of the default size of the icon and on top of theme's 'icon_max_width'. The height is adjusted according to the icon's ratio.
func (Instance) SetTabLanguage ¶
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 ¶
Sets the metadata value for the tab at index 'tab_idx', which can be retrieved later using Instance.GetTabMetadata.
func (Instance) SetTabTextDirection ¶
func (self Instance) SetTabTextDirection(tab_idx int, direction Control.TextDirection)
Sets tab title base writing direction.
func (Instance) SetTabTitle ¶
Sets a 'title' for the tab at index 'tab_idx'.
func (Instance) SetTabTooltip ¶
Sets a 'tooltip' for tab at index 'tab_idx'.
Note: By default, if the '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 " " as the 'tooltip' text.
func (Instance) SetTabsRearrangeGroup ¶
func (Instance) TabAlignment ¶
func (self Instance) TabAlignment() AlignmentMode
func (Instance) TabCloseDisplayPolicy ¶
func (self Instance) TabCloseDisplayPolicy() CloseButtonDisplayPolicy