Signal3
Signal support.
Tree.swift:1950class Signal3
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 (75) members.
Types
enum DropModeFlags
enum SelectMode
class Signal1
Signal support.
class Signal2
Signal support.
class Signal4
Signal support.
class Signal5
Signal support.
class Signal6
Signal support.
class Signal7
Signal support.
class Signal8
Signal support.
class Signal9
Signal support.
Type members
Instance members
var allowReselect: Bool
If
true
, the currently selected cell may be selected again.var allowRmbSelect: Bool
If
true
, a right mouse button click can select items.var allowSearch: Bool
If
true
, allows navigating theTree
with letter keys through incremental search.var cellSelected: SimpleSignal
Emitted when a cell is selected.
var checkPropagatedToItem: Signal6
Emitted when
propagateCheck(column:emitSignal:)
is called. Connect to this signal to process the items that are affected whenpropagateCheck(column:emitSignal:)
is invoked. The order that the items affected will be processed is as follows: the item that invoked the method, children of that item, and finally parents of that item.var columnTitleClicked: Signal9
Emitted when a column’s title is clicked with either
left
orright
.var columnTitlesVisible: Bool
If
true
, column titles are visible.var columns: Int32
The number of columns.
var customItemClicked: Signal4
Emitted when an item with
TreeItem/TreeCellMode/cellModeCustom
is clicked with a mouse button.var customPopupEdited: Signal8
Emitted when a cell with the
TreeItem/TreeCellMode/cellModeCustom
is clicked to be edited.var dropModeFlags: Int32
The drop mode as an OR combination of flags. See
DropModeFlags
constants. Once dropping is done, reverts to .dropModeDisabled. Setting this during_canDropData(atPosition:data:)
is recommended.var emptyClicked: Signal3
Emitted when a mouse button is clicked in the empty space of the tree.
var enableRecursiveFolding: Bool
If
true
, recursive folding is enabled for thisTree
. Holding down [kbd]Shift[/kbd] while clicking the fold arrow or usingui_right
/ui_left
shortcuts collapses or uncollapses theTreeItem
and all its descendants.var hideFolding: Bool
If
true
, the folding arrow is hidden.var hideRoot: Bool
If
true
, the tree’s root is hidden.var itemActivated: SimpleSignal
Emitted when an item is double-clicked, or selected with a
ui_accept
input event (e.g. using [kbd]Enter[/kbd] or [kbd]Space[/kbd] on the keyboard).var itemCollapsed: Signal5
Emitted when an item is collapsed by a click on the folding arrow.
var itemEdited: SimpleSignal
Emitted when an item is edited.
var itemIconDoubleClicked: SimpleSignal
Emitted when an item’s icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see [signal item_activated].
var itemMouseSelected: Signal2
Emitted when an item is selected with a mouse button.
var itemSelected: SimpleSignal
Emitted when an item is selected.
var multiSelected: Signal1
Emitted instead of [signal item_selected] if
selectMode
is set to .selectMulti.var nothingSelected: SimpleSignal
Emitted when a left mouse button click does not select any item.
var scrollHorizontalEnabled: Bool
If
true
, enables horizontal scrolling.var scrollVerticalEnabled: Bool
If
true
, enables vertical scrolling.var selectMode: Tree.SelectMode
Allows single or multiple selection. See the
SelectMode
constants.func clear(
) Clears the tree. This removes all items.
func createItem(parent: TreeItem?, index: Int32
) -> TreeItem? Creates an item in the tree and adds it as a child of
parent
, which can be either a validTreeItem
ornull
.func deselectAll(
) Deselects all tree items (rows and columns). In .selectMulti mode also removes selection cursor.
func editSelected(forceEdit: Bool
) -> Bool Edits the selected tree item as if it was clicked.
func ensureCursorIsVisible(
) Makes the currently focused cell visible.
func getButtonIdAtPosition(Vector2
) -> Int32 Returns the button ID at
position
, or -1 if no button is there.func getColumnAtPosition(Vector2
) -> Int32 Returns the column index at
position
, or -1 if no item is there.func getColumnExpandRatio(column: Int32
) -> Int32 Returns the expand ratio assigned to the column.
func getColumnTitle(column: Int32
) -> String Returns the column’s title.
func getColumnTitleAlignment(column: Int32
) -> HorizontalAlignment Returns the column title alignment.
func getColumnTitleDirection(column: Int32
) -> Control.TextDirection Returns column title base writing direction.
func getColumnTitleLanguage(column: Int32
) -> String Returns column title language code.
func getColumnWidth(column: Int32
) -> Int32 Returns the column’s width in pixels.
func getCustomPopupRect(
) -> Rect2 Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See
setCellMode(column:mode:)
.func getDropSectionAtPosition(Vector2
) -> Int32 Returns the drop section at
position
, or -100 if no item is there.func getEdited(
) -> TreeItem? Returns the currently edited item. Can be used with [signal item_edited] to get the item that was modified.
func getEditedColumn(
) -> Int32 Returns the column for the currently edited item.
func getItemAtPosition(Vector2
) -> TreeItem? Returns the tree item at the specified position (relative to the tree origin position).
func getNextSelected(from: TreeItem?
) -> TreeItem? Returns the next selected
TreeItem
after the given one, ornull
if the end is reached.func getPressedButton(
) -> Int32 Returns the last pressed button’s index.
func getRoot(
) -> TreeItem? Returns the tree’s root item, or
null
if the tree is empty.func getScroll(
) -> Vector2 Returns the current scrolling position.
func getSelected(
) -> TreeItem? Returns the currently focused item, or
null
if no item is focused.func getSelectedColumn(
) -> Int32 Returns the currently focused column, or -1 if no column is focused.
func isColumnClippingContent(column: Int32
) -> Bool Returns
true
if the column has enabled clipping (seesetColumnClipContent(column:enable:)
).func isColumnExpanding(column: Int32
) -> Bool Returns
true
if the column has enabled expanding (seesetColumnExpand(column:expand:)
).func scrollToItem(TreeItem?, centerOnItem: Bool
) Causes the
Tree
to jump to the specifiedTreeItem
.func setColumnClipContent(column: Int32, enable: Bool
) Allows to enable clipping for column’s content, making the content size ignored.
func setColumnCustomMinimumWidth(column: Int32, minWidth: Int32
) Overrides the calculated minimum width of a column. It can be set to
0
to restore the default behavior. Columns that have the “Expand” flag will use their “min_width” in a similar fashion tosizeFlagsStretchRatio
.func setColumnExpand(column: Int32, expand: Bool
) If
true
, the column will have the “Expand” flag ofControl
. Columns that have the “Expand” flag will use their expand ratio in a similar fashion tosizeFlagsStretchRatio
(seesetColumnExpandRatio(column:ratio:)
).func setColumnExpandRatio(column: Int32, ratio: Int32
) Sets the relative expand ratio for a column. See
setColumnExpand(column:expand:)
.func setColumnTitle(column: Int32, title: String
) Sets the title of a column.
func setColumnTitleAlignment(column: Int32, titleAlignment: HorizontalAlignment
) Sets the column title alignment. Note that
@GlobalScope.HORIZONTAL_ALIGNMENT_FILL
is not supported for column titles.func setColumnTitleDirection(column: Int32, direction: Control.TextDirection
) Sets column title base writing direction.
func setColumnTitleLanguage(column: Int32, language: String
) Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
func setSelected(item: TreeItem?, column: Int32
) Selects the specified
TreeItem
and column.
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 (_ clickPosition: Vector2, _ mouseButtonIndex: 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:_:)