Signal4
Signal support.
TabContainer.swift:1625class Signal4
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (52) members.
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal5
Signal support.
class Signal6
Signal support.
enum TabPosition
Type members
Instance members
var activeTabRearranged: Signal1
Emitted when the active tab is rearranged via mouse drag. See
dragToRearrangeEnabled
.var allTabsInFront: Bool
If
true
, all tabs are drawn in front of the panel. Iffalse
, inactive tabs are drawn behind the panel.var clipTabs: Bool
If
true
, tabs overflowing this node’s width will be hidden, displaying two navigation buttons instead. Otherwise, this node’s minimum size is updated so that all tabs are visible.var currentTab: Int32
The current tab index. When set, this index’s
Control
node’svisible
property is set totrue
and all others are set tofalse
.var deselectEnabled: Bool
If
true
, all tabs can be deselected so that no tab is selected. Click on thecurrentTab
to deselect it.var dragToRearrangeEnabled: Bool
If
true
, tabs can be rearranged with mouse drag.var prePopupPressed: SimpleSignal
Emitted when the
TabContainer
’sPopup
button is clicked. SeesetPopup(_:)
for details.var tabAlignment: TabBar.AlignmentMode
Sets the position at which tabs will be placed. See
TabBar.AlignmentMode
for details.var tabButtonPressed: Signal6
Emitted when the user clicks on the button icon on this tab.
var tabChanged: Signal2
Emitted when switching to another tab.
var tabClicked: Signal3
Emitted when a tab is clicked, even if it is the current tab.
var tabFocusMode: Control.FocusMode
The focus access mode for the internal
TabBar
node.var tabHovered: Signal4
Emitted when a tab is hovered by the mouse.
var tabSelected: Signal5
Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
var tabsPosition: TabContainer.TabPosition
Sets the position of the tab bar. See
TabPosition
for details.var tabsRearrangeGroup: Int32
TabContainer
s with the same rearrange group ID will allow dragging the tabs between them. Enable drag withdragToRearrangeEnabled
.var tabsVisible: Bool
If
true
, tabs are visible. Iffalse
, tabs’ content and titles are hidden.var useHiddenTabsForMinSize: Bool
If
true
, childControl
nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.func getCurrentTabControl(
) -> Control? Returns the child
Control
node located at the active tab index.func getPopup(
) -> Popup? Returns the
Popup
node instance if one has been set already withsetPopup(_:)
.func getPreviousTab(
) -> Int32 Returns the previously active tab index.
func getTabBar(
) -> TabBar? Returns the
TabBar
contained in this container.func getTabButtonIcon(tabIdx: Int32
) -> Texture2D? Returns the button icon from the tab at index
tabIdx
.func getTabControl(tabIdx: Int32
) -> Control? Returns the
Control
node from the tab at indextabIdx
.func getTabCount(
) -> Int32 Returns the number of tabs.
func getTabIcon(tabIdx: Int32
) -> Texture2D? Returns the
Texture2D
for the tab at indextabIdx
ornull
if the tab has noTexture2D
.func getTabIconMaxWidth(tabIdx: Int32
) -> Int32 Returns the maximum allowed width of the icon for the tab at index
tabIdx
.func getTabIdxAtPoint(Vector2
) -> Int32 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 getTabIdxFromControl(Control?
) -> Int32 Returns the index of the tab tied to the given
control
. The control must be a child of theTabContainer
.func getTabMetadata(tabIdx: Int32
) -> Variant Returns the metadata value set to the tab at index
tabIdx
usingsetTabMetadata(tabIdx:metadata:)
. If no metadata was previously set, returnsnull
by default.func getTabTitle(tabIdx: Int32
) -> String Returns the title of the tab at index
tabIdx
. Tab titles default to the name of the indexed child node, but this can be overridden withsetTabTitle(tabIdx:title:)
.func getTabTooltip(tabIdx: Int32
) -> String Returns the tooltip text of the tab at index
tabIdx
.func isTabDisabled(tabIdx: Int32
) -> Bool Returns
true
if the tab at indextabIdx
is disabled.func isTabHidden(tabIdx: Int32
) -> Bool Returns
true
if the tab at indextabIdx
is hidden.func selectNextAvailable(
) -> Bool Selects the first available tab with greater index than the currently selected. Returns
true
if tab selection changed.func selectPreviousAvailable(
) -> Bool Selects the first available tab with lower index than the currently selected. Returns
true
if tab selection changed.func setPopup(Node?
) If set on a
Popup
node instance, a popup menu icon appears in the top-right corner of theTabContainer
(setting it tonull
will make it go away). Clicking it will expand thePopup
node.func setTabButtonIcon(tabIdx: Int32, icon: Texture2D?
) Sets the button icon from the tab at index
tabIdx
.func setTabDisabled(tabIdx: Int32, disabled: Bool
) If
disabled
istrue
, disables the tab at indextabIdx
, making it non-interactable.func setTabIcon(tabIdx: Int32, icon: Texture2D?
) Sets an icon for the tab at index
tabIdx
.func setTabIconMaxWidth(tabIdx: Int32, width: Int32
) Sets the maximum allowed width of the icon for the tab at index
tabIdx
. 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 setTabMetadata(tabIdx: Int32, metadata: Variant
) Sets the metadata value for the tab at index
tabIdx
, which can be retrieved later usinggetTabMetadata(tabIdx:)
.func setTabTitle(tabIdx: Int32, title: String
) Sets a custom title for the tab at index
tabIdx
(tab titles default to the name of the indexed child node). Set it back to the child’s name to make the tab default to it again.func setTabTooltip(tabIdx: Int32, tooltip: String
) Sets a custom tooltip text for tab at index
tabIdx
.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ tab: Int64) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)