rect
The rect class provides an interface for manipulating the → of a widget.
This class is available from the cs class store, or cs.ui class store if you use the UI component.
ℹ️ Conventions
To simplify the distinction between form objects and object type, this documentation uses the term widget for all form objects, whether static (a line, a rectangle…) or not (a button, a subform…).
cs.rect.new()
cs.rect.new( widget : Object ) : cs.rect
cs.rect.new ( name : Text ) : cs.rect
cs.rect.new ( width : Integer; height : Integer ) : cs.rect
cs.rect.new ( ) : cs.rect
| Parameter | Type | Description | |
|---|---|---|---|
| widget | Object | → | A widget class object like cs.static, cs.input, cs.button… |
| name | Text | → | A name of a widget |
| width height |
Integer | → | Sizes in pixels, in the form coordinate system*. |
| result | cs.rect | ← | New cs.rect |
* Origin is top left corner of current form
Description
cs.rect.new() creates & returns a new instance of the class.
- If the
widgetornameparameter is passed, thewidth&heightof thewidgetin the form coordinate system* are retrieved & used as stored sizes. - If parameters
widthandheightare passed, these are the stored sizes. - If no parameter is given, all sizes are initialized with a value of 0.
Properties & Functions
Properties
| Properties | Description | Type | Writable |
|---|---|---|---|
| .height .width |
Height & width, in pixels | Integer |
x |