Module controls.control
Control module
Functions
Control:Dispose (...) | Removes the control. |
Control:SetParent (obj) | Sets the control's parent object. |
Control:AddChild (obj, dontUpdate) | Adds a child object to the control |
Control:RemoveChild (obj) | Removes a child object from the control |
Control:SetPos (x, y, w, h, clientArea, dontUpdateRelative) | Sets the control's position |
Control:SetPosRelative (x, y, w, h, clientArea, dontUpdateRelative) | Sets the control's relative position |
Control:Resize (w, h, clientArea, dontUpdateRelative) | Resize the control |
Control:Invalidate () | Requests a redraw of the control. |
Control:InvalidateSelf () | Requests a redraw of the control. |
Tables
Control | Control fields. |
Functions
- Control:Dispose (...)
-
Removes the control.
Parameters:
- ...
- Control:SetParent (obj)
-
Sets the control's parent object.
Parameters:
- obj object.Object parent object
- Control:AddChild (obj, dontUpdate)
-
Adds a child object to the control
Parameters:
- obj object.Object child object
- dontUpdate if true won't trigger a RequestRealign()
- Control:RemoveChild (obj)
-
Removes a child object from the control
Parameters:
- obj object.Object child object
- Control:SetPos (x, y, w, h, clientArea, dontUpdateRelative)
-
Sets the control's position
Parameters:
- x int x-coordinate
- y int y-coordinate
- w int width
- h int height
- clientArea TODO
- dontUpdateRelative bool TODO
- Control:SetPosRelative (x, y, w, h, clientArea, dontUpdateRelative)
-
Sets the control's relative position
Parameters:
- x int x-coordinate
- y int y-coordinate
- w int width
- h int height
- clientArea TODO
- dontUpdateRelative bool TODO
- Control:Resize (w, h, clientArea, dontUpdateRelative)
-
Resize the control
Parameters:
- w int width
- h int height
- clientArea TODO
- dontUpdateRelative bool TODO
- Control:Invalidate ()
- Requests a redraw of the control.
- Control:InvalidateSelf ()
- Requests a redraw of the control.
Tables
- Control
-
Control fields.
Inherits from Object.
Fields:
- padding {left,top,right,bottom} table of padding, (default {5,5,5,5})
- borderThickness number border thickness in pixels (default 1.5)
- borderColor {r,g,b,a} border color {r,g,b,a}, (default {1,1,1,0.6})
- borderColor2 {r,g,b,a} border color second {r,g,b,a}, (default {0,0,0,0.8})
- backgroundColor {r,g,b,a} background color {r,g,b,a}, (default {0.8,0.8,1,0.4})
- focusColor {r,g,b,a} focus color {r,g,b,a}, (default {0.2,0.2,1,0.6})
- autosize bool whether size will be determined automatically (default false)
- draggable bool can control be dragged (default false)
- resizable bool can control be resized (default false)
- minWidth int minimum width (default 10)
- minHeight int minimum height (default 10)
- maxWidth int maximum width (default 1e9)
- maxHeight int maximum height (default 1e9)
- OnResize {func1,fun2,...} table of function listeners for size changes, (default {})
See also: