Documentation
¶
Overview ¶
A container that can be expanded/collapsed, with a title that can be filled with controls, such as buttons.
The title can be positioned at the top or bottom of the container.
The container can be expanded or collapsed by clicking the title or by pressing ui_accept when focused.
Child control nodes are hidden when the container is collapsed. Ignores non-control children.
Can allow grouping with other FoldableContainers, check FoldableGroup and FoldableGroup.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
- func (self *Extension[T]) AsContainer() Container.Instance
- func (self *Extension[T]) AsControl() Control.Instance
- func (self *Extension[T]) AsFoldableContainer() Instance
- func (self *Extension[T]) AsNode() Node.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- type ID
- type Instance
- func (self Instance) AddTitleBarControl(control Control.Instance)
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsContainer() Container.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsFoldableContainer() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Expand()
- func (self Instance) Fold()
- func (self Instance) Folded() bool
- func (self Instance) ID() ID
- func (self Instance) Language() string
- func (self Instance) OnFoldingChanged(cb func(is_folded bool), flags ...Signal.Flags)
- func (self Instance) RemoveTitleBarControl(control Control.Instance)
- func (self Instance) SetFolded(value bool)
- func (self Instance) SetLanguage(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetTitle(value string)
- func (self Instance) SetTitleAlignment(value GUI.HorizontalAlignment)
- func (self Instance) SetTitlePosition(value TitlePosition)
- func (self Instance) SetTitleTextDirection(value Control.TextDirection)
- func (self Instance) SetTitleTextOverrunBehavior(value TextServer.OverrunBehavior)
- func (self Instance) Title() string
- func (self Instance) TitleAlignment() GUI.HorizontalAlignment
- func (self Instance) TitlePosition() TitlePosition
- func (self Instance) TitleTextDirection() Control.TextDirection
- func (self Instance) TitleTextOverrunBehavior() TextServer.OverrunBehavior
- func (self Instance) Virtual(name string) reflect.Value
- type TitlePosition
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 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
func (*Extension[T]) AsContainer ¶
func (*Extension[T]) AsFoldableContainer ¶
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 ¶
type Instance [1]gdclass.FoldableContainer
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) AddTitleBarControl ¶
Adds a Control that will be placed next to the container's title, obscuring the clickable area. Prime usage is adding Button nodes, but it can be any Control.
The control will be added as a child of this container and removed from previous parent if necessary. The controls will be placed aligned to the right, with the first added control being the leftmost one.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsContainer ¶
func (Instance) AsFoldableContainer ¶
func (Instance) Expand ¶
func (self Instance) Expand()
Expands the container and emits OnFoldingChanged.
func (Instance) Language ¶
Language code used for text shaping algorithms. If left empty, current locale is used instead.
func (Instance) OnFoldingChanged ¶
Emitted when the container is folded/expanded.
func (Instance) RemoveTitleBarControl ¶
Removes a Control added with AddTitleBarControl. The node is not freed automatically, you need to use Node.QueueFree.
func (Instance) SetLanguage ¶
SetLanguage sets the property returned by [GetLanguage].
func (Instance) SetTitleAlignment ¶
func (self Instance) SetTitleAlignment(value GUI.HorizontalAlignment)
SetTitleAlignment sets the property returned by [GetTitleAlignment].
func (Instance) SetTitlePosition ¶
func (self Instance) SetTitlePosition(value TitlePosition)
SetTitlePosition sets the property returned by [GetTitlePosition].
func (Instance) SetTitleTextDirection ¶
func (self Instance) SetTitleTextDirection(value Control.TextDirection)
SetTitleTextDirection sets the property returned by [GetTitleTextDirection].
func (Instance) SetTitleTextOverrunBehavior ¶
func (self Instance) SetTitleTextOverrunBehavior(value TextServer.OverrunBehavior)
SetTitleTextOverrunBehavior sets the property returned by [GetTitleTextOverrunBehavior].
func (Instance) TitleAlignment ¶
func (self Instance) TitleAlignment() GUI.HorizontalAlignment
Title's horizontal text alignment.
func (Instance) TitlePosition ¶
func (self Instance) TitlePosition() TitlePosition
Title's position.
func (Instance) TitleTextDirection ¶
func (self Instance) TitleTextDirection() Control.TextDirection
Title text writing direction.
func (Instance) TitleTextOverrunBehavior ¶
func (self Instance) TitleTextOverrunBehavior() TextServer.OverrunBehavior
Defines the behavior of the title when the text is longer than the available space.
type TitlePosition ¶
type TitlePosition int //gd:FoldableContainer.TitlePosition
const ( // Makes the title appear at the top of the container. PositionTop TitlePosition = 0 // Makes the title appear at the bottom of the container. Also makes all StyleBoxes flipped vertically. PositionBottom TitlePosition = 1 )