/
ScrollContainer.hx
134 lines (103 loc) · 4.85 KB
/
ScrollContainer.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
A ScrollContainer node meant to contain a `godot.Control` child. ScrollContainers will automatically create a scrollbar child (`godot.HScrollBar`, `godot.VScrollBar`, or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the `godot.Control.rectMinSize` of the Control relative to the ScrollContainer. Works great with a `godot.Panel` control. You can set `EXPAND` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension).
**/
@:libType
@:csNative
@:native("Godot.ScrollContainer")
@:autoBuild(godot.Godot.buildUserClass())
extern class ScrollContainer extends godot.Container {
/**
`scroll_ended` signal.
**/
public var onScrollEnded(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onScrollEnded():Signal<Void->Void> {
return new Signal(this, "scroll_ended", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
/**
`scroll_started` signal.
**/
public var onScrollStarted(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onScrollStarted():Signal<Void->Void> {
return new Signal(this, "scroll_started", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
@:native("ScrollDeadzone")
public var scrollDeadzone:Int;
/**
The current vertical scroll value.
**/
@:native("ScrollVertical")
public var scrollVertical:Int;
/**
If `true`, enables vertical scrolling.
**/
@:native("ScrollVerticalEnabled")
public var scrollVerticalEnabled:Bool;
/**
The current horizontal scroll value.
**/
@:native("ScrollHorizontal")
public var scrollHorizontal:Int;
/**
If `true`, enables horizontal scrolling.
**/
@:native("ScrollHorizontalEnabled")
public var scrollHorizontalEnabled:Bool;
/**
If `true`, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible.
**/
@:native("FollowFocus")
public var followFocus:Bool;
@:native("new")
public function new():Void;
@:native("SetEnableHScroll")
public function setEnableHScroll(enable:Bool):Void;
@:native("IsHScrollEnabled")
public function isHScrollEnabled():Bool;
@:native("SetEnableVScroll")
public function setEnableVScroll(enable:Bool):Void;
@:native("IsVScrollEnabled")
public function isVScrollEnabled():Bool;
@:native("SetHScroll")
public function setHScroll(value:Int):Void;
@:native("GetHScroll")
public function getHScroll():Int;
@:native("SetVScroll")
public function setVScroll(value:Int):Void;
@:native("GetVScroll")
public function getVScroll():Int;
@:native("SetDeadzone")
public function setDeadzone(deadzone:Int):Void;
@:native("GetDeadzone")
public function getDeadzone():Int;
@:native("SetFollowFocus")
public function setFollowFocus(enabled:Bool):Void;
@:native("IsFollowingFocus")
public function isFollowingFocus():Bool;
/**
Returns the horizontal scrollbar `godot.HScrollBar` of this `godot.ScrollContainer`.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use `godot.ScrollContainer.scrollHorizontalEnabled`. If you want to only hide it instead, use its `godot.CanvasItem.visible` property.
**/
@:native("GetHScrollbar")
public function getHScrollbar():godot.HScrollBar;
/**
Returns the vertical scrollbar `godot.VScrollBar` of this `godot.ScrollContainer`.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use `godot.ScrollContainer.scrollVerticalEnabled`. If you want to only hide it instead, use its `godot.CanvasItem.visible` property.
**/
@:native("GetVScrollbar")
public function getVScrollbar():godot.VScrollBar;
/**
Ensures the given `control` is visible (must be a direct or indirect child of the ScrollContainer). Used by `godot.ScrollContainer.followFocus`.
Note: This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using `SceneTree.idle_frame`:
```
add_child(child_node)
yield(get_tree(), "idle_frame")
ensure_control_visible(child_node)
```
**/
@:native("EnsureControlVisible")
public function ensureControlVisible(control:godot.Control):Void;
}