rui

package module
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 26 Imported by: 7

README

Russian

RUI library

The RUI (Remote User Interface) library is designed to create web applications in the go language.

The peculiarity of the library is that all data processing is carried out on the server, and the browser is used as a thin client. WebSocket is used for client-server communication.

Hello world

type helloWorldSession struct {
}

func (content *helloWorldSession) CreateRootView(session rui.Session) rui.View {
	return rui.NewTextView(session, rui.Params {
		rui.Text : "Hello world!!!",
	})
}

func createHelloWorldSession(session rui.Session) rui.SessionContent {
	return new(helloWorldSession)
}

func main() {
	rui.StartApp("localhost:8000", createHelloWorldSession, rui.AppParams{
		Title:      "Hello world",
		Icon:       "icon.svg",
	})
}

In the main function, the StartApp function is called. It creates a rui app and runs its main loop. The StartApp function has 3 parameters:

  1. IP address where the application will be available (in our example it is "localhost:8000")
  2. The function creates a structure that implements the SessionContent interface
  3. Additional optional parameters (in our example, this is the title and the icon file name)

The SessionContent interface is declared as:

type SessionContent interface {
	CreateRootView(session rui.Session) rui.View
}

A new instance of the helloWorldSession structure is created for each new session,

The CreateRootView function of the SessionContent interface creates a root element. When the user accesses the application by typing the address "localhost: 8000" in the browser, a new session is created. A new instance of the helloWorldSession structure is created for it, and at the end the CreateRootView function is called. The createRootView function returns a representation of a text that is created using the NewTextView function.

If you want the application to be visible outside your computer, then change the address in the Start function:

rui.StartApp(rui.GetLocalIP() + ":80", ...

Used data types

SizeUnit

The SizeUnit structure is used to set various sizes of interface elements such as width, height, padding, font size, etc. SizeUnit is declared as

type SizeUnit struct {
	Type  SizeUnitType
	Value float64
	Function SizeFunc
}

where Type is the type of size; Value is the size; Function is function (used only if Type == SizeFunction, ignored otherwise)

The Type can take the following values:

Value Constant Description
0 Auto default value. The Value field is ignored
1 SizeInPixel the Value field specifies the size in pixels.
2 SizeInEM the Value field specifies the size in em units. 1em is equal to the base font size, which is set in the browser settings
3 SizeInEX the Value field specifies the size in ex units.
4 SizeInPercent the Value field specifies the size as a percentage of the parent element size.
5 SizeInPt the Value field specifies the size in pt units (1pt = 1/72").
6 SizeInPc the Value field specifies the size in pc units (1pc = 12pt).
7 SizeInInch the Value field specifies the size in inches.
8 SizeInMM the Value field specifies the size in millimeters.
9 SizeInCM the Value field defines the size in centimeters.
10 SizeInFraction the Value field specifies the size in parts. Used only for sizing cells of the GridLayout.
11 SizeFunction the Function field specifies a function for calculating the size. The Value field is ignored

For a more visual and simple setting of variables of the SizeUnit type, the functions below can be used.

Function Equivalent definition
rui.AutoSize() rui.SizeUnit{ Type: rui.Auto }
rui.Px(n) rui.SizeUnit{ Type: rui.SizeInPixel, Value: n }
rui.Em(n) rui.SizeUnit{ Type: rui.SizeInEM, Value: n }
rui.Ex(n) rui.SizeUnit{ Type: rui.SizeInEX, Value: n }
rui.Percent(n) rui.SizeUnit{ Type: rui.SizeInPercent, Value: n }
rui.Pt(n) rui.SizeUnit{ Type: rui.SizeInPt, Value: n }
rui.Pc(n) rui.SizeUnit{ Type: rui.SizeInPc, Value: n }
rui.Inch(n) rui.SizeUnit{ Type: rui.SizeInInch, Value: n }
rui.Mm(n) rui.SizeUnit{ Type: rui.SizeInMM, Value: n }
rui.Cm(n) rui.SizeUnit{ Type: rui.SizeInCM, Value: n }
rui.Fr(n) rui.SizeUnit{ Type: rui.SizeInFraction, Value: n }

Variables of the SizeUnit type have a textual representation (why you need it will be described below). The textual representation consists of a number (equal to the value of the Value field) followed by a suffix defining the type. The exceptions are a value of type Auto, which has the representation "auto", and a value of type SizeFunction, which has a special representation. The suffixes are listed in the following table:

Suffix Type
px SizeInPixel
em SizeInEM
ex SizeInEX
% SizeInPercent
pt SizeInPt
pc SizeInPc
in SizeInInch
mm SizeInMM
cm SizeInCM
fr SizeInFraction

Examples: auto, 50%, 32px, 1.5in, 0.8em

To convert the textual representation to the SizeUnit structure, is used the function:

func StringToSizeUnit(value string) (SizeUnit, bool)

You can get a textual representation of the structure using the String() function of SizeUnit structure

SizeFunc

The SizeFunc interface is used to define a function that calculates SizeUnit. Let's consider functions using the min function as an example.

The min function finds the minimum value among the given arguments. This function is specified using the MinSize function, declared as:

func MinSize(arg0, arg1 any, args ...any) SizeFunc

The function has 2 or more arguments, each of which can be either SizeUnit or SizeFunc or string which is a constant or text representation of SizeUnit or SizeFunc.

Examples

rui.MizSize(rui.Percent(50), rui.Px(250))
rui.MizSize("50%", rui.Px(250), "40em")
rui.MizSize(rui.Percent(50), "@a1")

The min function has the following text representation

"min(<arg1>, <arg2>, ...)"

where arg1, arg2, ... must be a text representation of SizeUnit, or SizeFunc, or a constant. For example

"min(50%, 250px)"
"min(75%, @a1)"

The SizeFunc interface implements the fmt.Stringer interface. The String() function of this interface returns the textual representation of SizeFunc.

In addition to "min", there are the following functions

Text representation Function to create Description
"min(, , ...)" MaxSize(arg0, arg1 any, args ...any) finds the minimum value among the arguments
"sum(, , ...)" SumSize(arg0, arg1 any, args ...any) calculates the sum of the argument values
"sub(, )" SubSize(arg0, arg1 any) calculates the subtraction of argument values
"mul(, )" MulSize(arg0, arg1 any) calculates the result of multiplying the argument values
"div(, )" DivSize(arg0, arg1 any) calculates the result of dividing the argument values
"rem(, )" ModSize(arg0, arg1 any) calculates the remainder of a division operation with the same sign as the dividend
"mod(, )" ModSize(arg0, arg1 any) calculates the remainder of a division operation with the same sign as the divisor
"round(, )" RoundSize(arg0, arg1 any) rounds the first argument to the nearest integer multiple of the second argument, which may be either above or below the value.
"round-up(, )" RoundUpSize(arg0, arg1 any) rounds the first argument up to the nearest integer multiple of the second argument (if the value is negative, it will become "more positive")
"round-down(, )" RoundDownSize(arg0, arg1 any) rounds the first argument down to the nearest integer multiple of the second argument (if the value is negative, it will become "more negative")
"round-to-zero(, )" RoundToZeroSize(arg0, arg1 any) rounds the first argument to the nearest integer multiple of the second argument closer to/towards zero (a positive number will decrease, while a negative value will become "less negative")
"clamp(, , )" ClampSize(min, val, max any) limits value to specified range

Additional explanations for the function "clamp(, , )": the result is calculated as follows:

  • if min ≤ val ≤ max then val;
  • if val < min then min;
  • if max < val then max;

The arguments of all functions can be of the following type:

  • SizeUnit;
  • SizeFunc;
  • string being a SizeUnit constant or a text representation of SizeUnit or SizeFunc.

In addition, the second argument of the functions mul, div, mod, rem, and all round can be a number (float32, float32, int, int8...int64, uint, uint8...unit64).

Also, the second argument of the div, mod, rem, and all round functions cannot be a zero value.

Color

The Color type describes a 32-bit ARGB color:

type Color uint32

The Color type has three types of text representations:

  1. #AARRGGBB, #RRGGBB, #ARGB, #RGB

where A, R, G, B is a hexadecimal digit describing the corresponding component. If the alpha channel is not specified, then it is considered equal to FF. If the color component is specified by one digit, then it is doubled. For example, “# 48AD” is equivalent to “# 4488AADD”

  1. argb(A, R, G, B), rgb(R, G, B)

where A, R, G, B is the representation of the color component. The component can be west as a float number in the range [0 … 1], or as an integer in the range [0 … 255], or as a percentage from 0% to 100%.

Examples:

“argb(255, 128, 96, 0)”
“rgb(1.0, .5, .8)”
“rgb(0%, 50%, 25%)”
“argb(50%, 128, .5, 100%)”

The String function is used to convert a Color to a string. To convert a string to Color, is used the function:

func StringToColor(value string) (Color, bool)
  1. The name of the color. The RUI library defines the following colors
Name Color
black #ff000000
silver #ffc0c0c0
gray #ff808080
white #ffffffff
maroon #ff800000
red #ffff0000
purple #ff800080
fuchsia #ffff00ff
green #ff008000
lime #ff00ff00
olive #ff808000
yellow #ffffff00
navy #ff000080
blue #ff0000ff
teal #ff008080
aqua #ff00ffff
orange #ffffa500
aliceblue #fff0f8ff
antiquewhite #fffaebd7
aquamarine #ff7fffd4
azure #fff0ffff
beige #fff5f5dc
bisque #ffffe4c4
blanchedalmond #ffffebcd
blueviolet #ff8a2be2
brown #ffa52a2a
burlywood #ffdeb887
cadetblue #ff5f9ea0
chartreuse #ff7fff00
chocolate #ffd2691e
coral #ffff7f50
cornflowerblue #ff6495ed
cornsilk #fffff8dc
crimson #ffdc143c
cyan #ff00ffff
darkblue #ff00008b
darkcyan #ff008b8b
darkgoldenrod #ffb8860b
darkgray #ffa9a9a9
darkgreen #ff006400
darkgrey #ffa9a9a9
darkkhaki #ffbdb76b
darkmagenta #ff8b008b
darkolivegreen #ff556b2f
darkorange #ffff8c00
darkorchid #ff9932cc
darkred #ff8b0000
darksalmon #ffe9967a
darkseagreen #ff8fbc8f
darkslateblue #ff483d8b
darkslategray #ff2f4f4f
darkslategrey #ff2f4f4f
darkturquoise #ff00ced1
darkviolet #ff9400d3
deeppink #ffff1493
deepskyblue #ff00bfff
dimgray #ff696969
dimgrey #ff696969
dodgerblue #ff1e90ff
firebrick #ffb22222
floralwhite #fffffaf0
forestgreen #ff228b22
gainsboro #ffdcdcdc
ghostwhite #fff8f8ff
gold #ffffd700
goldenrod #ffdaa520
greenyellow #ffadff2f
grey #ff808080
honeydew #fff0fff0
hotpink #ffff69b4
indianred #ffcd5c5c
indigo #ff4b0082
ivory #fffffff0
khaki #fff0e68c
lavender #ffe6e6fa
lavenderblush #fffff0f5
lawngreen #ff7cfc00
lemonchiffon #fffffacd
lightblue #ffadd8e6
lightcoral #fff08080
lightcyan #ffe0ffff
lightgoldenrodyellow #fffafad2
lightgray #ffd3d3d3
lightgreen #ff90ee90
lightgrey #ffd3d3d3
lightpink #ffffb6c1
lightsalmon #ffffa07a
lightseagreen #ff20b2aa
lightskyblue #ff87cefa
lightslategray #ff778899
lightslategrey #ff778899
lightsteelblue #ffb0c4de
lightyellow #ffffffe0
limegreen #ff32cd32
linen #fffaf0e6
magenta #ffff00ff
mediumaquamarine #ff66cdaa
mediumblue #ff0000cd
mediumorchid #ffba55d3
mediumpurple #ff9370db
mediumseagreen #ff3cb371
mediumslateblue #ff7b68ee
mediumspringgreen #ff00fa9a
mediumturquoise #ff48d1cc
mediumvioletred #ffc71585
midnightblue #ff191970
mintcream #fff5fffa
mistyrose #ffffe4e1
moccasin #ffffe4b5
navajowhite #ffffdead
oldlace #fffdf5e6
olivedrab #ff6b8e23
orangered #ffff4500
orchid #ffda70d6
palegoldenrod #ffeee8aa
palegreen #ff98fb98
paleturquoise #ffafeeee
palevioletred #ffdb7093
papayawhip #ffffefd5
peachpuff #ffffdab9
peru #ffcd853f
pink #ffffc0cb
plum #ffdda0dd
powderblue #ffb0e0e6
rosybrown #ffbc8f8f
royalblue #ff4169e1
saddlebrown #ff8b4513
salmon #fffa8072
sandybrown #fff4a460
seagreen #ff2e8b57
seashell #fffff5ee
sienna #ffa0522d
skyblue #ff87ceeb
slateblue #ff6a5acd
slategray #ff708090
slategrey #ff708090
snow #fffffafa
springgreen #ff00ff7f
steelblue #ff4682b4
tan #ffd2b48c
thistle #ffd8bfd8
tomato #ffff6347
turquoise #ff40e0d0
violet #ffee82ee
wheat #fff5deb3
whitesmoke #fff5f5f5
yellowgreen #ff9acd32
AngleUnit

The AngleUnit type is used to set angular values. AngleUnit is declared as

type AngleUnit struct {
	Type  AngleUnitType
	Value float64
}

where Type is the type of angular value; Value is the angular value

The Type can take the following values:

  • Radian (0) - the Value field defines the angular value in radians.
  • PiRadian (1) - the Value field defines the angular value in radians multiplied by π.
  • Degree (2) - the Value field defines the angular value in degrees.
  • Gradian (3) - the Value field defines the angular value in grades (gradians).
  • Turn (4) - the Value field defines the angular value in turns (1 turn == 360°).

For a more visual and simple setting of variables of the AngleUnit type, the functions below can be used.

Function Equivalent definition
rui.Rad(n) rui.AngleUnit{ Type: rui.Radian, Value: n }
rui.PiRad(n) rui.AngleUnit{ Type: rui.PiRadian, Value: n }
rui.Deg(n) rui.AngleUnit{ Type: rui.Degree, Value: n }
rui.Grad(n) rui.AngleUnit{ Type: rui.Gradian, Value: n }

Variables of type AngleUnit have a textual representation consisting of a number (equal to the value of the Value field) followed by a suffix defining the type. The suffixes are listed in the following table:

Suffix Type
deg Degree
° Degree
rad Radian
π PiRadian
pi PiRadian
grad Gradian
turn Turn

Examples: “45deg”, “90°”, “3.14rad”, “2π”, “0.5pi”

The String function is used to convert AngleUnit to a string. To convert a string to AngleUnit is used the function:

func StringToAngleUnit(value string) (AngleUnit, bool)

View

View is an interface for accessing an element of "View" type. View is a rectangular area of the screen. All interface elements extend the View interface, i.e. View is the base element for all other elements in the library.

View has a number of properties like height, width, color, text parameters, etc. Each property has a text name. The Properties interface is used to read and write the property value (View implements this interface):

type Properties interface {
	Get(tag PropertyName) any
	Set(tag string, value any) bool
	Remove(tag string)
	Clear()
	AllTags() []string
}

The Get function returns the value of the property, or nil if the property is not set.

The Set function sets the value of a property. If the property value is set successfully, then the function returns true, if not, then false and a description of the error that occurred is written to the log.

The Remove function removes property value, equivalent to Set(nil)

To simplify setting / reading properties, there are also two global functions Get and Set:

func Get(rootView View, viewID, tag string) any
func Set(rootView View, viewID, tag string, value any) bool

These functions get/set the value of the child View

Tracking property changes

You can set a function to track the change of absolutely any View property (there are no exceptions). To set up a change listener, the View interface contains a function:

SetChangeListener(tag string, listener func(View, string))

where the first parameter is the name of the tracked property, and the second is the function that will be called every time the property value changes.

For example

view.SetChangeListener(rui.BackgroundColor, listener func(view View, tag string) {
	// The background color changed
})
Events

When interacting with the application, various events arise: clicks, resizing, changing input data, etc.

Event listeners are designed to respond to events. A listener is a function that is called every time an event occurs. Each event can have multiple listeners. Let's analyze the listeners using the example of the "edit-text-changed" text change event in the "EditView" editor.

The event listener is a function of the form

func(<View>[, <parameters>])

where the first argument is the View in which the event occurred. Further there are additional parameters of the event.

For "edit-text-changed", the main listener will look like this:

func(EditView, string)

where the second argument is the new text value

If you do not plan to use the first argument, you can omit it. This will be an additional listener

func(string)

In order to assign a listener, you must assign it to a property with the event name

view.Set(rui.EditTextChanged, func(edit EditView, newText string) {
	// do something
})

or

view.Set(rui.EditTextChanged, func(newText string) {
	// do something
})

Each event can have multiple listeners. In this regard, five data types can be used as listeners:

  • func(< View >[, < parameters >])
  • func([< parameters>])
  • []func(< View >[, < parameters >])
  • []func([< parameters >])
  • []any which only contains func(< View >[, < parameters >]) and func([< parameters >])

After being assigned to a property, all these types are converted to an array of []func(< View >, [< parameters >]). Accordingly, the Get function always returns an array of []func(< View >, [< parameters >]). If there are no listeners, this array will be empty.

For the "edit-text-changed" event, this

  • func(editor EditView, newText string)
  • func(newText string)
  • []func(editor EditView, newText string)
  • []func(newText string)
  • []any содержащий только func(editor EditView, newText string) и func(newText string)

And the "edit-text-changed" property always stores and returns []func(EditView, string).

In what follows, when describing specific events, only the format of the main listener will be presented.

"id" property

The "id" property is an optional textual identifier for the View. With it, you can find the child View. To do this, use the ViewByID function

func ViewByID(rootView View, id string) View

This function looks for a child View with id. The search starts from rootView. If View is not found, the function returns nil and an error message is written to the log.

When searching, you can specify a chain of identifiers. In this case, they must be separated by the '/' character. For example

view := rui.ViewByID(rootView, "id1/id2")

equivalent to

var view rui.View = nil
if view1 := rui.ViewByID(rootView, "id1"); view1 != nil {
	view = rui.ViewByID(view1, "id2")
}

Usually id is set when the View is created and is not changed later. But this is an optional condition. You can change the id at any time.

The Set function is used to set a new value for id. For example

view.Set(rui.ID, "myView")
view.Set("id", "myView")

There are two ways to get the id. The first is using the Get function:

if value := view.Get(rui.ID); value != nil {
	id = value.(string)
}

And the second one is using the ID() function:

id = view.ID()
"width", "height", "min-width", "min-height", "max-width", "max-height" properties

These properties are set:

Property Constant Description
"width" rui.Width The width of View
"height" rui.Height The height of View
"min-width" rui.MinWidth The minimum width of View
"min-height" rui.MinHeight The minimum height of View
"max-width" rui.MaxWidth The maximum width of View
"max-height" rui.MaxHeight The maximum height of View

These properties are of type SizeUnit. If the "width" / "height" value is not set or is set to Auto, then the height/width of the View is determined by its content and limited to the minimum and maximum height/width. As the value of these properties, you can set the SizeUnit structure, the textual representation of the SizeUnit, or the name of the constant (about the constants below):

view.Set("width", rui.Px(8))
view.Set(rui.MaxHeight, "80%")
view.Set(rui.Height, "@viewHeight")

After getting the value with the Get function, you must typecast:

if value := view.Get(rui.Width); value != nil {
	switch value.(type) {
		case string:
			text := value.(string)
			// TODO

		case SizeUnit:	
			size := value.(SizeUnit)
			// TODO
	}
}

This is quite cumbersome, therefore for each property there is a global function of the same name with the Get prefix, which performs the given cast, gets the value of the constant, if necessary, and returns it. All functions of this type have two arguments: View and subviewID ...string. The first argument is the root View, the second is the ID of the child View. If the ID of the child View is not specified or is passed as "", then the value of the root View is returned. For the properties "width", "height", "min-width", "min-height", "max-width", "max-height" these are functions:

func GetWidth(view View, subviewID ...string) SizeUnit
func GetHeight(view View, subviewID ...string) SizeUnit
func GetMinWidth(view View, subviewID ...string) SizeUnit
func GetMinHeight(view View, subviewID ...string) SizeUnit
func GetMaxWidth(view View, subviewID ...string) SizeUnit
func GetMaxHeight(view View, subviewID ...string) SizeUnit
"resize" property

The int "resize" property (Resize constant) sets whether the View can be resized, and if so, in which directions. Valid values

Value Constant Name Description
0 NoneResize "none" View cannot be resized.
1 BothResize "both" The View displays a mechanism for allowing the user to resize it, which may be resized both horizontally and vertically.
2 HorizontalResize "horizontal" The View displays a mechanism for allowing the user to resize it in the horizontal direction.
3 VerticalResize "vertical" The View displays a mechanism for allowing the user to resize it in the vertical direction.

The default value for all View types except multiline text editor is NoneResize(0). The default value for a multiline text editor is BothResize(1).

You can get the value of this property using the function

func GetResize(view View, subviewID ...string) int
"margin" and "padding" properties

The "margin" property determines the outer margins from this View to its neighbors. The "padding" property sets the padding from the border of the View to the content. The values of the "margin" and "padding" properties are stored as the BoundsProperty interface, which implements the Properties interface (see above). BoundsProperty has 4 SizeUnit properties:

Property Constant Description
"top" rui.Top Top padding
"right" rui.Right Right padding
"bottom" rui.Bottom Bottom padding
"left" rui.Left Left padding

The NewBoundsProperty function is used to create the BoundsProperty interface. Example

view.Set(rui.Margin, NewBoundsProperty(rui.Params {
	rui.Top:  rui.Px(8),
	rui.Left: "@topMargin",
	"right":   "1.5em",
	"bottom":  rui.Inch(0.3),
})))

Accordingly, if you request the "margin" or "padding" property using the Get method, the BoundsProperty interface will return:

if value := view.Get(rui.Margin); value != nil {
	margin := value.(BoundsProperty)
}

BoundsProperty using the "Bounds (session Session) Bounds" function of the BoundsProperty interface can be converted to a more convenient Bounds structure:

type Bounds struct {
	Top, Right, Bottom, Left SizeUnit
}

Global functions can also be used for this:

func GetMargin(view View, subviewID ...string) Bounds
func GetPadding(view View, subviewID ...string) Bounds

The textual representation of the BoundsProperty is as follows:

"_{ top = <top padding>, right = <right padding>, bottom = <bottom padding>, left = <left padding> }"

The value of the "margin" and "padding" properties can be passed to the Set method:

  • BoundsProperty interface or its textual representation;

  • Bounds structure;

  • SizeUnit or the name of a constant of type SizeUnit, in which case this value is set to all indents. Those.

    view.Set(rui.Margin, rui.Px(8))

equivalent to

view.Set(rui.Margin, rui.Bounds{Top: rui.Px(8), Right: rui.Px(8), Bottom: rui.Px(8), Left: rui.Px(8)})

Since the value of the "margin" and "padding" property is always stored as the BoundsProperty interface, if you read the "margin" or "padding" property set by the Bounds or SizeUnit with the Get function, then you get the BoundsProperty, not the Bounds or SizeUnit.

The "margin" and "padding" properties are used to set four margins at once. The following properties are used to set individual paddings:

Property Constant Description
"margin-top" rui.MarginTop The top margin
"margin-right" rui.MarginRight The right margin
"margin-bottom" rui.MarginBottom The bottom margin
"margin-left" rui.MarginLeft The left margin
"padding-top" rui.PaddingTop The top padding
"padding-right" rui.PaddingRight The right padding
"padding-bottom" rui.PaddingBottom The bottom padding
"padding-left" rui.PaddingLeft The left padding

Example

view.Set(rui.Margin, rui.Px(8))
view.Set(rui.TopMargin, rui.Px(12))

equivalent to

view.Set(rui.Margin, rui.Bounds{Top: rui.Px(12), Right: rui.Px(8), Bottom: rui.Px(8), Left: rui.Px(8)})
"border" property

The "border" property defines a border around the View. The frame line is described by three attributes: line style, thickness and color.

The value of the "border" property is stored as the BorderProperty interface, which implements the Properties interface (see above). BorderProperty can contain the following properties:

Property Constant Type Description
"left-style" LeftStyle int Left border line style
"right-style" RightStyle int Right border line style
"top-style" TopStyle int Top border line style
"bottom-style" BottomStyle int Bottom border line style
"left-width" LeftWidth SizeUnit Left border line width
"right-width" RightWidth SizeUnit Right border line width
"top-width" TopWidth SizeUnit Top border line width
"bottom-width" BottomWidth SizeUnit Bottom border line width
"left-color" LeftColor Color Left border line color
"right-color" RightColor Color Right border line color
"top-color" TopColor Color Top border line color
"bottom-color" BottomColor Color Bottom border line color

Line style can take the following values:

Value Constant Name Description
0 NoneLine "none" No frame
1 SolidLine "solid" Solid line
2 DashedLine "dashed" Dashed line
3 DottedLine "dotted" Dotted line
4 DoubleLine "double" Double solid line

All other style values are ignored.

The NewBorder function is used to create the BorderProperty interface.

If all the lines of the frame are the same, then the following properties can be used to set the style, thickness and color:

Property Constant Type Description
"style" Style int Border line style
"width" Width SizeUnit Border line width
"color" ColorTag Color Border line color

Example

view.Set(rui.Border, NewBorder(rui.Params{
	rui.LeftStyle:   rui.SolidBorder,
	rui.RightStyle:  rui.SolidBorder,
	rui.TopStyle:    rui.SolidBorder,
	rui.BottomStyle: rui.SolidBorder,
	rui.LeftWidth:   rui.Px(1),
	rui.RightWidth:  rui.Px(1),
	rui.TopWidth:    rui.Px(1),
	rui.BottomWidth: rui.Px(1),
	rui.LeftColor:   rui.Black,
	rui.RightColor:  rui.Black,
	rui.TopColor:    rui.Black,
	rui.BottomColor: rui.Black,
}))

equivalent to

view.Set(rui.Border, NewBorder(rui.Params{
	rui.Style   : rui.SolidBorder,
	rui.Width   : rui.Px(1),
	rui.ColorTag: rui.Black,
}))

The BorderProperty interface can be converted to a ViewBorders structure using the Border function. When converted, all text constants are replaced with real values. ViewBorders is described as

 type ViewBorders struct {
	Top, Right, Bottom, Left ViewBorder
}

where the ViewBorder structure is described as

type ViewBorder struct {
	Style int
	Color Color
	Width SizeUnit
}

The ViewBorders structure can be passed as a parameter to the Set function when setting the value of the "border" property. This converts the ViewBorders to BorderProperty. Therefore, when the property is read, the Get function will return the BorderProperty interface, not the ViewBorders structure. You can get the ViewBorders structure without additional transformations using the global function

func GetBorder(view View, subviewID ...string) ViewBorders

Besides the auxiliary properties "style", "width" and "color" there are 4 more: "left", "right", "top" and "bottom". As a value, these properties can only take the ViewBorder structure and allow you to set all the attributes of the line of the side of the same name.

You can also set individual frame attributes using the Set function of the View interface. For this, the following properties are used

Property Constant Type Description
"border-left-style" BorderLeftStyle int Left border line style
"border-right-style" BorderRightStyle int Right border line style
"border-top-style" BorderTopStyle int Top border line style
"border-bottom-style" BorderBottomStyle int Bottom border line style
"border-left-width" BorderLeftWidth SizeUnit Left border line width
"border-right-width" BorderRightWidth SizeUnit Right border line width
"border-top-width" BorderTopWidth SizeUnit Top border line width
"border-bottom-width" BorderBottomWidth SizeUnit Bottom border line width
"border-left-color" BorderLeftColor Color Left border line color
"border-right-color" BorderRightColor Color Right border line color
"border-top-color" BorderTopColor Color Top border line color
"border-bottom-color" BorderBottomColor Color Bottom border line color
"border-style" BorderStyle int Border line style
"border-width" BorderWidth SizeUnit Border line width
"border-color" BorderColor Color Border line color
"border-left" BorderLeft ViewBorder Left border line
"border-right" BorderRight ViewBorder Right border line
"border-top" BorderTop ViewBorder Top border line
"border-bottom" BorderBottom ViewBorder Bottom border line

Example

view.Set(rui.BorderStyle, rui.SolidBorder)
view.Set(rui.BorderWidth, rui.Px(1))
view.Set(rui.BorderColor, rui.Black)

equivalent to

view.Set(rui.Border, NewBorder(rui.Params{
	rui.Style   : rui.SolidBorder,
	rui.Width   : rui.Px(1),
	rui.ColorTag: rui.Black,
}))
"outline" and "outline-offset" properties

The "outline" property defines the border outside the View. A frame line is described by three attributes: line style, thickness, and color.

The "outline" property is similar to the "border" property. The three main differences between an "outline" frame and a "border" frame are:

  1. the "border" frame is always located inside the boundaries of the View, and the "outline" frame can be located both inside the View and outside it;

  2. all sides of the "outline" frame are the same, while the sides of the "border" frame can have different color, style and thickness.

  3. "border" thickness is added to "padding" and "outline" thickness does not affect "padding".

The value of the "border" property is stored as an OutlineProperty interface that implements the Properties interface (see above). OutlineProperty can contain the following properties:

Property Constant Type Description
"style" Style int Border line style
"width" Width SizeUnit Border line width
"color" ColorTag Color Border line color

Line style can take the following values:

Value Constant Name Description
0 NoneLine "none" No frame
1 SolidLine "solid" Solid line
2 DashedLine "dashed" Dashed line
3 DottedLine "dotted" Dotted line
4 DoubleLine "double" Double solid line

All other style values are ignored.

The NewOutline function is used to create the OutlineProperty interface.

By default, the inner border of the "outline" border is the same as the border of the View (i.e. the border is drawn around the View). To change this behavior, use the "outline-offset" SizeUnit property (OutlineOffset constant). This property defines the distance between the inner border of the frame and the border of the View. A positive value moves the frame away from the View's boundaries, while a negative value forces the frame to be inside the View (in this case, the frame is drawn on top of the contents of the View).

"radius" property

The "radius" property sets the elliptical corner radius of the View. Radii are specified by the RadiusProperty interface that implements the Properties interface (see above). For this, the following properties of the SizeUnit type are used:

Property Constant Description
"top-left-x" TopLeftX x-radius of the top left corner
"top-left-y" TopLeftY y-radius of the top left corner
"top-right-x" TopRightX x-radius of the top right corner
"top-right-y" TopRightY y-radius of the top right corner
"bottom-left-x" BottomLeftX x-radius of the bottom left corner
"bottom-left-y" BottomLeftY y-radius of the bottom left corner
"bottom-right-x" BottomRightX x-radius of the bottom right corner
"bottom-right-y" BottomRightY y-radius of the bottom right corner

If the x- and y-radii are the same, then you can use the auxiliary properties

Property Constant Description
"top-left" TopLeft top left corner radius
"top-right" TopRight top right corner radius
"bottom-left" BottomLeft bottom left corner radius
"bottom-right" BottomRight bottom right corner radius

To set all radii to the same values, use the "x" and "y" properties

The RadiusProperty interface is created using the NewRadiusProperty function. Example

view.Set(rui.Radius, NewRadiusProperty(rui.Params{
	rui.X: rui.Px(16),
	rui.Y: rui.Px(8),
	rui.TopLeft: rui.Px(0),
	rui.BottomRight: rui.Px(0),
}))

equivalent to

view.Set(rui.Radius, NewRadiusProperty(rui.Params{
	rui.TopRightX: rui.Px(16),
	rui.TopRightY: rui.Px(8),
	rui.BottomLeftX: rui.Px(16),
	rui.BottomLeftY: rui.Px(8),
	rui.TopLeftX: rui.Px(0),
	rui.TopLeftX: rui.Px(0),
	rui.BottomRightX: rui.Px(0),
	rui.BottomRightY: rui.Px(0),
}))

If all radii are the same, then the given SizeUnit value can be directly assigned to the "radius" property

view.Set(rui.Radius, rui.Px(4))

RadiusProperty has a textual representation of the following form:

_{ <radius id> = <SizeUnit text> [/ <SizeUnit text>] [, <radius id> = <SizeUnit text> [/ <SizeUnit text>]] … }

where can take the following values: "x", "y", "top-left", "top-left-x", "top-left-y", "top-right", "top-right-x", "top-right-y", "bottom-left", "bottom-left-x", "bottom-left-y", "bottom-right", "bottom-right-x", "bottom-right-y".

Values like " / " can only be assigned to the "top-left", "top-right", "bottom-left" and "bottom-right" properties.

Examples:

_{ x = 4px, y = 4px, top-left = 8px, bottom-right = 8px }

equivalent to

_{ top-left = 8px, top-right = 4px, bottom-left = 4px, bottom-right = 8px }

or

_{ top-left = 8px / 8px, top-right = 4px / 4px, bottom-left = 4px / 4px, bottom-right = 8px / 8px }

or

_{ top-left-x = 8px, top-left-y = 8px, top-right-x = 4px, top-right-y = 4px,
	bottom-left-x = 4px, bottom-left-y = 4px, bottom-right-x = 8px, bottom-right-y = 8px }

The RadiusProperty interface can be converted to a BoxRadius structure using the BoxRadius function. When converted, all text constants are replaced with real values. BoxRadius is described as

type BoxRadius struct {
	TopLeftX, TopLeftY, TopRightX, TopRightY, BottomLeftX, BottomLeftY, BottomRightX, BottomRightY SizeUnit
}

The BoxRadius structure can be passed as a parameter to the Set function by setting the value of the "radius" property. This converts BoxRadius to RadiusProperty. Therefore, when the property is read, the Get function will return the RadiusProperty interface, not the BoxRadius structure. You can get the BoxRadius structure without additional transformations using the global function

func GetRadius(view View, subviewID ...string) BoxRadius

You can also set individual radii using the Set function of the View interface. For this, the following properties are used

Property Constant Description
"radius-x" RadiusX All x-radii
"radius-y" RadiusY All y-radii
"radius-top-left-x" RadiusTopLeftX x-radius of the top left corner
"radius-top-left-y" RadiusTopLeftY y-radius of the top left corner
"radius-top-right-x" RadiusTopRightX x-radius of the top right corner
"radius-top-right-y" RadiusTopRightY y-radius of the top right corner
"radius-bottom-left-x" RadiusBottomLeftX x-radius of the bottom left corner
"radius-bottom-left-y" RadiusBottomLeftY y-radius of the bottom left corner
"radius-bottom-right-x" RadiusBottomRightX x-radius of the bottom right corner
"radius-bottom-right-y" RadiusBottomRightY y-radius of the bottom right corner
"radius-top-left" RadiusTopLeft top left corner radius
"radius-top-right" RadiusTopRight top right corner radius
"radius-bottom-left" RadiusBottomLeft bottom left corner radius
"radius-bottom-right" RadiusBottomRight bottom right corner radius

Example

view.Set(rui.RadiusX, rui.Px(4))
view.Set(rui.RadiusY, rui.Px(32))

equivalent to

view.Set(rui.Border, NewRadiusProperty(rui.Params{
	rui.X: rui.Px(4),
	rui.Y: rui.Px(32),
}))
"shadow" property

The "shadow" property allows you to set shadows for the View. There may be several shadows. The shadow is described using the ShadowProperty interface extending the Properties interface (see above). The shadow has the following properties:

Property Constant Type Description
"color" ColorTag Color Shadow color
"inset" Inset bool true - the shadow inside the View, false - outside
"x-offset" XOffset SizeUnit Offset the shadow along the X axis
"y-offset" YOffset SizeUnit Offset the shadow along the Y axis
"blur" BlurRadius float Shadow blur radius. The value must be >= 0
"spread-radius" SpreadRadius float Increase the shadow. Value > 0 increases shadow, < 0 decreases shadow

Three functions are used to create a ShadowProperty:

func NewShadowProperty(offsetX, offsetY, blurRadius, spread-radius SizeUnit, color Color) ShadowProperty
func NewInsetShadowProperty(offsetX, offsetY, blurRadius, spread-radius SizeUnit, color Color) ShadowProperty
func NewShadowWithParams(params Params) ShadowProperty

The NewShadowProperty function creates an outer shadow (Inset == false), NewInsetShadowProperty - an inner one (Inset == true). The NewShadowWithParams function is used when constants must be used as parameters. For example:

shadow := NewShadowWithParams(rui.Params{
	rui.ColorTag  : "@shadowColor",
	rui.BlurRadius: 8.0,
	rui.Dilation  : 16.0,
})

ShadowProperty, ShadowProperty array, and ShadowProperty textual representation can be assigned as a value to the "shadow" property.

The ShadowProperty text representation has the following format:

_{ color = <color> [, x-offset = <offset>] [, y-offset = <offset>] [, blur = <radius>]
	[, spread-radius = <increase>] [, inset = <type>] }

You can get the value of "shadow" property using the function

func GetShadowPropertys(view View, subviewID ...string) []ShadowProperty

If no shadow is specified, then this function will return an empty array

"background-color" property

Constant: rui.BackgroundColor. Get function: GetBackgroundColor() Color

The "background-color" property sets the background color. Valid values are Color, an integer, the textual representation of Color, and a constant name starting with '@'. An integer must encode the color in the AARRGGBB format

In addition to color, images and gradients can also be used as backgrounds (see below). In this case, "background-color" is used for transparent areas of images.

"background-clip" property

The "background-clip" property determines how the background color and / or background image will be displayed below the box borders.

If no background image or color is specified, this property will have a visual effect only if the border has transparent areas or partially opaque areas; otherwise, the border hides the difference.

The property can take the following values:

Value Constant Name Description
0 BorderBoxClip "border-box" The background extends to the outer edge of the border (but below the border in z-order).
1 PaddingBoxClip "padding-box" The background extends to the outer edge of the padding. No background is drawn below the border.
2 ContentBoxClip "content-box" The background is painted inside (clipped) of the content box.
"background" property

In addition to color, pictures and / or gradient fills can also be specified as the background of the View. The property "background" is used for this. The background can contain multiple images and gradients. Each background element is described by the BackgroundElement interface. BackgroundElement can be of three types: linear gradient, radial gradient, and image.

Linear gradient

A linear gradient is created using the function

func NewBackgroundLinearGradient(params Params) BackgroundElement

The linear gradient has the following options:

  • Direction ("direction") - defines the direction of the gradient line (the line along which the color changes). Optional parameter. The default direction is from bottom to top. It can be either AngleUnit (the angle of inclination of the line relative to the vertical) or one of the following int values:
Value Constant Name Description
0 ToTopGradient "to-top" Line goes from bottom to top
1 ToRightTopGradient "to-right-top" From bottom left to top right
2 ToRightGradient "to-right" From left to right
3 ToRightBottomGradient "to-right-bottom" From top left to bottom right
4 ToBottomGradient "to-bottom" From top to bottom (default)
5 ToLeftBottomGradient "to-left-bottom" From the upper right corner to the lower left
6 ToLeftGradient "to-left" From right to left
7 ToLeftTopGradient "to-left-top" From the bottom right corner to the top left
  • Gradient ("gradient") - array of gradient key points (required parameter). Each point is described by a BackgroundGradientPoint structure, which has two fields: Pos of type SizeUnit and Color. Pos defines the position of the point relative to the start of the gradient line. The array must have at least 2 points. You can also pass a Color array as the gradient value. In this case, the points are evenly distributed along the gradient line. You can also use an array of []any as an array of cue points. The elements of this array can be BackgroundGradientPoint, Color, BackgroundGradientPoint or Color text representation, and the name of the constant

  • Repeating ("repeating") - a boolean value that determines whether the gradient will repeat after the last key point. Optional parameter. The default is false (do not repeat)

The linear gradient text representation is as follows:

linear-gradient { gradient = <value> [, direction = <value>] [, repeat = <value>] }
Radial gradient

A radial gradient is created using the function

func NewBackgroundRadialGradient(params Params) BackgroundElement

The radial gradient has the following parameters:

  • Gradient ("gradient") - array of gradient key points (required parameter). Identical to the linear gradient parameter of the same name.

  • Repeating ("repeating") - a boolean value that determines whether the gradient will repeat after the last key point. Optional parameter. The default is false (do not repeat)

  • RadialGradientShape ("radial-gradient-shape") or Shape ("shape") - defines the shape of the gradient. It can take one of two int values:

Value Constant Name Description
0 EllipseGradient "ellipse" The shape is an axis-aligned ellipse
1 CircleGradient "circle" The shape is a circle with a constant radius

Optional parameter. The default is EllipseGradient

  • RadialGradientRadius ("radial-gradient-radius") or Radius ("radius") - sets the radius of the gradient. Can be either SizeUnit or one of the following int values:
Value Constant Name Description
0 ClosestSideGradient "closest-side" The final shape of the gradient corresponds to the side of the rectangle closest to its center (for circles), or both vertical and horizontal sides closest to the center (for ellipses)
1 ClosestCornerGradient "closest-corner" The final shape of the gradient is defined so that it exactly matches the closest corner of the window from its center
2 FarthestSideGradient "farthest-side" Similar to ClosestSideGradient, except that the size of the shape is determined by the farthest side from its center (or vertical and horizontal sides)
3 FarthestCornerGradient "farthest-corner" The final shape of the gradient is defined so that it exactly matches the farthest corner of the rectangle from its center

Optional parameter. The default is FarthestCornerGradient

  • CenterX ("center-x"), CenterY ("center-y") - sets the center of the gradient relative to the upper left corner of the View. Takes in a SizeUnit value. Optional parameter. The default value is "50%", i.e. the center of the gradient is the center of the View.

The linear gradient text representation is as follows:

radial-gradient { gradient = <Value> [, repeat = <Value>] [, shape = <Value>]
	[, radius = <Value>][, center-x = <Value>][, center-y = <Value>]}
Conic gradient

The conic gradient is created using the function

func NewBackgroundConicGradient(params Params) BackgroundElement

The radial gradient has the following options:

  • Gradient ("gradient") - array of gradient key angles (required parameter). Each key angle is described by a BackgroundGradientAngle structure:

    type BackgroundGradientAngle struct { Color any Angle any }

where Color specifies the color of the key corner and can take a value of Color type or string (color constant or textual description of the color); Angle sets the angle relative to the initial angle specified by the From parameter and can take a value of the AngleUnit type or string (an angle constant or a textual description of the angle).

The Color field is required and cannot be nil.

The Angle field is optional. If it is nil, then the angle is set as the midpoint between adjacent corners. For the first element, the default angle is 0°, for the last element it is 360°.

  • Repeating ("repeating") is a boolean value that determines whether the gradient will repeat after the last key corner. Optional parameter. Default value is false (don't repeat)

  • CenterX ("center-x"), CenterY ("center-y") - sets the center of the gradient relative to the upper left corner of the View. Takes a value of SizeUnit type. Optional parameter. The default value is "50%", i.e. the center of the gradient is the same as the center of the View.

The textual representation of a conic gradient looks like this:

conic-gradient { gradient = <Value> [, repeating = <Value>] [, from = <Value>]
	[, center-x = <Value>][, center-y = <Value>]}
Image

The background image is created using the function

func NewBackgroundImage(params Params) BackgroundElement

The image has the following parameters:

  • Source ("src") - Specifies the URL of the image

  • Fit ("fit") - an optional parameter that determines the scaling of the image. Can be one of the following Int values:

Constant Value Name Description
NoneFit 0 "none" No scaling (default). The dimensions of the image are determined by the Width and Height parameters.
ContainFit 1 "contain" The image is scaled proportionally so that its width or height is equal to the width or height of the background area. Image can be cropped to width or height
CoverFit 2 "cover" The image is scaled with the same proportions so that the whole picture fits inside the background area
  • Width ("width"), Height (height) - optional SizeUnit parameters that specify the height and width of the image. Used only if Fit is NoneFit. The default is Auto (original size). The percentage value sets the size relative to the height and width of the background area, respectively

  • Attachment -

  • Repeat (repeat) - an optional parameter specifying the repetition of the image. Can be one of the following int values:

Constant Value Name Description
NoRepeat 0 "no-repeat" Image does not repeat (default)
RepeatXY 1 "repeat" The image repeats horizontally and vertically
RepeatX 2 "repeat-x" The image repeats only horizontally
RepeatY 3 "repeat-y" Image repeats vertically only
RepeatRound 4 "round" The image is repeated so that an integer number of images fit into the background area; if this fails, then the background images are scaled
RepeatSpace 5 "space" The image is repeated as many times as necessary to fill the background area; if this fails, an empty space is added between the pictures
  • ImageHorizontalAlign,

  • ImageVerticalAlign,

"background-blend-mode" property

The "background-blend-mode" int property (BackgroundBlendMode constant)sets how an view's background images should blend with each other and with the view's background color.

Can take one of the following values:

Constant Value Name Description
BlendNormal 0 "normal" The final color is the top color, regardless of what the bottom color is. The effect is like two opaque pieces of paper overlapping.
BlendMultiply 1 "multiply" The final color is the result of multiplying the top and bottom colors. A black layer leads to a black final layer, and a white layer leads to no change. The effect is like two images printed on transparent film overlapping.
BlendScreen 2 "screen" The final color is the result of inverting the colors, multiplying them, and inverting that value. A black layer leads to no change, and a white layer leads to a white final layer. The effect is like two images shone onto a projection screen.
BlendOverlay 3 "overlay" The final color is the result of multiply if the bottom color is darker, or screen if the bottom color is lighter. This blend mode is equivalent to hard-light but with the layers swapped.
BlendDarken 4 "darken" The final color is composed of the darkest values of each color channel.
BlendLighten 5 "lighten" The final color is composed of the lightest values of each color channel.
BlendColorDodge 6 "color-dodge" The final color is the result of dividing the bottom color by the inverse of the top color. A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color. This blend mode is similar to screen, but the foreground need only be as light as the inverse of the backdrop to create a fully lit color.
BlendColorBurn 7 "color-burn" The final color is the result of inverting the bottom color, dividing the value by the top color, and inverting that value. A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image. This blend mode is similar to multiply, but the foreground need only be as dark as the inverse of the backdrop to make the final image black.
BlendHardLight 8 "hard-light" The final color is the result of multiply if the top color is darker, or screen if the top color is lighter. This blend mode is equivalent to overlay but with the layers swapped. The effect is similar to shining a harsh spotlight on the backdrop.
BlendSoftLight 9 "soft-light" The final color is similar to hard-light, but softer. This blend mode behaves similar to hard-light. The effect is similar to shining a diffused spotlight on the backdrop*.*
BlendDifference 10 "difference" The final color is the result of subtracting the darker of the two colors from the lighter one. A black layer has no effect, while a white layer inverts the other layer's color.
BlendExclusion 11 "exclusion" The final color is similar to difference, but with less contrast. As with difference, a black layer has no effect, while a white layer inverts the other layer's color.
BlendHue 12 "hue" The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
BlendSaturation 13 "saturation" The final color has the saturation of the top color, while using the hue and luminosity of the bottom color. A pure gray backdrop, having no saturation, will have no effect.
BlendColor 14 "color" The final color has the hue and saturation of the top color, while using the luminosity of the bottom color. The effect preserves gray levels and can be used to colorize the foreground.
BlendLuminosity 15 "luminosity" The final color has the luminosity of the top color, while using the hue and saturation of the bottom color. This blend mode is equivalent to BlendColor, but with the layers swapped.

You can get the value of this property using the function

func GetBackgroundBlendMode(view View, subviewID ...string) int
"mix-blend-mode" property

The "mix-blend-mode" int property (MixBlendMode constant) sets how a view's content should blend with the content of the view's parent and the view's background.

Possible values of this property are similar to the values of the "background-blend-mode" property (see above)

You can get the value of this property using the function

func GetMixBlendMode(view View, subviewID ...string) int
"clip" property

The "clip" property (Clip constant) of the ClipShapeProperty type specifies the crop area. There are 4 types of crop areas

inset

Rectangular cropping area. Created with the function:

func NewInsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShapeProperty

where top, right, bottom, left are the distance from respectively the top, right, bottom and left borders of the View to the cropping border of the same name; radius - sets the radii of the corners of the cropping area (see the description of the RadiusProperty type above). If there should be no rounding of corners, then nil must be passed as radius

The textual description of the rectangular cropping area is in the following format

inset{ top = <top value>, right = <right value>, bottom = <bottom value>, left = <left value>,
	[radius = <RadiusProperty text>] }
}
circle

Round cropping area. Created with the function:

func NewCircleClip(x, y, radius SizeUnit) ClipShapeProperty

where x, y - coordinates of the center of the circle; radius - radius

The textual description of the circular cropping area is in the following format

circle{ x = <x value>, y = <y value>, radius = <radius value> }
ellipse

Elliptical cropping area. Created with the function:

func NewEllipseClip(x, y, rx, ry SizeUnit) ClipShapeProperty

where x, y - coordinates of the center of the ellipse; rх - radius of the ellipse along the X axis; ry is the radius of the ellipse along the Y axis.

The textual description of the elliptical clipping region is in the following format

ellipse{ x = <x value>, y = <y value>, radius-x = <x radius value>, radius-y = <y radius value> }
polygon

Polygonal cropping area. Created using functions:

func NewPolygonClip(points []any) ClipShapeProperty
func NewPolygonPointsClip(points []SizeUnit) ClipShapeProperty

an array of corner points of the polygon is passed as an argument in the following order: x1, y1, x2, y2, … The elements of the argument to the PolygonClip function can be either text constants, or the text representation of SizeUnit, or elements of type SizeUnit.

The textual description of the polygonal cropping area is in the following format

polygon{ points = "<x1 value>, <y1 value>, <x2 value>, <y2 value>,…" }
"opacity" property

The "opacity" property (Opacity constant) of the float64 type sets the transparency of the View. Valid values are from 0 to 1. Where 1 - View is fully opaque, 0 - fully transparent.

You can get the value of this property using the function

func GetOpacity(view View, subviewID ...string) float64
"tabindex" property

The "tabindex" int property (TabIndex constant) determines whether this View should participate in sequential navigation throughout the page using the keyboard and in what order. It can take one of the following types of values:

  • negative value - View can be selected with the mouse or touch, but does not participate in sequential navigation;

  • 0 - View can be selected and reached using sequential navigation, the order of navigation is determined by the browser (usually in order of addition);

  • positive value - the element will be reached (and selected) using sequential navigation, and navigation is performed by ascending "tabindex" value. If multiple elements contain the same "tabindex" value, navigation is done in the order in which they were added.

You can get the value of this property using the function

func GetTabIndex(viewView, subviewID ...string) int
"z-index" property

The "z-index" property (constant ZIndex) of type int defines the position of the element and its children along the z-axis. In the case of overlapping elements, this value determines the stacking order. In general, the elements higher z-indexes overlap elements with lower.

You can get the value of this property using the function

func GetZIndex(view View, subviewID ...string) int
"visibility" property

The "visibility" int property (constant Visibility) specifies the visibility of the View. Valid values

Value Constant Name Visibility
0 Visible "visible" View is visible. Default value.
1 Invisible "invisible" View is invisible but takes up space.
2 Gone "gone" View is invisible and does not take up space.

You can get the value of this property using the function

func GetVisibility(view View, subviewID ...string) int
"filter" and "backdrop-filter" properties

The "filter" property (Filter constant) applies graphical effects to the View, such as blurring, color shifting, changing brightness/contrast, etc. The "backdrop-filter" property (BackdropFilter constant) applies the same effects but to the area behind a View.

Only the FilterProperty interface is used as the value of the "filter" properties. FilterProperty is created using the function

func NewFilterProperty(params Params) FilterProperty

The argument lists the effects to apply. The following effects are possible:

Effect Constant Type Description
"blur" Blur float64 0…10000px Gaussian blur
"brightness" Brightness float64 0…10000% Brightness change
"contrast" Contrast float64 0…10000% Contrast change
"drop-shadow" DropShadow []ShadowProperty Adding shadow
"grayscale" Grayscale float64 0…100% Converting to grayscale
"hue-rotate" HueRotate AngleUnit Hue rotation
"invert" Invert float64 0…100% Invert colors
"opacity" Opacity float64 0…100% Changing transparency
"saturate" Saturate float64 0…10000% Saturation change
"sepia" Sepia float64 0…100% Conversion to sepia

Example

rui.Set(view, "subview", rui.Filter, rui.NewFilter(rui.Params{
    rui.Brightness: 200,
    rui.Contrast: 150,
}))

You can get the value of the current filter using functions

func GetFilter(view View, subviewID ...string) FilterProperty
func GetBackdropFilter(view View, subviewID ...string) FilterProperty
"semantics" property

The "semantics" string property (Semantics constant) defines the semantic meaning of the View. This property may have no visible effect, but it allows search engines to understand the structure of your application. It also helps to voice the interface to systems for people with disabilities:

Value Name Semantics
0 "default" Unspecified. Default value.
1 "article" A stand-alone part of the application intended for independent distribution or reuse.
2 "section" A stand-alone section that cannot be represented by a more precise semantically element
3 "aside" A part of a document whose content is only indirectly related to the main content (footnote, label)
4 "header" Application Title
5 "main" Main content (content) of the application
6 "footer" Footer
7 "navigation" Navigation bar
8 "figure" Image
9 "figure-caption" Image Title. Should be inside "figure"
10 "button" Button
11 "p" Paragraph
12 "h1" Level 1 text heading. Changes the style of the text
13 "h2" Level 2 text heading. Changes the style of the text
14 "h3" Level 3 text heading. Changes the style of the text
15 "h4" Level 4 text heading. Changes the style of the text
16 "h5" Level 5 text heading. Changes the style of the text
17 "h6" Level 6 text heading. Changes the style of the text
18 "blockquote" Quote. Changes the style of the text
19 "code" Program code. Changes the style of the text
"tooltip" property

The "tooltip" string property (Tooltip constant) specifies the tooltip text. Tooltip pops up when hovering the mouse cursor. You can use html tags when formatting the tooltip text.

Text properties

All properties listed in this section are inherited, i.e. the property will apply not only to the View for which it is set, but also to all Views nested in it.

The following properties are available to customize the text display options:

"font-name" property

Property "font-name" (constant FontName) - the text property specifies the name of the font to use. Multiple fonts can be specified. In this case, they are separated by a space. Fonts are applied in the order in which they are listed. Those, the first is applied first, if it is not available, then the second, third, etc.

You can get the value of this property using the function

func GetFontName(view View, subviewID ...string) string
"text-color" property

Property "text-color" (constant TextColor) - the Color property determines the color of the text.

You can get the value of this property using the function

func GetTextColor(view View, subviewID ...string) Color
"text-size" property

Property "text-size" (constant TextSize) - the SizeUnit property determines the size of the font.

You can get the value of this property using the function

func GetTextSize(view View, subviewID ...string) SizeUnit
"italic" property

The "italic" property (constant Italic) is the bool property. If the value is true, then italics are applied to the text

You can get the value of this property using the function

func IsItalic(view View, subviewID ...string) bool
"small-caps" property

The "small-caps" property (SmallCaps constant) is the bool property. If the value is true, then small-caps is applied to the text.

You can get the value of this property using the function

func IsSmallCaps(view View, subviewID ...string) bool
"white-space" property

The "white-space" (WhiteSpace constant) int property controls how whitespace is handled within the View. The "white-space" property can take the following values:

0 (constant WhiteSpaceNormal, name "normal") - sequences of spaces are concatenated into one space. Newlines in the source are treated as a single space. Applying this value optionally splits lines to fill inline boxes.

1 (constant WhiteSpaceNowrap, name "nowrap") - Concatenates sequences of spaces into one space, like a normal value, but does not wrap lines (text wrapping) within the text.

2 (constant WhiteSpacePre, name "pre") - sequences of spaces are saved as they are specified in the source. Lines are wrapped only where newlines are specified in the source and where "br" elements are specified in the source.

3 (constant WhiteSpacePreWrap, name "pre-wrap") - sequences of spaces are saved as they are indicated in the source. Lines are wrapped only where newlines are specified in the source and there, where "br" elements are specified in the source, and optionally to fill inline boxes.

4 (constant WhiteSpacePreLine, name "pre-line") - sequences of spaces are concatenated into one space. Lines are split on newlines, on "br" elements, and optionally to fill inline boxes.

5 (constant WhiteSpaceBreakSpaces, name "break-spaces") - the behavior is identical to pre-wrap with the following differences:

  • Sequences of spaces are preserved as specified in the source, including spaces at the end of lines.
  • Lines are wrapped on any spaces, including in the middle of a sequence of spaces.
  • Spaces take up space and do not hang at the ends of lines, which means they affect the internal dimensions (min-content and max-content).

The table below shows the behavior of various values of the "white-space" property.

New lines Spaces and Tabs Text wrapping End of line spaces End-of-line other space separators
WhiteSpaceNormal Collapse Collapse Wrap Remove Hang
WhiteSpaceNowrap Collapse Collapse No wrap Remove Hang
WhiteSpacePre Preserve Preserve No wrap Preserve No wrap
WhiteSpacePreWrap Preserve Preserve Wrap Hang Hang
WhiteSpacePreLine Preserve Collapse Wrap Remove Hang
WhiteSpaceBreakSpaces Preserve Preserve Wrap Wrap Wrap
"tab-size" property

The "tab-size" int property (TabSize constant) specifies the size of the tab character (U+0009) in spaces. The value of the "tab-size" property must be greater than 0. The default value is 8

"text-wrap" property

The "text-wrap" int property (TextWrap constant) controls how text inside a View is wrapped. Valid values ​​are:

0 (TextWrapOn constant, "wrap" name) - text is wrapped across lines at appropriate characters (for example spaces, in languages like English that use space separators) to minimize overflow. This is the default value.

1 (TextWrapOff constant, "nowrap" name) - text does not wrap across lines. It will overflow its containing element rather than breaking onto a new line.

2 (TextWrapBalance constant, "balance" name) - text is wrapped in a way that best balances the number of characters on each line, enhancing layout quality and legibility. Because counting characters and balancing them across multiple lines is computationally expensive, this value is only supported for blocks of text spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).

You can get the value of this property using the function

func GetTextWrap(view View, subviewID ...string) int
"word-break" property

The "word-break" int property (WordBreak constant) determines where the newline will be set if the text exceeds the block boundaries. The "white-space" property can take the following values:

0 (WordBreak constant, "normal" name) - default behavior for linefeed placement.

1 (WordBreakAll constant, "break-all" name) - if the block boundaries are exceeded, a line break will be inserted between any two characters (except for Chinese/Japanese/Korean text).

2 (WordBreakKeepAll constant, "keep-all" name) - Line break will not be used in Chinese/Japanese/ Korean text. For text in other languages, the default behavior (normal) will be applied.

3 (WordBreakWord constant, "break-word" name) - when the block boundaries are exceeded, the remaining whole words can be broken in an arbitrary place, if a more suitable place for line break is not found.

"strikethrough", "overline", "underline" properties

These bool properties set decorative lines on the text:

Property Constant Decorative line type
"strikethrough" Strikethrough Strikethrough line text
"overline" Overline Line above the text
"underline" Underline Line under the text

You can get the value of these properties using the functions

func IsStrikethrough(view View, subviewID ...string) bool
func IsOverline(view View, subviewID ...string) bool
func IsUnderline(view View, subviewID ...string) bool
"text-line-thickness" property

The "text-line-thickness" SizeUnit property (TextLineThickness constant) sets the thickness of decorative lines on the text set using the "strikethrough", "overline" and "underline" properties.

You can get the value of this property using the function

GetTextLineThickness(view View, subviewID ...string) SizeUnit
"text-line-style" property

The "text-line-style" int property (constant TextLineStyle) sets the style of decorative lines on the text set using the "strikethrough", "overline" and "underline" properties.

Possible values are:

Value Constant Name Description
1 SolidLine "solid" Solid line (default value)
2 DashedLine "dashed" Dashed line
3 DottedLine "dotted" Dotted line
4 DoubleLine "double" Double solid line
5 WavyLine "wavy" Wavy line

You can get the value of this property using the function

func GetTextLineStyle(view View, subviewID ...string) int
"text-line-color" property

The "text-line-color" Color property (constant TextLineColor) sets the color of decorative lines on the text set using the "strikethrough", "overline" and "underline" properties. If the property is not defined, then the text color specified by the "text-color" property is used for lines.

You can get the value of this property using the function

func GetTextLineColor(view View, subviewID ...string) Color
"text-weight" property

The "text-weight" int property (TextWeight constant) sets the font style. Valid values:

Value Constant Common name of the face
1 ThinFont Thin (Hairline)
2 ExtraLightFont Extra Light (Ultra Light)
3 LightFont Light
4 NormalFont Normal. Default value
5 MediumFont Medium
6 SemiBoldFont Semi Bold (Demi Bold)
7 BoldFont Bold
8 ExtraBoldFont Extra Bold (Ultra Bold)
9 BlackFont Black (Heavy)

Some fonts are only available in normal or bold style. In this case, the value of this property is ignored.

You can get the value of this property using the function

func GetTextWeight(view View, subviewID ...string) int
"text-shadow" property

The "text-shadow" property allows you to set shadows for the text. There may be several shadows. The shadow is described using the ShadowProperty interface (see above, section "The 'shadow' property"). For text shadow, only the "color", "x-offset", "y-offset" and "blur" properties are used. The "inset" and "spread-radius" properties are ignored (i.e. setting them is not an error, they just have no effect on the text shadow).

To create a ShadowProperty for the text shadow, the following functions are used:

func NewTextShadow(offsetX, offsetY, blurRadius SizeUnit, color Color) ShadowProperty
func NewShadowWithParams(params Params) ShadowProperty

The NewShadowWithParams function is used when constants must be used as parameters. For example:

shadow := NewShadowWithParams(rui.Params{
	rui.ColorTag  : "@shadowColor",
	rui.BlurRadius: 8.0,
})

ShadowProperty, ShadowProperty array, ShadowProperty textual representation can be assigned as a value to the "text-shadow" property (see above, section "The 'shadow' property").

You can get the value of this property using the function

func GetTextShadows(view View, subviewID ...string) []ShadowProperty

If no shadow is specified, then this function will return an empty array

"text-align" property

The "text-align" int property (constant TextAlign) sets the alignment of the text. Valid values:

Value Constant Name Value
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 JustifyAlign "justify" Justify alignment

You can get the value of this property using the function

func GetTextAlign(view View, subviewID ...string) int
"text-indent" property

The "text-indent" (TextIndent constant) SizeUnit property determines the size of the indent (empty space) before the first line of text.

You can get the value of this property using the function

func GetTextIndent(view View, subviewID ...string) SizeUnit
"letter-spacing" property

The "Letter-spacing" (LetterSpacing constant) SizeUnit property determines the letter spacing in the text. The value can be negative, but there can be implementation-specific restrictions. The user agent can choose not to increase or decrease the letter spacing to align the text.

You can get the value of this property using the function

func GetLetterSpacing(view View, subviewID ...string) SizeUnit
"word-spacing" property

The "word-spacing" (WordSpacing constant) SizeUnit property determines the length of the space between words. If the value is specified as a percentage, then it defines the extra spacing as a percentage of the preliminary character width. Otherwise, it specifies additional spacing in addition to the inner word spacing as defined by the font.

You can get the value of this property using the function

func GetWordSpacing(view View, subviewID ...string) SizeUnit
"line-height" property

The "line-height" (LineHeight constant) SizeUnit property sets the amount of space between lines.

You can get the value of this property using the function

func GetLineHeight(view View, subviewID ...string) SizeUnit
"text-transform" property

The "text-transform" (TextTransform constant) int property defines the case of characters. Valid values:

Value Constant Case conversion
0 NoneTextTransform Original case of characters
1 CapitalizeTextTransform Every word starts with a capital letter
2 LowerCaseTextTransform All characters are lowercase
3 UpperCaseTextTransform All characters are uppercase

You can get the value of this property using the function

func GetTextTransform(view View, subviewID ...string) int
"text-direction" property

The "text-direction" (TextDirection constant) int property determines the direction of text output. Valid values:

Value Constant Text output direction
0 SystemTextDirection Systemic direction. Determined by the language of the operating system.
1 LeftToRightDirection From left to right. Used for English and most other languages.
2 RightToLeftDirection From right to left. Used for Hebrew, Arabic and some others.

You can get the value of this property using the function

func GetTextDirection(view View, subviewID ...string) int
"writing-mode" property

The "writing-mode" (WritingMode constant) int property defines how the lines of text are arranged vertically or horizontally, as well as the direction in which the lines are displayed. Possible values are:

Value Constant Description
0 HorizontalTopToBottom Horizontal lines are displayed from top to bottom. Default value
1 HorizontalBottomToTop Horizontal lines are displayed from bottom to top.
2 VerticalRightToLeft Vertical lines are output from right to left.
3 VerticalLeftToRight Vertical lines are output from left to right.

You can get the value of this property using the function

func GetWritingMode(view View, subviewID ...string) int
"vertical-text-orientation" property

The "vertical-text-orientation" (VerticalTextOrientation constant) int property is used only if "writing-mode" is set to VerticalRightToLeft (2) or VerticalLeftToRight (3) and determines the position of the vertical line characters. Possible values are:

Value Constant Value
0 MixedTextOrientation Symbols rotated 90 clockwise. Default value.
1 UprightTextOrientation Symbols are arranged normally (vertically).

You can get the value of this property using the function

func GetVerticalTextOrientation(view View, subviewID ...string) int
"user-select" property

The "user-select" property (UserSelect constant) of type bool determines whether the user can select text. Accordingly, if the property is set to true, then the user can select text. If it's false, then it can't.

The default value depends on the value of the "semantics" property. If "semantics" is set to "p", "h1"..."h6", "blockquote" or "code", then the default value is "true", otherwise the default value is "false". The exception is TableView. Its default value is "true".

Like all text properties, the "user-select" property is inherited, i.e. if you set it for a container, it will also apply to all child elements

You can get the value of this property using the function

func IsUserSelect(view View, subviewID ...string) bool
Transformation properties

These properties are used to transform (skew, scale, etc.) the content of the View.

"perspective" property

The "perspective" SizeUnit property (Perspective constant) defines the distance between the z = 0 plane and the user in order to give the 3D positioned element a perspective effect. Each transformed element with z > 0 will become larger, with z < 0, respectively, less.

Elements of the part that are behind the user, i.e. the z-coordinate of these elements is greater than the value of the perspective property, and are not rendered.

The vanishing point is by default located in the center of the element, but it can be moved using the "perspective-origin-x" and "perspective-origin-y" properties.

You can get the value of this property using the function

func GetPerspective(view View, subviewID ...string) SizeUnit
"perspective-origin-x" and "perspective-origin-y" properties

The "Perspective-origin-x" and "perspective-origin-y" SizeUnit properties (PerspectiveOriginX and PerspectiveOriginY constants) determine the position from which the viewer is looking. It is used by the perspective property as a vanishing point.

By default, the "perspective-origin-x" and "perspective-origin-y" properties are set to 50%. point to the center of the View.

You can get the value of these properties using the function

func GetPerspectiveOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit)
"backface-visibility" property

The "backface-visibility" bool property (BackfaceVisible constant) determines whether the back face of an element is visible when it is facing the user.

The back surface of an element is a mirror image of its front surface. However, invisible in 2D, the back face can be visible when the transformation causes the element to rotate in 3D space. (This property has no effect on 2D transforms that have no perspective.)

You can get the value of this property using the function

func GetBackfaceVisible(view View, subviewID ...string) bool
"origin-x", "origin-y", and "origin-z" properties

The "origin-x", "origin-y", and "origin-z" SizeUnit properties (OriginX, OriginY, and OriginZ constants) set the origin for element transformations.

The origin of the transformation is the point around which the transformation takes place. For example, rotation.

The "origin-z" property is ignored if the perspective property is not set.

You can get the value of these properties using the function

func GetOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)
"translate-x", "translate-y", and "translate-z" properties

The "translate-x", "translate-y" and "translate-z" SizeUnit properties (TranslateX, TranslateY, and TranslateZ constants) set the offset of the content of the View.

The translate-z property is ignored if the perspective property is not set.

You can get the value of these properties using the function

func GetTranslate(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)
"scale-x", "scale-y" and "scale-z" properties

The "scale-x", "scale-y" and "scale-z" float64 properties (ScaleX, ScaleY and ScaleZ constants) set the scaling factor along the x, y and z axes, respectively. The original scale is 1. A value between 0 and 1 is used to zoom out. More than 1 - to increase. Values less than or equal to 0 are invalid (the Set function will return false)

The "scale-z" property is ignored if the "perspective" property is not set.

You can get the value of these properties using the function

func GetScale(view View, subviewID ...string) (float64, float64, float64)
"rotate" property

The "rotate" AngleUnit property (Rotate constant) sets the angle of rotation of the content around the vector specified by the "rotate-x", "rotate-y" and "rotate-z" properties.

"rotate-x", "rotate-y", and "rotate-z" properties

The "rotate-x", "rotate-y" and "rotate-z" float64 properties (constant RotateX, RotateY and RotateZ) set the vector around which the rotation is performed by the angle specified by the "rotate" property. This vector passes through the point specified by the "origin-x", "origin-y" and "origin-z" properties.

The "rotate-z" property is ignored if the "perspective" property is not set.

You can get the value of these properties, as well as the "rotate" property, using the function

func GetRotate(view View, subviewID ...string) (float64, float64, float64, AngleUnit)
"skew-x" and "skew-y" properties

The "skew-x" and "skew-y" AngleUnit properties (SkewX and SkewY constants) set the skew (skew) of the content, thus turning it from a rectangle into a parallelogram. The bevel is carried out around the point specified by the transform-origin-x and transform-origin-y properties.

You can get the value of these properties using the function

func GetSkew(view View, subviewID ...string) (AngleUnit, AngleUnit)
User data

You can save any of your data as "user-data" property (UserData constant)

Keyboard events

Two kinds of keyboard events can be generated for a View that has received input focus.

Event Constant Description
"key-down-event" KeyDownEvent The key has been pressed.
"key-up-event" KeyUpEvent The key has been released.

The main event data listener has the following format:

func(View, KeyEvent)

where the second argument describes the parameters of the keys pressed. The KeyEvent structure has the following fields:

Field Type Description
TimeStamp uint64 The time the event was created (in milliseconds). The starting point depends on the browser implementation (EPOCH, browser launch, etc.).
Key string The value of the key on which the event occurred. The value is returned taking into account the current language and case.
Code string The key code of the represented event. The value is independent of the current language and case.
Repeat bool Repeated pressing: the key was pressed until its input began to be automatically repeated.
CtrlKey bool The Ctrl key was active when the event occurred.
ShiftKey bool The Shift key was active when the event occurred.
AltKey bool The Alt (Option or ⌥ in OS X) key was active when the event occurred.
MetaKey bool The Meta key (for Mac, this is the ⌘ Command key; for Windows, the Windows key ⊞) was active when the event occurred.

You can also use listeners in the following formats:

  • func(KeyEvent)
  • func(View)
  • func()

You can get lists of listeners for keyboard events using the functions:

func GetKeyDownListeners(view View, subviewID ...string) []func(View, KeyEvent)
func GetKeyUpListeners(view View, subviewID ...string) []func(View, KeyEvent)
Focus events

Focus events are fired when a View gains or loses input focus. Accordingly, two events are possible:

Event Constant Description
"focus-event" FocusEvent View receives input focus (becomes active)
"lost-focus-event" LostFocusEvent View loses input focus (becomes inactive)

The main event data listener has the following format:

func(View).

You can also use a listener in the following format:

func()

You can get lists of listeners for focus events using the functions:

func GetFocusListeners(view View, subviewID ...string) []func(View)
func GetLostFocusListeners(view View, subviewID ...string) []func(View)
Mouse events

Several kinds of mouse events can be generated for the View

Event Constant Description
"mouse-down" MouseDown The mouse button was pressed.
"mouse-up" MouseUp The mouse button has been released.
"mouse-move" MouseMove Mouse cursor moved
"mouse-out" MouseOut The mouse cursor has moved outside the View, or entered the child View
"mouse-over" MouseOver The mouse cursor has moved within the area of View
"click-event" ClickEvent There was a mouse click
"double-click-event" DoubleClickEvent There was a double mouse click
"context-menu-event" ContextMenuEvent The key for calling the context menu (right mouse button) is pressed

The main event data listener has the following format:

func(View, MouseEvent)

where the second argument describes the parameters of the mouse event. The MouseEvent structure has the following fields:

Field Type Description
TimeStamp uint64 The time the event was created (in milliseconds). The starting point depends on the browser implementation (EPOCH, browser launch, etc.).
Button int The number of the mouse button clicked on which triggered the event
Buttons int Bitmask showing which mouse buttons were pressed when the event occurred
X float64 The horizontal position of the mouse relative to the origin View
Y float64 The vertical position of the mouse relative to the origin View
ClientX float64 Horizontal position of the mouse relative to the upper left corner of the application
ClientY float64 The vertical position of the mouse relative to the upper left corner of the application
ScreenX float64 Horizontal position of the mouse relative to the upper left corner of the screen
ScreenY float64 Vertical position of the mouse relative to the upper left corner of the screen
CtrlKey bool The Ctrl key was active when the event occurred.
ShiftKey bool The Shift key was active when the event occurred.
AltKey bool The Alt (Option or ⌥ in OS X) key was active when the event occurred.
MetaKey bool The Meta key (for Mac this is the ⌘ Command key, for Windows is the Windows key ⊞) was active when the event occurred.

Button field can take the following values

Value Constant Description
<0 No buttons pressed
0 PrimaryMouseButton Main button. Usually the left mouse button (can be changed in the OS settings)
1 AuxiliaryMouseButton Auxiliary button (wheel or middle mouse button)
2 SecondaryMouseButton Secondary button. Usually the right mouse button (can be changed in the OS settings)
3 MouseButton4 Fourth mouse button. Usually the browser's Back button
4 MouseButton5 Fifth mouse button. Usually the browser button Forward

The Button field is a bit mask combining (using OR) the following values

Value Constant Description
1 PrimaryMouseMask Main button
2 SecondaryMouseMask Secondary button
4 AuxiliaryMouseMask Auxiliary button
8 MouseMask4 Fourth button
16 MouseMask5 Fifth button

You can also use listeners in the following formats:

  • func(MouseEvent)
  • func(View)
  • func()

You can get lists of listeners for mouse events using the functions:

func GetMouseDownListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetMouseUpListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetMouseMoveListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetMouseOverListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetMouseOutListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetClickListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetDoubleClickListeners(view View, subviewID ...string) []func(View, MouseEvent)
func GetContextMenuListeners(view View, subviewID ...string) []func(View, MouseEvent)
Pointer Events

A pointer is a device-independent representation of input devices (such as a mouse, pen, or point of contact on a touch surface). A pointer can point to a specific coordinate (or set of coordinates) on a contact surface such as a screen.

All pointers can generate several kinds of events

Event Constant Description
"pointer-down" PointerDown The pointer was pressed.
"pointer-up" PointerUp The pointer was released.
"pointer-move" PointerMove The pointer has been moved
"pointer-cancel" PointerCancel Pointer events aborted.
"pointer-out" PointerOut The pointer went out of bounds of the View, or went into the child View
"pointer-over" PointerOver The pointer is within the limits of View

The main event data listener has the following format:

func(View, PointerEvent)

where the second argument describes the parameters of the pointer. PointerEvent structure extends MouseEvent structure and has the following additional fields:

Field Type Description
PointerID int The unique identifier of the pointer that raised the event.
Width float64 The width (X-axis value) in pixels of the pointer's contact geometry.
Height float64 The height (Y-axis value) in pixels of the pointer's contact geometry.
Pressure float64 Normalized gauge inlet pressure ranging from 0 to 1, where 0 and 1 represent the minimum and maximum pressure that the hardware is capable of detecting, respectively.
TangentialPressure float64 Normalized gauge inlet tangential pressure (also known as cylinder pressure or cylinder voltage) ranges from -1 to 1, where 0 is the neutral position of the control.
TiltX float64 The planar angle (in degrees, ranging from -90 to 90) between the Y – Z plane and the plane that contains both the pointer (such as a stylus) axis and the Y axis.
TiltY float64 The planar angle (in degrees, ranging from -90 to 90) between the X – Z plane and the plane containing both the pointer (such as a stylus) axis and the X axis.
Twist float64 Rotation of a pointer (for example, a stylus) clockwise around its main axis in degrees with a value in the range from 0 to 359.
PointerType string the type of device that triggered the event: "mouse", "pen", "touch", etc.
IsPrimary bool a pointer is the primary pointer of this type.

You can also use listeners in the following formats:

  • func(PointerEvent)
  • func(View)
  • func()

You can get lists of pointer event listeners using the functions:

func GetPointerDownListeners(view View, subviewID ...string) []func(View, PointerEvent)
func GetPointerUpListeners(view View, subviewID ...string) []func(View, PointerEvent)
func GetPointerMoveListeners(view View, subviewID ...string) []func(View, PointerEvent)
func GetPointerCancelListeners(view View, subviewID ...string) []func(View, PointerEvent)
func GetPointerOverListeners(view View, subviewID ...string) []func(View, PointerEvent)
func GetPointerOutListeners(view View, subviewID ...string) []func(View, PointerEvent)
Touch events

These events are used to track multipoint touches. Single touches emulate mouse events. If you do not need to track multi-point touches, then it is easier to use mouse events

Event Constant Description
"touch-start" TouchStart The surface touched.
"touch-end" TouchEnd Surface touch completed.
"touch-move" TouchMove One or more touches changed position
"touch-cancel" TouchCancel The touch is interrupted.

The main event data listener has the following format:

func(View, TouchEvent)

where the second argument describes the touch parameters. The TouchEvent structure has the following fields:

Field Type Description
TimeStamp uint64 The time the event was created (in milliseconds). The starting point depends on the browser implementation (EPOCH, browser launch, etc.).
Touches []Touch Array of Touch structures, each describing one touch
CtrlKey bool The Ctrl key was active when the event occurred.
ShiftKey bool The Shift key was active when the event occurred.
AltKey bool The Alt (Option or ⌥ in OS X) key was active when the event occurred.
MetaKey bool The Meta key (for Mac, this is the ⌘ Command key; for Windows, the Windows key ⊞) was active when the event occurred.

The Touch structure describes a single touch and has the following fields

Field Type Description
Identifier int A unique identifier assigned to each touch and does not change until it is completed.
X float64 The horizontal position of the mouse relative to the origin View
Y float64 The vertical position of the mouse relative to the origin View
ClientX float64 Horizontal position of the mouse relative to the upper left corner of the application
ClientY float64 The vertical position of the mouse relative to the upper left corner of the application
ScreenX float64 Horizontal position of the mouse relative to the upper left corner of the screen
ScreenY float64 Vertical position of the mouse relative to the upper left corner of the screen
RadiusX float64 The x-radius of the ellipse, in pixels, that most closely delimits the area of contact with the screen.
RadiusY float64 The y-radius of the ellipse, in pixels, that most closely delimits the area of contact with the screen.
RotationAngle float64 The angle (in degrees) to rotate the ellipse clockwise, described by the radiusX and radiusY parameters, to best cover the contact area between the user and the surface.
Force float64 The amount of pressure from 0.0 (no pressure) to 1.0 (maximum pressure) that the user applies to the surface.

You can also use listeners in the following formats:

  • func(TouchEvent)
  • func(View)
  • func()

You can get lists of listeners for touch events using the functions:

func GetTouchStartListeners(view View, subviewID ...string) []func(View, TouchEvent)
func GetTouchEndListeners(view View, subviewID ...string) []func(View, TouchEvent)
func GetTouchMoveListeners(view View, subviewID ...string) []func(View, TouchEvent)
func GetTouchCancelListeners(view View, subviewID ...string) []func(View, TouchEvent)
Resize-event

The "resize-event" (ResizeEvent constant) is called when the View changes its position and/or size. The main event data listener has the following format:

func(View, Frame)

where the structure is declared as

type Frame struct {
	Left, Top, Width, Height float64
}

Frame elements contain the following data

  • Left - the new horizontal offset in pixels relative to the parent View (left position);
  • Top - the new vertical offset in pixels relative to the parent View (top position)
  • Width - the new width of the visible part of the View in pixels;
  • Height - the new height of the visible part of the View in pixels.

You can also use listeners in the following formats:

  • func(Frame)
  • func(View)
  • func()

You can get a list of listeners for this event using the function:

func GetResizeListeners(view View, subviewID ...string) []func(View, Frame)

The current position and dimensions of the visible part of the View can be obtained using the View interface function:

Frame() Frame

or global function

func GetViewFrame(view View, subviewID ...string) Frame
Scroll event

The "scroll-event" (ScrollEvent constant) is raised when the contents of the View are scrolled. The main event data listener has the following format:

func(View, Frame)

where the Frame elements contain the following data

  • Left - the new horizontal shift of the visible area (in pixels);
  • Top - the new vertical offset of the visible area (in pixels);
  • Width - the total width of the View in pixels;
  • Height - the total height of the View in pixels.

You can also use listeners in the following formats:

  • func(Frame)
  • func(View)
  • func()

You can get a list of listeners for this event using the function:

func GetScrollListeners(view View) []func(View, Frame)

The current position of the viewable area and the overall dimensions of the View can be obtained using the View interface function:

Scroll() Frame

or global function

func GetViewScroll(view View, subviewID ...string) Frame

The following global functions can be used for manual scrolling

func ScrollViewTo(view View, subviewID string, x, y float64)
func ScrollViewToStart(view View, subviewID ...string)
func ScrollViewToEnd(view View, subviewID ...string)

which scroll the view, respectively, to the given position, start and end

ViewsContainer

The ViewsContainer interface, which implements View, describes a container that contains several child interface elements (View). ViewsContainer is the base for other containers (ListLayout, GridLayout, StackLayout, etc.) and is not used on its own.

In addition to all View properties, this element has only one additional property "content"

"content" property

The "content" property (constant Content) defines an array of child Views. Interface Get function always returns []View for the given property.

The following 5 data types can be passed as the value of the "content" property:

  • View - converted to []View containing one element;

  • []View - nil-elements are prohibited, if the array contains nil, then the property will not be set, and the Set function will return false and an error message will be written to the log;

  • string - if the string is a text representation of the View, then the corresponding View is created, otherwise a TextView is created, to which the given string is passed as text. Next, a []View is created containing the resulting View;

  • []string - each element of the array is converted to View as described in the previous paragraph;

  • []any - this array must contain only View and string. Each string element is converted to a View as described above. If the array contains invalid values, the "content" property will not be set, and the Set function will return false and an error message will be written to the log.

You can learn the value of the "content" property using the ViewsContainer interface function

Views() []View

The following functions of the ViewsContainer interface can be used to edit the "content" property:

Append(view View)

This function adds an argument to the end of the View list.

Insert(view View, index uint)

This function inserts an argument at the specified position in the View list. If index is greater than the length of the list, then the View is added to the end of the list. If index is less than 0, then to the beginning of the list.

RemoveView(index uint) View

This function removes the View from the given position and returns it. If index points outside the bounds of the list, then nothing is removed, and the function returns nil.

ViewIndex(view View) int

This function returns the index of the child View, or -1 if there is no such View in the container. It is often used in conjunction with RemoveView if the index of the child View is unknown:

if index := container.ViewIndex(view); index >= 0 {
	container.RemoveView(index)
}

ListLayout

ListLayout is a container that implements the ViewsContainer interface. To create it, use the function

func NewListLayout(session Session, params Params) ListLayout

Items in this container are arranged as a list. The position of the children can be controlled. For this, ListLayout has a number of properties

"content" property

The "content" property (Content constant) defines an array of child Views. This property is inherited from ViewsContainer. Just like for ViewsContainer, this property can be assigned the following data types:

  • View (converts to []View containing one View);
  • []View;
  • string (converts to []View containing one TextView);
  • []string (converts to []View containing TextView);
  • []any - this array must contain only View and string.

However, in addition to these data types, the "content" property of a ListLayout can be assigned an implementation of the ListAdapter interface.

ListAdapter is used to create child Views and is declared as

type ListAdapter interface {
	ListSize() int
	ListItem(index int, session Session) View
}

Accordingly, the functions of this interface must return the number of elements and View of the i-th element.

ListAdapter creates child Views when the "content" property is set. To recreate child elements, ListLayout has the UpdateContent() property. This method deletes all child Views and creates them again using the ListAdapter.

Attention! When calling the UpdateContent() method, data from old Views is not transferred to newly created ones. You must do this manually.

If the "content" property is not assigned to the ListAdapter, then the UpdateContent() method does nothing.

You can also call the UpdateContent method using the global function

func UpdateContent(view View, subviewID ...string)
"orientation" property

The "orientation" int property (Orientation constant) specifies how the children will be positioned relative to each other. The property can take the following values:

Value Constant Location
0 TopDownOrientation Child elements are arranged in a column from top to bottom.
1 StartToEndOrientation Child elements are laid out in a row from beginning to end.
2 BottomUpOrientation Child elements are arranged in a column from bottom to top.
3 EndToStartOrientation Child elements are laid out in a line from end to beginning.

The start and end positions for StartToEndOrientation and EndToStartOrientation depend on the value of the "text-direction" property. For languages written from right to left (Arabic, Hebrew), the beginning is on the right, for other languages - on the left.

"list-wrap" property

The "list-wrap" int property (ListWrap constant) defines the position of elements in case of reaching the border of the container. There are three options:

  • ListWrapOff (0) - the column / row of elements continues and goes beyond the bounds of the visible area.

  • ListWrapOn (1) - starts a new column / row of items. The new column is positioned towards the end (for the position of the beginning and end, see above), the new line is at the bottom.

  • ListWrapReverse (2) - starts a new column / row of elements. The new column is positioned towards the beginning (for the position of the beginning and end, see above), the new line is at the top.

"vertical-align" property

The "vertical-align" property (VerticalAlign constant) of type int sets the vertical alignment of items in the container. Valid values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Height alignment
"horizontal-align" property

The "horizontal-align" int property (HorizontalAlign constant) sets the horizontal alignment of items in the list. Valid values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Width alignment
"list-row-gap" and "list-column-gap" properties

The "list-row-gap" and "list-column-gap" SizeUnit properties (ListRowGap and ListColumnGap constants) allow you to set the distance between the rows and columns of the container, respectively. The default is 0px.

"order"

The "order" property (Order constant) of type int is used by Views placed in a ListLayout or GridLayout container (see below), to change its position in the container. The "order" property defines the order used to place the View in the container. The elements are arranged in ascending order by their order value. Elements with the same order value are placed in the order in which they were added to the container.

The default value is 0. Therefore, negative values of the "order" property must be used to place the View at the beginning.

Note: The "order" property only affects the visual order of the elements, not the logical order or tabs.

GridLayout

GridLayout is a container that implements the ViewsContainer interface. To create it, use the function

func NewGridLayout(session Session, params Params) GridLayout

The container space of this container is split into cells in the form of a table. All children are located in the cells of the table. A cell is addressed by row and column number. Row and column numbers start at 0.

"content"

The "content" property (Content constant) defines an array of child Views. This property is inherited from ViewsContainer. Just like for ViewsContainer, this property can be assigned the following data types:

  • View (converts to []View containing one View);
  • []View;
  • string (converts to []View containing one TextView);
  • []string (converts to []View containing TextView);
  • []any - this array must contain only View and string.

However, in addition to these data types, the "content" property of a GridLayout can be assigned an implementation of the GridAdapter interface.

GridAdapter is used to create child Views and is declared as

type GridAdapter interface {
	GridColumnCount() int
	GridRowCount() int
	GridCellContent(row, column int, session Session) View
}

Accordingly, the functions of this interface must return the number of columns and rows and the View of the element at position (row, column).

In addition to these three required methods, when implementing a GridAdapter, two more optional ones can be specified:

GridCellColumnSpan(row, column int) int
GridCellRowSpan(row, column int) int

The first method sets how many columns the View occupies in (row, column) position and the second sets how many rows.

GridAdapter creates child Views when the "content" property is set. To recreate child elements, GridLayout has the UpdateGridContent() method. This method deletes all child Views and creates them again using the GridAdapter.

Attention! When calling the UpdateGridContent() method, data from old Views is not transferred to newly created ones. You must do this manually.

If the "content" property is not set to a GridAdapter then the UpdateGridContent() method does nothing.

You can also call the UpdateGridContent method using the global function

func UpdateContent(view View, subviewID ...string)
"column" and "row" properties

The location of the View inside the GridLayout is determined using the "column" and "row" properties. These properties must be set for each of the child Views. Child View can span multiple cells within the GridLayout and they can overlap.

The values "column" and "row" can be set by:

  • an integer greater than or equal to 0;

  • textual representation of an integer greater than or equal to 0 or a constant;

  • a Range structure specifying a range of rows / columns:

    type Range struct { First, Last int }

where First is the number of the first column / row, Last is the number of the last column / row;

  • a line of the form "< number of the first column / row >: < number of the last column / row >", which is a textual representation of the Range structure

Example

grid := rui.NewGridLayout(session, rui.Params {
	rui.Content : []View{
		NewView(session, rui.Params {
			rui.ID     : "view1",
			rui.Row    : 0,
			rui.Column : rui.Range{ First: 1, Last: 2 },
		}),
		NewView(session, rui.Params {
			rui.ID     : "view2",
			rui.Row    : "0:2",
			rui.Column : "0",
		}),
	},
})

In this example, view1 occupies columns 1 and 2 in row 0, and view1 occupies rows 0, 1, and 2 in column 0.

"grid-auto-flow"

If the "row" and "column" properties are not set for child Views, then the automatic View placement algorithm is used. There are four variants of this algorithm. The variant to use is specified using the "grid-auto-flow" int property. The "grid-auto-flow" property can take the following values:

  • RowAutoFlow (0) (text name "row") - Views are placed by filling each row in turn, adding new columns as necessary;

  • ColumnAutoFlow (1) (text name "column") - Views are placed by filling each column in turn, adding new columns as necessary;

  • RowDenseAutoFlow (2) (text name "row-dense") - Views are placed by filling each row, adding new rows as necessary. "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.

  • ColumnDenseAutoFlow (3) (text name "column-dense") - Views are placed by filling each column, adding new columns as necessary. "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.

"cell-width" and "cell-height" properties

By default, the sizes of the cells are calculated based on the sizes of the child Views placed in them. The "cell-width" and "cell-height" properties (CellWidth and CellHeight constants) allow you to set a fixed width and height of cells regardless of the size of the child elements. These properties are of type []SizeUnit. Each element in the array determines the size of the corresponding column or row.

These properties can be assigned the following data types:

  • SizeUnit or textual representation of SizeUnit (or SizeUnit constant). In this case, the corresponding dimensions of all cells are set to the same;

  • [] SizeUnit;

  • string containing textual representations of SizeUnit (or SizeUnit constants) separated by commas;

  • [] string. Each element must be a textual representation of a SizeUnit (or a SizeUnit constant)

  • [] interface {}. Each element must either be of type SizeUnit or be a textual representation of SizeUnit (or a SizeUnit constant)

If the number of elements in the "cell-width" and "cell-height" properties is less than the number of columns and rows used, then the missing elements are set to Auto.

The values of the "cell-width" and "cell-height" properties can use the SizeUnit type SizeInFraction. This type means 1 part. The part is calculated as follows: the size of all cells that are not of type SizeInFraction is subtracted from the size of the container, and then the remaining size is divided by the number of parts. The SizeUnit value of type SizeInFraction can be either integer or fractional.

"grid-row-gap" and "grid-column-gap" properties

The "grid-row-gap" and "grid-column-gap" SizeUnit properties (GridRowGap and GridColumnGap constants) allow you to set the distance between the rows and columns of the container, respectively. The default is 0px.

"cell-vertical-align" and "cell-vertical-self-align" properties

The "cell-vertical-align" int property (constant CellVerticalAlign) sets the default vertical alignment of children within the cell they are occupying. Valid values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Full height stretch

The default value is StretchAlign (3)

The "cell-vertical-self-align" int property (constant CellVerticalAlign) sets the vertical alignment of children within the cell they are occupying. This property should be set not for the grid, but for the children.

"cell-horizontal-align" and "cell-horizontal-self-align" properties

The "cell-horizontal-align" int property (constant CellHorizontalSelfAlign) sets the horizontal alignment of children within the occupied cell. Valid values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Full width stretch

The default value is StretchAlign (3)

The "cell-horizontal-self-align" int property (constant CellVerticalSelfAlign) sets the horizontal alignment of children within the cell they are occupying. This property should be set not for the grid, but for the children.

ColumnLayout

ColumnLayout is a container that implements the ViewsContainer interface. All child Views are arranged in a vertical list aligned to the left or right and split into several columns. The alignment depends on the "text-direction" property.

To create the ColumnLayout, use the function

func NewColumnLayout(session Session, params Params) ColumnLayout
"column-count" property

The "column-count" int property (ColumnCount constant) sets the number of columns.

If this property is 0 and the "column-width" property is not set, then no column splitting is performed and the container is scrolled down.

If the value of this property is greater than 0, then the list is split into columns. The column height is equal to the ColumnLayout height, and the width is calculated as the ColumnLayout width divided by "column-count". Each next column is located depending on the "text-direction" property to the right or left of the previous one, and the container is scrolled horizontally.

You can get the value of this property using the function

func GetColumnCount(view View, subviewID ...string) int
"column-width" property

The "column-width" SizeUnit property (ColumnWidth constant) sets the column width. This property is used only if "column-count" is 0, otherwise it is ignored.

IMPORTANT! Percentages cannot be used as the "column-width" value (i.e. if you specify a value in percent, the system will ignore it)

You can get the value of this property using the function

func GetColumnWidth(view View, subviewID ...string) SizeUnit
"column-gap" property

The "column-gap" SizeUnit property (ColumnGap constant) sets the width of the gap between columns.

You can get the value of this property using the function

func GetColumnGap(view View, subviewID ...string) SizeUnit
"column-separator" property

The "column-separator" property (ColumnSeparator constant) allows you to set a line that will be drawn at column breaks. The separator line is described by three attributes: line style, thickness, and color.

The value of the "column-separator" property is stored as the ColumnSeparatorProperty interface, which implements the Properties interface (see above). ColumnSeparatorProperty can contain the following properties:

Property Constant Type Description
"style" Style int Line style
"width" Width SizeUnit Line thickness
"color" ColorTag Color Line color

Line style can take the following values:

Value Constant Name Description
0 NoneLine "none" No frame
1 SolidLine "solid" Solid line
2 DashedLine "dashed" Dashed line
3 DottedLine "dotted" Dotted line
4 DoubleLine "double" Double solid line

All other style values are ignored.

To create the ColumnSeparatorProperty interface, use the function

func NewColumnSeparator(params Params) ColumnSeparatorProperty

The ColumnSeparatorProperty interface can be converted to a ViewBorder structure using the ViewBorder function. When converted, all text constants are replaced with real values. ViewBorder is described as

type ViewBorder struct {
	Style int
	Color Color
	Width SizeUnit
}

The ViewBorder structure can be passed as a parameter to the Set function when setting the value of the "column-separator" property. This converts the ViewBorder to ColumnSeparatorProperty. Therefore, when reading the property, the Get function will return the ColumnSeparatorProperty interface, not the ViewBorder structure.

You can get the ViewBorders structure without additional transformations using the global function

func GetColumnSeparator(view View, subviewID ...string) ViewBorder

You can also set individual line attributes using the Set function of the View interface. For this, the following properties are used

Property Constant Type Description
"column-separator-style" ColumnSeparatorStyle int Line style
"column-separator-width" ColumnSeparatorWidth SizeUnit Line thickness
"column-separator-color" ColumnSeparatorColor Color Line color

For example

view.Set(rui.ColumnSeparatorStyle, rui.SolidBorder)
view.Set(rui.ColumnSeparatorWidth, rui.Px(1))
view.Set(rui.ColumnSeparatorColor, rui.Black)

equivalent to

view.Set(rui.ColumnSeparator, ColumnSeparatorProperty(rui.Params{
	rui.Style   : rui.SolidBorder,
	rui.Width   : rui.Px(1),
	rui.ColorTag: rui.Black,
}))
"column-fill" property

The "column-fill" int property (ColumnFill constant) controls how an ColumnLayout's contents are balanced when broken into columns. Valid values:

Value Constant Name Description
0 ColumnFillBalance "balance" Content is equally divided between columns (default value)
1 ColumnFillAuto "auto" Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty

You can get the value of this property using the function

func GetColumnFill(view View, subviewID ...string) int
"avoid-break" property

When forming columns, ColumnLayout can break some types of View, so that the beginning will be at the end of one column and the end in the next. For example, the TextView, the title of the picture and the picture itself are broken, etc.

The "avoid-break" bool property (AvoidBreak constant) avoids this effect. You must set this property to "true" for a non-breakable View. Accordingly, the value "false" of this property allows the View to be broken. The default is "false".

You can get the value of this property using the function

func GetAvoidBreak(view View, subviewID ...string) bool
"column-span-all" property

The "column-span-all" bool property (ColumnSpanAll constant) is set for Views placed in the ColumnLayout. If this property is set to true, then the View expands to the full width of the ColumnLayout, covering all columns. Such a View will, as it were, break the container.

Typically, this property is used for headers.

The default value is "false".

You can get the value of this property using the function

func IsColumnSpanAll(view View, subviewID ...string) bool

StackLayout

StackLayout is a container that implements the ViewsContainer interface. All child Views are stacked on top of each other and each takes up the entire container space. Only one child View (current) is available at a time.

To create a StackLayout, use the function

func NewStackLayout(session Session, params Params) StackLayout

In addition to the Append, Insert, RemoveView properties and the "content" property of the ViewsContainer, the StackLayout container has two other interface functions for manipulating child Views: Push and Pop.

Push(view View, animation int, onPushFinished func())

This function adds a new View to the container and makes it current. It is similar to Append, but the addition is done using an animation effect. The animation type is specified by the second argument and can take the following values:

Value Constant Animation
0 DefaultAnimation Default animation. For the Push function it is EndToStartAnimation, for Pop - StartToEndAnimation
1 StartToEndAnimation Animation from beginning to end. The beginning and the end are determined by the direction of the text output
2 EndToStartAnimation End-to-Beginning animation.
3 TopDownAnimation Top-down animation.
4 BottomUpAnimation Bottom up animation.

The third argument onPushFinished is the function to be called when the animation ends. It may be nil.

Pop(animation int, onPopFinished func(View)) bool

This function removes the current View from the container using animation. The second argument onPopFinished is the function to be called when the animation ends. It may be nil. The function will return false if the StackLayout is empty and true if the current item has been removed.

You can get the current (visible) View using the interface function

Peek() View

You can also get the current View using its index. The "current" property (constant Current) is used to get the index. Example

func peek(layout rui.StackLayout) {
	views := layout.Views()
	if index := rui.GetCurrent(layout); index >= 0 && index < len(views) {
		return views[index]
	} 
	return nil
}

Of course, this is less convenient than the Peek function. However, the "current" property can be used to track changes to the current View:

layout.SetChangeListener(rui.Current, func(view rui.View, tag string) {
	// current view changed
})

In order to make any child View current (visible), the interface functions are used:

MoveToFront(view View) bool
MoveToFrontByID(viewID string) bool

This function will return true if successful and false if the child View or View with id does not exist and an error message will be written to the log.

You can also use the "current" property to make any child View current (visible).

TabsLayout

TabsLayout is a container that implements the ViewsContainer interface. All child Views are stacked on top of each other and each takes up the entire container space. Only one child View (current) is available at a time. Tabs, that are located along one of the sides of the container, are used to select the current View.

To create a TabsLayout, use the function

func NewTabsLayout(session Session, params Params) TabsLayout

A bookmark is created for each View. A bookmark can display a title, an icon, and a close button.

The title is set using the "title" text property (constant Title) of the child View. The "title" property is optional. If it is not specified, then there will be no text on the tab.

The icon is set using the "icon" text property (constant Icon) of the child View. As a value, it is assigned the name of the icon file (if the icon is located in the application resources) or url. The "icon" property is optional. If it is not specified, then there will be no icon on the tab.

The display of the tab close button is controlled by the "tab-close-button" boolean property (constant TabCloseButton). "true" enables the display of the close button for the tab. The default is "false".

The "tab-close-button" properties can be set for both the child View and the TabsLayout itself. Setting the value of the "tab-close-button" property for the TabsLayout enables/disables the display of the close button for all tabs at once. The "tab-close-button" value set on the child View takes precedence over the value set on the TabsLayout.

The tab close button does not close the tab, but only generates the "tab-close-event" event (constant TabCloseEvent). The main handler for this event has the format

func(layout TabsLayout, index int)

where the second element is the index of the child View.

As already mentioned, clicking on the close tab button does not close the tab. You must close the tab yourself. This is done as follows

tabsView.Set(rui.TabCloseEvent, func(layout rui.TabsLayout, index int) {
	layout.RemoveView(index)
})

You can control the current View using the "current" integer property (constant Current). To programmatically switch tabs, set this property to the index of the new current View. You can read the value of the "current" property using the function

func GetCurrent(view View, subviewID ...string) int

Also, the "current" property can be used to track changes to the current View:

tabsView.SetChangeListener(rui.Current, func(view rui.View, tag string) {
	// current view changed
})

Tabs are positioned along one side of the TabsLayout container. The tabs are positioned using the "tabs" integer property (the Tabs constant). This property can take on the following values:

Value Constant Name Placement of tabs
0 TopTabs "top" Top. Default value.
1 BottomTabs "bottom" Bottom.
2 LeftTabs "left" Left. Each tab is rotated 90 ° counterclockwise.
3 RightTabs "right" On right. Each tab is rotated 90 ° clockwise.
4 LeftListTabs "left-list" Left. The tabs are displayed as a list.
5 RightListTabs "right-list" On right. The tabs are displayed as a list.
6 HiddenTabs "hidden" The tabs are hidden.

Why do I need the value HiddenTabs. The point is that TabsLayout implements the ListAdapter interface. Which makes it easy to implement tabs with a ListView. This is where the HiddenTabs value comes in.

For displaying the current (selected) tab of type TopTabs, BottomTabs, LeftListTabs and RightListTabs, the "ruiCurrentTab" style is used, and for tab of type LeftTabs and RightTabs, the "ruiCurrentVerticalTab" style is used. If you want to customize the display of tabs, you can either override these styles, or assign your own style using the "current-tab-style" property (constant CurrentTabStyle).

Accordingly, for an inactive tab, the "ruiTab" and "ruiVerticalTab" styles are used, and you can assign your own style using the "tab-style" property (constant TabStyle).

The "ruiTabBar" style is used to display the tab bar, and you can assign your own style using the "tab-bar-style" property (constant TabBarStyle).

AbsoluteLayout

AbsoluteLayout is a container that implements the ViewsContainer interface. Child Views can be positioned at arbitrary positions in the container space.

To create an AbsoluteLayout, use the function

func NewAbsoluteLayout(session Session, params Params) AbsoluteLayout

The child View is positioned using the properties of the SizeUnit type: "left", "right", "top" and "bottom" (respectively, the constants Left, Right, Top and Bottom). You can set any of these properties on the child View. If neither "left" or "right" is specified, then the child View will be pinned to the left edge of the container. If neither top nor bottom is specified, then the child View will be pinned to the top edge of the container.

DetailsView

DetailsView is a container that implements the ViewsContainer interface. To create a DetailsView, the function is used

func NewDetailsView(session Session, params Params) DetailsView

In addition to child Views, this container has a "summary" property (Summary constant). The value of the "summary" property can be either View or a string of text.

The DetailsView can be in one of two states:

  • only the content of the "summary" property is displayed. Child Views are hidden and do not take up screen space

  • the content of the "summary" property is displayed first, and below the child Views. The layout of the child Views is the same as ColumnLayout with "column-count" equal to 0.

DetailsView switches between states by clicking on "summary" view.

For forced switching of the DetailsView states, the bool property "expanded" (Expanded constant) is used. Accordingly, the value "true" shows child Views, "false" - hides.

By default, a ▶︎/▼ marker is displayed at the beginning of the "summary" element. It can be hidden. For this, the "hide-summary-marker" bool property (DetailsView constant) is used.

The value of the "summary", "expanded" and "hide-summary-marker" properties can be obtained using the functions

func GetDetailsSummary(view View, subviewID ...string) View
func IsDetailsExpanded(view View, subviewID ...string) bool
func IsSummaryMarkerHidden(view View, subviewID ...string) bool

Resizable

Resizable is a container in which only one View can be placed. Resizable allows you to interactively resize the content View. To create a Resizable view, the function is used

func NewResizable(session Session, params Params) Resizable

A frame is created around the content View, and you can drag it to resize.

Resizable does not implement the ViewsContainer interface. Only the Content property is used to control the content View. This property can be assigned a value of type View or a string of text. In the second case, a TextView is created.

The frame around the content View can be either from all sides, or only from separate ones. To set the sides of the frame, use the "side" int property (Side constant). It can take the following values:

Value Constant Name Frame side
1 TopSide "top" Top
2 RightSide "right" Right
4 BottomSide "bottom" Bottom
8 LeftSide "left" Left
15 AllSides "all" All sides. Default value

In addition to these values, an or-combination of TopSide, RightSide, BottomSide and LeftSide can also be used. AllSides is defined as

AllSides = TopSide | RightSide | BottomSide | LeftSide

To set the border width, use the SizeUnit property "resize-border-width" (ResizeBorderWidth constant). The default value of "resize-border-width" is 4px.

TextView

The TextView element, which extends the View interface, is intended for displaying text.

To create a TextView, the function is used:

func NewTextView(session Session, params Params) TextView

The displayed text is set by the string property "text" (Text constant). In addition to the Get method, the value of the "text" property can be obtained using the function

func GetText (view View, subviewID ...string) string

TextView inherits from View all properties of text parameters ("font-name", "text-size", "text-color", etc.). In addition to them, the "text-overflow" int property (TextOverflow constant) is added. It determines how the text is cut if it goes out of bounds. This property of type int can take the following values

Value Constant Name Cropping Text
0 TextOverflowClip "clip" Text is clipped at the border (default)
1 TextOverflowEllipsis "ellipsis" At the end of the visible part of the text '…' is displayed

ImageView

The ImageView element extending the View interface is designed to display images.

To create an ImageView function is used:

func NewImageView(session Session, params Params) ImageView

The displayed image is specified by the string property "src" (Source constant). As a value, this property is assigned either the name of the image in the "images" folder of the resources, or the url of the image, or inline-image.

An inline-image is the content of an image file encoded in base64 format. To get an inline-image from the application resources, use the function

func InlineImageFromResource(filename string) (string, bool)

Inline-images must be used in WebAssembly applications if you want to host images in resources rather than on an external server. Inline-images can cause app freezes in Safari and should be avoided. Example

if runtime.GOOS == "js" {
	if image, ok := rui.InlineImageFromResource("image.png"); ok {
		view.Set(rui.Source, image)
	}
} else {
	view.Set(rui.Source, "image.png")
}

ImageView allows you to display different images depending on screen density (See section "Images for screens with different pixel densities"). In this regard, the ImageView interface has two additional methods that allow you to find out which image is displayed:

CurrentSource() string
NaturalSize() (float64, float64)

CurrentSource returns the url of the rendered image. Until the image is loaded, this method returns an empty string.

NaturalSize() returns the original width and height of the rendered image, in screen pixels. Those if the original image is 100x200 and the screen density is 2, then the NaturalSize method will return (50, 100). Until the image is loaded, this method returns the value (0, 0).

Two events are used to track the loading of an image:

  • "loaded-event" (LoadedEvent constant). This event fires right after the image is loaded.

  • "error-event" (ErrorEvent constant). This event occurs when an error occurs while loading an image.

The main listener for these events has the following format:

func(ImageView)

The "alt-text" property (AltText constant) of the string type allows you to set a description of the image. This text is displayed if the browser was unable to load the image. Also, this text is used in the sound system for the blind.

The "fit" property (Fit constant) of type int defines the image scaling parameters. Valid values:

Value Constant Name Resizing
0 NoneFit "none" The image is not resized
1 ContainFit "contain" The image is scaled to maintain its aspect ratio while fitting within the element’s content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box
2 CoverFit "cover" The image is sized to maintain its aspect ratio while filling the element’s entire content box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit
3 FillFit "fill" The image to fill the element’s content box. The entire object will completely fill the box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit
4 ScaleDownFit "scale-down" The image is sized as if NoneFit or ContainFit were specified, whichever would result in a smaller concrete object size

The "image-vertical-align" int property (ImageVerticalAlign constant) sets the vertical alignment of the image relative to the bounds of the ImageView. Valid values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment

The "image-horizontal-align" int property (ImageHorizontalAlign constant) sets the horizontal alignment of the image relative to the bounds of the ImageView. Valid values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment

The following functions can be used to retrieve ImageView property values:

func GetImageViewSource(view View, subviewID ...string) string
func GetImageViewAltText(view View, subviewID ...string) string
func GetImageViewFit(view View, subviewID ...string) int
func GetImageViewVerticalAlign(view View, subviewID ...string) int
func GetImageViewHorizontalAlign(view View, subviewID ...string) int

SvgImageView

The SvgImageView element extending the View interface is designed to display svg images.

To create an SvgImageView function is used:

func NewSvgImageView(session Session, params Params) ImageView

The image to be displayed is specified by the string property "content" (constant Content). The value of this property can be assigned

  • the image file name in the images folder of the resources;
  • image url;
  • content of the svg image.

Examples

rui.Set(rootView, "iconView", rui.Content, "icon.svg")

rui.Set(rootView, "iconView", rui.Content, `<svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-499.08 -247.12)">
	<path d="m508.08 249.12 14 14-14 14" fill="none" stroke="#0f0" stroke-linecap="round" stroke-width="1px"/>
</g>
</svg>`)

Regardless of how you determined the property of "Content" to the client is always transmitted the contents of the SVG image. For example, if you set the image as follows

rui.Set(rootView, "iconView", rui.Content, "icon.svg")

then the program will first upload the contents of the "icon.svg" file to the memory, and then transmit this contents to the client as the value of the "content" property.

This allows you to include SVG images in the resources of a WebAssembly application.

EditView

The EditView element is a test editor and extends the View interface.

To create an EditView, the function is used:

func NewEditView(session Session, params Params) EditView

Several options for editable text are possible. The type of the edited text is set using the int property "edit-view-type" (EditViewType constant). This property can take the following values:

Value Constant Name Editor type
0 SingleLineText "text" One-line text editor. Default value
1 PasswordText "password" Password editor. The text is hidden by asterisks
2 EmailText "email" Single e-mail editor
3 EmailsText "emails" Multiple e-mail editor
4 URLText "url" Internet address input editor
5 PhoneText "phone" Phone number editor
6 MultiLineText "multiline" Multi-Line Text Editor

To simplify the text of the program, you can use the "type" properties (Type constant) instead of the "edit-view-type". These property names are synonymous. But when describing the style, "type" cannot be used.

To set/get edited text, use the string property "text" (Text constant)

The maximum length of editable text is set using the "max-length" int property (MaxLength constant).

You can limit the input text using a regular expression. To do this, use the string property "edit-view-pattern" (EditViewPattern constant). Instead of "edit-view-pattern", you can use the synonym "pattern" (Pattern constant), except for the style description.

To prohibit text editing, use the bool property "readonly" (ReadOnly constant).

To enable / disable the built-in spell checker, use the bool "spellcheck" property (Spellcheck constant). Spell checking can only be enabled if the editor type is set to SingleLineText or MultiLineText.

For the editor, you can set a hint that will be shown while the editor is empty. To do this, use the string property "hint" (Hint constant).

For a multi-line editor, auto-wrap mode can be enabled. The bool property "edit-wrap" (EditWrap constant) is used for this. If "edit-wrap" is false (default), then horizontal scrolling is used. If enabled, the text wraps to a new line when the EditView border is reached.

To change the color of the text input caret, use the Color property "caret-color" (CaretColor constant). The "caret-color" property can be set not only for EditView, but for any container. In this case, the color of the caret changes for all child EditViews placed in this container.

The "data-list" property (DataList constant) allows you to specify an array of recommended values. If you set the "data-list" property, the editor will have a drop-down menu with a list of these values. The value of this property must be an array of strings. For example

editor := rui.NewEditView(session, rui.Params{
	rui.DataList: []string{"Text 1", "Text 2", "Text 3"},
})

The following functions can be used to get the values of the properties of an EditView:

func GetText(view View, subviewID ...string) string
func GetHint(view View, subviewID ...string) string
func GetMaxLength(view View, subviewID ...string) int
func GetEditViewType(view View, subviewID ...string) int
func GetEditViewPattern(view View, subviewID ...string) string
func IsReadOnly(view View, subviewID ...string) bool
func IsEditViewWrap(view View, subviewID ...string) bool
func IsSpellcheck(view View, subviewID ...string) bool
func GetCaretColor(view View, subviewID ...string) Color
func GetDataList(view View, subviewID ...string) []string

The "edit-text-changed" event (EditTextChangedEvent constant) is used to track changes to the text. The main event listener has the following format:

func(EditView, string, string)

where the second argument is the new text value, the third argument is the previous text value.

Additional event listeners can have the following format

func(EditView, newText string)
func(newText, oldText string)
func(newText string)
func(EditView)
func()

You can get the current list of text change listeners using the function

func GetTextChangedListeners(view View, subviewID ...string) []func(EditView, string, string)

NumberPicker

The NumberPicker element extends the View interface to enter numbers.

To create a NumberPicker, the function is used:

func NewNumberPicker(session Session, params Params) NumberPicker

NumberPicker can work in two modes: text editor and slider. The mode sets the int property "number-picker-type" (NumberPickerType constant). The "number-picker-type" property can take the following values:

Value Constant Name Editor type
0 NumberEditor "editor" Text editor. Default value
1 NumberSlider "slider" Slider

You can set/get the current value using the "number-picker-value" property (NumberPickerValue constant). The following can be passed as a value to the "number-picker-value" property:

  • float64
  • float32
  • int
  • int8 … int64
  • uint
  • uint8 … uint64
  • textual representation of any of the above types

All of these types are cast to float64. Accordingly, the Get function always returns a float64 value. The value of the "number-picker-value" property can also be read using the function:

func GetNumberPickerValue(view View, subviewID ...string) float64

The entered values may be subject to restrictions. For this, the following properties are used:

Property Constant Restriction
"number-picker-min" NumberPickerMin Minimum value
"number-picker-max" NumberPickerMax Maximum value
"number-picker-step" NumberPickerStep Value change step

Assignments to these properties can be the same value types as "number-picker-value".

By default, if "number-picker-type" is equal to NumberSlider, the minimum value is 0, maximum is 1. If "number-picker-type" is equal to NumberEditor, then the entered numbers, by default, are limited only by the range of float64 values.

You can read the values of these properties using the functions:

func GetNumberPickerMinMax(view View, subviewID ...string) (float64, float64)
func GetNumberPickerStep(view View, subviewID ...string) float64

The "data-list" property (DataList constant) allows you to specify an array of recommended values. If you set the "data-list" property in case

  • if "number-picker-type" is set to NumberEditor, then the editor will have a drop-down menu with a list of these values;
  • if "number-picker-type" is set to NumberSlider, then the slider will display labels corresponding to these values;

The value of the "data-list" property must be an array of strings, integers, real numbers, or a combination of these. For example

editor1 := rui.NewNumberPicker(session, rui.Params{
	rui.DataList: []string{"1", "2", "3"},
})

editor2 := rui.NewNumberPicker(session, rui.Params{
	rui.DataList: []int{1, 2, 3},
})

editor3 := rui.NewNumberPicker(session, rui.Params{
	rui.DataList: []any{"1", 2, 3.0},
})

You can get the value of the "data-list" property using the function

func GetDataList(view View, subviewID ...string) []string

The "number-changed" event (NumberChangedEvent constant) is used to track the change in the entered value. The main event listener has the following format:

func(picker NumberPicker, newValue, oldValue float64)

where the second argument is the new value, the third argument is the previous value.

Additional event listeners can have the following format

func(picker NumberPicker, newValue float64)
func(newValue, oldValue float64)
func(newValue float64)
func(picker NumberPicker)
func()

You can get the current list of value change listeners using the function

func GetNumberChangedListeners(view View, subviewID ...string) []func(NumberPicker, float64, float64)

DatePicker

The DatePicker element extends the View interface to enter dates.

To create DatePicker function is used:

func NewDatePicker(session Session, params Params) DatePicker

You can set/get the current value using the "date-picker-value" property (the DatePickerValue constant). The following can be passed as a value to the "date-picker-value" property:

  • time.Time

  • constant

  • text that can be converted to time.Time by function

    func time.Parse(layout string, value string) (time.Time, error)

The text is converted to time.Time. Accordingly, the Get function always returns a time.Time value. The value of the "date-picker-value" property can also be read using the function:

func GetDatePickerValue(view View, subviewID ...string) time.Time

The dates you enter may be subject to restrictions. For this, the following properties are used:

Property Constant Data type Restriction
"date-picker-min" DatePickerMin time.Time Minimum date value
"date-picker-max" DatePickerMax time.Time Maximum date value
"date-picker-step" DatePickerStep int Date change step in days

You can read the values of these properties using the functions:

func GetDatePickerMin(view View, subviewID ...string) (time.Time, bool)
func GetDatePickerMax(view View, subviewID ...string) (time.Time, bool)
func GetDatePickerStep(view View, subviewID ...string) int

The "data-list" property (DataList constant) allows you to specify an array of recommended values. If you set the "data-list" property, the editor may have a drop-down menu with a list of these values. Some browsers may ignore this property, such as Safari for macOS.

The value of this property must be an array of strings in the format "YYYY-MM-DD". For example

editor := rui.NewDatePicker(session, rui.Params{
	rui.DataList: []string{"1990-09-02", "2010-05-24"},
})

The "date-changed" event (DateChangedEvent constant) is used to track the change in the entered value. The main event listener has the following format:

func(picker DatePicker, newDate, oldDate time.Time)

where the second argument is the new date value, the third argument is the previous date value.

Additional event listeners can have the following format

func(picker DatePicker, newDate time.Time)
func(newDate, oldDate time.Time)
func(newDate time.Time)
func(picker DatePicker)
func()

You can get the current list of date change listeners using the function

func GetDateChangedListeners(view View, subviewID ...string) []func(DatePicker, time.Time, time.Time)

TimePicker

The TimePicker element extends the View interface and is intended for entering time.

To create a TimePicker, the function is used:

func NewTimePicker(session Session, params Params) TimePicker

You can set/get the current value using the "time-picker-value" property (TimePickerValue constant). The following can be passed as a value to the "time-picker-value" property:

  • time.Time

  • constant

  • text that can be converted to time.Time by function

    func time.Parse(layout string, value string) (time.Time, error)

The text is converted to time.Time. Accordingly, the Get function always returns a time.Time value. The value of the "time-picker-value" property can also be read using the function:

func GetTimePickerValue(view View, subviewID ...string) time.Time

The time entered may be subject to restrictions. For this, the following properties are used:

Property Constant Data type Restriction
"time-picker-min" TimePickerMin time.Time Minimum time value
"time-picker-max" TimePickerMax time.Time The maximum value of time
"time-picker-step" TimePickerStep int Time step in seconds

You can read the values of these properties using the functions:

func GetTimePickerMin(view View, subviewID ...string) (time.Time, bool)
func GetTimePickerMax(view View, subviewID ...string) (time.Time, bool)
func GetTimePickerStep(view View, subviewID ...string) int

The "data-list" property (DataList constant) allows you to specify an array of recommended values. If you set the "data-list" property, the editor may have a drop-down menu with a list of these values. Some browsers may ignore this property, such as Safari for macOS.

The value of this property must be an array of strings in the format "HH:MM:SS" or "HH:MM". For example

editor := rui.NewTimePicker(session, rui.Params{
	rui.DataList: []string{"1990-09-02", "2010-05-24"},
})

The "time-changed" event (TimeChangedEvent constant) is used to track the change in the entered value. The main event listener has the following format:

func(picker TimePicker, newTime, oldTime time.Time)

where the second argument is the new time value, the third argument is the previous time value.

Additional event listeners can have the following format

func(picker TimePicker, newTime time.Time)
func(newTime, oldTime time.Time)
func(newTime time.Time)
func(picker TimePicker)
func()

You can get the current list of date change listeners using the function

func GetTimeChangedListeners(view View, subviewID ...string) []func(TimePicker, time.Time, time.Time)

ColorPicker

The ColorPicker element extends the View interface and is designed to select a color in RGB format without an alpha channel.

To create a ColorPicker, the function is used:

func NewColorPicker(session Session, params Params) ColorPicker

You can set/get the current color value using the "color-picker-value" property (ColorPickerValue constant). The following can be passed as a value to the "color-picker-value" property:

  • Color
  • text representation of Color
  • constant

The value of the property "color-picker-value" can also be read using the function:

func GetColorPickerValue(view View, subviewID ...string) Color

The "color-changed" event (ColorChangedEvent constant) is used to track the change in the selected color. The main event listener has the following format:

func(picker ColorPicker, newColor, oldColor Color)

where the second argument is the new color value, the third argument is the previous color value.

Additional event listeners can have the following format

func(picker ColorPicker, newColor string)
func(newColor, oldColor string)
func(newColor string)
func(picker ColorPicker)
func()

You can get the current list of date change listeners using the function

func GetColorChangedListeners(view View, subviewID ...string) []func(ColorPicker, Color, Color)

FilePicker

The FilePicker element extends the View interface to select one or more files.

To create a FilePicker, the function is used:

func NewFilePicker(session Session, params Params) FilePicker

The boolean property "multiple" (constant Multiple) is used to set the mode of selecting multiple files. The value "true" enables the selection of multiple files, "false" enables the selection of a single file. The default is "false".

You can restrict the selection to only certain types of files. To do this, use the "accept" property (constant Accept). This property is assigned a list of allowed file extensions and / or mime-types. The value can be specified either as a string (elements are separated by commas) or as an array of strings. Examples

rui.Set(view, "myFilePicker", rui.Accept, "png, jpg, jpeg")
rui.Set(view, "myFilePicker", rui.Accept, []string{"png", "jpg", "jpeg"})
rui.Set(view, "myFilePicker", rui.Accept, "image/*")

Two functions of the FilePicker interface are used to access the selected files:

Files() []FileInfo
LoadFile(file FileInfo, result func(FileInfo, []byte))

as well as the corresponding global functions

func GetFilePickerFiles(view View, subviewID ...string) []FileInfo
func LoadFilePickerFile(view View, subviewID string, file FileInfo, result func(FileInfo, []byte))

The Files/GetFilePickerFiles functions return a list of the selected files as a slice of FileInfo structures. The FileInfo structure is declared as

type FileInfo struct {
	// Name - the file's name.
	Name string
	// LastModified specifying the date and time at which the file was last modified
	LastModified time.Time
	// Size - the size of the file in bytes.
	Size int64
	// MimeType - the file's MIME type.
	MimeType string
}

FileInfo contains only information about the file, not the file content. The LoadFile/LoadFilePickerFile function allows you to load the contents of one of the selected files. The LoadFile function is asynchronous. After loading, the contents of the selected file are passed to the argument-function of the LoadFile. Example

if filePicker := rui.FilePickerByID(view, "myFilePicker"); filePicker != nil {
	if files := filePicker.Files(); len(files) > 0 {
		filePicker.LoadFile(files[0], func(file rui.FileInfo, data []byte) {
			if data != nil {
				// ... 
			}
		})
	}
}

equivalent to

if files := rui.GetFilePickerFiles(view, "myFilePicker"); len(files) > 0 {
	rui.LoadFilePickerFile(view, "myFilePicker", files[0], func(file rui.FileInfo, data []byte) {
		if data != nil {
			// ... 
		}
	})
}

If an error occurs while loading the file, the data value passed to the result function will be nil, and the error description will be written to the log

The "file-selected-event" event (constant FileSelectedEvent) is used to track changes in the list of selected files. The main event listener has the following format:

func(picker FilePicker, files []FileInfo))

where the second argument is the new value of the list of selected files.

You can get the current list of listeners of the list of files changing using the function

func GetFileSelectedListeners(view View, subviewID ...string) []func(FilePicker, []FileInfo)

DropDownList

The DropDownList element extends the View interface and is designed to select a value from a drop-down list.

To create a DropDownList, use the function:

func NewDropDownList(session Session, params Params) DropDownList

The list of possible values is set using the "items" property (Items constant). The following data types can be passed as a value to the "items" property

  • []string
  • []fmt.Stringer
  • []any containing as elements only: string, fmt.Stringer, bool, rune, float32, float64, int, int8 … int64, uint, uint8 … uint64.

All of these data types are converted to []string and assigned to the "items" property. You can read the value of the "items" property using the function

func GetDropDownItems(view View, subviewID ...string) []string

You can disable the selection of individual items. For this, the "disabled-items" property (constant DisabledItems) is used. This property is assigned an array of disabled item indices. The index can be specified either as a number, as text, or as a constant. Therefore, the following data types can be assigned to the "disabled-items" property:

  • []int
  • int
  • []string
  • string - can contain multiple indexes separated by commas
  • []any - containing as elements only: string, int, int8…int64, uint, uint8…uint64.

All of these data types are converted to []any and assigned to the "disabled-items" property. You can read the value of the "disabled-items" property using the function

func GetDropDownDisabledItems(view View, subviewID ...string) []int

You can add separators between list items. To do this, use the "item-separators" property (the ItemSeparators constant). This property is assigned an array of item indices after which separators must be added. The "item-separators" property can be assigned the same data types as the "disabled-items" property. You can read the value of the "item-separators" property using the function

func GetDropDownItemSeparators(view View, subviewID ...string) []int

The selected value is determined by the int property "current" (Current constant). The default is 0. You can read the value of this property using the function

func GetCurrent(view View, subviewID ...string) int

To track the change of the "current" property, the "drop-down-event" event (DropDownEvent constant) is used. The main event listener has the following format:

func(list DropDownList, newCurrent int)

where the second argument is the index of the selected item, the third argument is the previous index value.

Additional event listeners can have the following format

func(list DropDownList, newCurrent int)
func(newCurrent, oldCurrent int)
func(newCurrent int)
func(list DropDownList)
func()

You can get the current list of date change listeners using the function

func GetDropDownListeners(view View, subviewID ...string) []func(DropDownList, int, int)

ProgressBar

The DropDownList element extends the View interface and is designed to display progress as a fillable bar.

To create a ProgressBar, the function is used:

func NewProgressBar(session Session, params Params) ProgressBar

ProgressBar has two float64 properties:

  • "progress-max" (ProgressBarMax constant) - maximum value (default 1);
  • "progress-value" (ProgressBarValue constant) - current value (default 0).

The minimum is always 0. In addition to float64, float32, int, int8 … int64, uint, uint8 … uint64

You can read the value of these properties using the functions

func GetProgressBarMax(view View, subviewID ...string) float64
func GetProgressBarValue(view View, subviewID ...string) float64

Button

The Button element implements a clickable button. This is a CustomView (about it below) based on ListLayout and, accordingly, has all the properties of ListLayout. But unlike ListLayout, it can receive input focus.

Content is centered by default.

To create a Button, use the function:

func NewButton(session Session, params Params) Button

ListView

The ListView element implements a list. The ListView is created using the function:

func NewListView(session Session, params Params) ListView

ListView is implemented on top of ListLayout and therefore supports all ListLayout properties: "orientation", "list-wrap", "vertical-align", "horizontal-align", "list-row-gap", and "list-column-gap".

In addition to these properties ListView has the following:

The "items" property

List items are set using the "items" property (Items constant). The main value of the "items" property is the ListAdapter interface:

type ListAdapter interface {
	ListSize() int
	ListItem(index int, session Session) View
}

In addition to these two mandatory methods, a third optional one can be defined which specifies the status of the i-th element as allowed/disabled. This method is declared as

	IsListItemEnabled(index int) bool

Accordingly, the functions of this interface must return the number of elements, the View of the i-th element and the status of the i-th element (allowed/denied).

You can implement this interface yourself or use helper functions:

func NewTextListAdapter(items []string, params Params) ListAdapter
func NewViewListAdapter(items []View) ListAdapter

NewTextListAdapter creates an adapter from an array of strings, the second argument is the parameters of the TextView used to display the text. NewViewListAdapter creates an adapter from the View array.

The "items" property can be assigned the following data types:

  • ListAdapter;
  • [] View, when assigned, is converted to a ListAdapter using the NewViewListAdapter function;
  • [] string, when assigned, is converted to a ListAdapter using the NewTextListAdapter function;
  • [] interface {} which can contain elements of type View, string, fmt.Stringer, bool, rune, float32, float64, int, int8 ... int64, uint, uint8 ... uint64. When assigning, all types except View and string are converted to string, then all string in TextView and from the resulting View array using the NewViewListAdapter function, a ListAdapter is obtained.

If the list items change during operation, then after the change, either the ReloadListViewData() function of the ListView interface or the global ReloadListViewData(view View, subviewID ...string) function must be called. These functions update the displayed list items.

"Orientation" property

List items can be arranged both vertically (in columns) and horizontally (in rows). The "orientation" property (Orientation constant) of int type specifies how the list items will be positioned relative to each other. The property can take the following values:

Value Constant Location
0 TopDownOrientation Items are arranged in a column from top to bottom.
1 StartToEndOrientation Elements are laid out on a line from beginning to end.
2 BottomUpOrientation Items are arranged in a column from bottom to top.
3 EndToStartOrientation Elements are arranged in a row from end to beginning.

The start and end positions for StartToEndOrientation and EndToStartOrientation depend on the value of the "text-direction" property. For languages written from right to left (Arabic, Hebrew), the beginning is on the right, for other languages - on the left.

You can get the value of this property using the function

func GetListOrientation(view View, subviewID ...string) int
"wrap" property

The "wrap" int property (Wrap constant) defines the position of elements in case of reaching the border of the container. There are three options:

  • WrapOff (0) - the column/row of elements continues and goes beyond the bounds of the visible area.

  • WrapOn (1) - starts a new column/row of items. The new column is positioned towards the end (for the position of the beginning and end, see above), the new line is at the bottom.

  • WrapReverse (2) - starts a new column/row of elements. The new column is positioned towards the beginning (for the position of the beginning and end, see above), the new line is at the top.

You can get the value of this property using the function

func GetListWrap(view View, subviewID ...string) int
"item-width" and "item-height" properties

By default, the height and width of list items are calculated based on their content. This leads to the fact that the elements of the vertical list can have different heights, and the elements of the horizontal - different widths.

You can set a fixed height and width of the list item. To do this, use the SizeUnit properties "item-width" and "item-height"

You can get the values of these properties using the functions

func GetListItemWidth(view View, subviewID ...string) SizeUnit
func GetListItemHeight(view View, subviewID ...string) SizeUnit
"item-vertical-align" property

The "item-vertical-align" int property (ItemVerticalAlign constant) sets the vertical alignment of the contents of the list items. Valid values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Height alignment

You can get the value of this property using the function

func GetListItemVerticalAlign(view View, subviewID ...string) int
"item-horizontal-align" property

The "item-horizontal-align" int property (ItemHorizontalAlign constant) sets the horizontal alignment of the contents of the list items. Valid values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Height alignment

You can get the value of this property using the function

GetListItemHorizontalAlign(view View, subviewID ...string) int
"current" property

ListView allows you to select list items with the "allowed" status (see ListAdapter). The item can be selected both interactively and programmatically. To do this, use the int property "current" (constant Current). The value "current" is less than 0 means that no item is selected

You can get the value of this property using the function

func GetCurrent(view View, subviewID ...string) int
"list-item-style", "current-style", and "current-inactive-style" properties

These three properties are responsible for the background style and text properties of each list item.

Property Constant Style
"list-item-style" ListItemStyle Unselected element style
"current-style" CurrentStyle The style of the selected item. ListView in focus
"current-inactive-style" CurrentInactiveStyle The style of the selected item. ListView is out of focus
"checkbox", "checked", "checkbox-horizontal-align", and "checkbox-vertical-align" properties

The "current" property allows you to select one item in the list. The "checkbox" properties allow you to add a checkbox to each item in the list with which you can select several items in the list. The "checkbox" int property (ItemCheckbox constant) can take the following values

Value Constant Name Checkbox view
0 NoneCheckbox "none" There is no checkbox. Default value
1 SingleCheckbox "single" ◉ A checkbox that allows you to mark only one item
2 MultipleCheckbox "multiple" ☑ A checkbox that allows you to mark several items

You can get the value of this property using the function

func GetListViewCheckbox(view View, subviewID ...string) int

You can get/set the list of checked items using the "checked" property (Checked constant). This property is of type []int and stores the indexes of the marked elements. You can get the value of this property using the function

func GetListViewCheckedItems(view View, subviewID ...string) []int

You can check if a specific element is marked using the function

func IsListViewCheckedItem(view View, subviewID string, index int) bool

By default, the checkbox is located in the upper left corner of the element. You can change its position using int properties "checkbox-horizontal-align" and "checkbox-vertical-align" (CheckboxHorizontalAlign and CheckboxVerticalAlign constants)

The "checkbox-horizontal-align" int property can take the following values:

Value Constant Name Checkbox location
0 LeftAlign "left" At the left edge. Content on the right
1 RightAlign "right" At the right edge. Content on the left
2 CenterAlign "center" Center horizontally. Content below or above

The "checkbox-vertical-align" int property can take the following values:

Value Constant Name Checkbox location
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment

Special case where both "checkbox-horizontal-align" and "checkbox-vertical-align" are CenterAlign (2). In this case, the checkbox is centered horizontally, the content is below

You can get property values for "checkbox-horizontal-align" and "checkbox-vertical-align" using the functions

func GetListViewCheckboxHorizontalAlign(view View, subviewID ...string) int
func GetListViewCheckboxVerticalAlign(view View, subviewID ...string) int
ListView events

There are three specific events for ListView

  • "list-item-clicked" (ListItemClickedEvent constant) event occurs when the user clicks on a list item. The main listener for this event has the following format: func(ListView, int). Where the second argument is the index of the element.

  • "list-item-selected" (ListItemSelectedEvent constant) event occurs when the user selects a list item. The main listener for this event has the following format: func(ListView, int). Where the second argument is the index of the element.

  • "list-item-checked" (ListItemCheckedEvent constant) event occurs when the user checks/unchecks the checkbox of a list item. The main listener for this event has the following format: func(ListView, []int). Where the second argument is an array of indexes of the tagged items.

You can get lists of listeners for these events using the functions:

func GetListItemClickedListeners(view View, subviewID ...string) []func(ListView, int)
func GetListItemSelectedListeners(view View, subviewID ...string) []func(ListView, int)
func GetListItemCheckedListeners(view View, subviewID ...string) []func(ListView, []int)

TableView

The TableView element implements a table. To create a TableView, the function is used:

func NewTableView(session Session, params Params) TableView
"content" property

The "content" property defines the content of the table. To describe the content, you need to implement the TableAdapter interface declared as

type TableAdapter interface {
	RowCount() int
	ColumnCount() int
	Cell(row, column int) any
}

where RowCount() and ColumnCount() functions must return the number of rows and columns in the table; Cell(row, column int) returns the contents of a table cell. The Cell() function can return elements of the following types:

  • string
  • rune
  • float32, float64
  • integer values: int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64
  • bool
  • rui.Color
  • rui.View
  • fmt.Stringer
  • rui.VerticalTableJoin, rui.HorizontalTableJoin

The "content" property can also be assigned the following data types

  • TableAdapter
  • [][]any
  • [][]string

[][]any and [][]string are converted to a TableAdapter when assigned.

If the elements of the table change during operation, then to update the contents of the table, you must call one of the two methods of the TableView interface

  • ReloadTableData()
  • ReloadCell(row, column int)

The ReloadTableData method updates the entire table, while ReloadCell updates the contents of only a specific table cell. Global functions can be used to call the ReloadTableData and ReloadCell methods

func ReloadTableViewData(view View, subviewID ...string) bool
func ReloadTableViewCell(row, column int, view View, subviewID ...string) bool
"cell-style" property

The "cell-style" property (CellStyle constant) is used to customize the appearance of a table cell. Only an implementation of the TableCellStyle interface can be assigned to this property.

type TableCellStyle interface {
	CellStyle(row, column int) Params
}

This interface contains only one CellStyle function that returns the styling parameters for a given table cell. Any properties of the View interface can be used. For example

func (style *myTableCellStyle) CellStyle(row, column int) rui.Params {
	if row == 0 {
		return rui.Params {
			rui.BackgroundColor: rui.Gray,
			rui.Italic:          true,
		}
	}
	return nil
}

If you don't need to change the appearance of a cell, you can return nil for it.

"row-span" and "column-span" properties

In addition to the properties of the View interface, the CellStyle function can return two more properties of type int: "row-span" (RowSpan constant) and "column-span" (ColumnSpan constant). These properties are used to combine table cells.

The "row-span" property specifies how many cells to merge vertically, and the "column-span" property - horizontally. For example

func (style *myTableCellStyle) CellStyle(row, column int) rui.Params {
	if row == 0 && column == 0 {
		return rui.Params { rui.RowSpan: 2 }
	}
	if row == 0 && column == 1 {
		return rui.Params { rui.ColumnSpan: 2 }
	}
	return nil
}

In this case, the table will look like this

|------+----------------|
|      |                |
|      +-------+--------|
|      |       |        |
|------+-------+--------|

If [][]any is used as the value of the "content" property, then empty structures are used to merge cells

type VerticalTableJoin struct {
}

type HorizontalTableJoin struct {
}

These structures attach the cell to the top/left, respectively. The description of the above table will be as follows

content := [][]any {
	{"", "", rui.HorizontalTableJoin{}},
	{rui.VerticalTableJoin{}, "", ""},
}
"row-style" property

The "row-style" property (RowStyle constant) is used to customize the appearance of a table row. This property can be assigned either an implementation of the TableRowStyle interface or []Params. TableRowStyle is declared as

type TableRowStyle interface {
	RowStyle(row int) Params
}

The RowStyle function returns parameters that apply to the entire row of the table. The "row-style" property has a lower priority than the "cell-style" property, i.e. properties set in "cell-style" will be used instead of those set in "row-style"

"column-style" property

The "column-style" property (ColumnStyle constant) is used to customize the appearance of a table column. This property can be assigned either an implementation of the TableColumnStyle interface or []Params. TableColumnStyle is declared as

type TableColumnStyle interface {
	ColumnStyle(column int) Params
}

The ColumnStyle function returns the parameters applied to the entire column of the table. The "column-style" property has a lower precedence over the "cell-style" and "row-style" properties.

"head-height" and "head-style" properties

The table can have a header. The "head-height" int property (constant HeadHeight) indicates how many first rows of the table form the header. The "head-style" property (constant HeadStyle) sets the style of the heading. The "head-style" property can be assigned, value of type:

  • string - style name;
  • []Params - enumeration of header properties.
"foot-height" and "foot-style" properties

The table can have finalizing lines at the end (footer). For example, the "total" line. The "foot-height" int property (the FootHeight constant) indicates the number of these footer lines. The "foot-style" property (constant FootStyle) sets footer style. The values for the "foot-style" property are the same as for the "head-style" property.

"cell-padding" property

The "cell-padding" BoundsProperty property (CellPadding constant) sets the padding from the cell borders to the content. This property is equivalent to

func (style *myTableCellStyle) CellStyle(row, column int) rui.Params {
	return rui.Params { rui.Padding: <my padding> }
}

And it was introduced for convenience, so that you do not have to write an adapter to set indents. The cell-padding property has a lower priority than the "cell-style" property.

"cell-padding" can also be used when setting parameters in the "row-style", "column-style", "foot-style", and "head-style" properties

"cell-border" property

The "cell-border" property (CellBorder constant) sets the memory for all table cells. This property is equivalent to

func (style *myTableCellStyle) CellStyle(row, column int) rui.Params {
	return rui.Params { rui.Border: <my padding> }
}

And it was introduced for convenience, so that it is not necessary to write an adapter for the frame. The "cell-border" property has a lower precedence over the "cell-style" property.

"cell-border" can also be used when setting parameters in properties "row-style", "column-style", "foot-style" and "head-style"

"table-vertical-align" property

The "table-vertical-align" int property (TableVerticalAlign constant) specifies the vertical alignment of data within a table cell. Valid values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment
3, 4 BaselineAlign "baseline" Baseline alignment

For horizontal alignment, use the "text-align" property

You can get the value of this property using the function

func GetTableVerticalAlign(view View, subviewID ...string) int
"selection-mode" property

The "selection-mode" property (SelectionMode constant) of the int type determines the mode of selection (highlighting) of table elements. Available modes:

  • NoneSelection (0). Default mode. In this mode, you cannot select table elements. The table cannot receive input focus.

  • CellSelection (1). In this mode, one table cell can be selected (highlighted). The cell is selected interactively using the mouse or keyboard (using the cursor keys). In this mode, the table can receive input focus. In this mode, the table generates two types of events: "table-cell-selected" and "table-cell-clicked" (see below).

  • RowSelection (2). In this mode, only the entire table row can be selected (highlighted). In this mode, the table is similar to a ListView. The row is selected interactively with the mouse or keyboard (using the cursor keys). In this mode, the table can receive input focus. In this mode, the table generates two types of events: "table-row-selected" and "table-row-clicked" (see below).

You can get the value of this property using the function

func GetSelectionMode(view View, subviewID ...string) int
"current" property

The "current" property (Current constant) sets the coordinates of the selected cell/row as a structure

type CellIndex struct {
	Row, Column int
}

If the cell is not selected, then the values of the Row and Column fields will be less than 0.

In RowSelection mode, the value of the Column field is ignored. Also in this mode, the "current" property can be assigned a value of type int (row index).

You can get the value of this property using the function

func GetTableCurrent(view View, subviewID ...string) CellIndex
"allow-selection" property

By default, you can select any cell/row of the table. However, it is often necessary to disable the selection of certain elements. The "selection-mode" property (SelectionMode constant) allows you to set such a rule.

In CellSelection mode, this property is assigned the implementation of the interface

type TableAllowCellSelection interface {
	AllowCellSelection(row, column int) bool
}

and in RowSelection mode this property is assigned the implementation of the interface

type TableAllowRowSelection interface {
	AllowRowSelection(row int) bool
}

The AllowCellSelection/AllowRowSelection function must return "true" if the cell/row can be selected and "false" if the cell/row cannot be selected.

"table-cell-selected" and "table-cell-clicked" events

The "table-cell-selected" event is fired in CellSelection mode when the user has selected a table cell with the mouse or keyboard.

The "table-cell-clicked" event occurs if the user clicks on a table cell (and if it is not selected, the "table-cell-selected" event occurs first) or presses the Enter or Space key.

The main listener for these events has the following format:

func(TableView, int, int)

where the second argument is the cell row index, the third argument is the column index

You can also use a listener in the following format:

func(int, int)
"table-row-selected" and "table-row-clicked" events

The "table-row-selected" event is fired in RowSelection mode when the user has selected a table row with the mouse or keyboard.

The "table-row-clicked" event occurs if the user clicks on a table row (if it is not selected, the "table-row-selected" event fires first) or presses the Enter or Space key.

The main listener for these events has the following format:

func(TableView, int)

where the second argument is the row index.

You can also use a listener in the following format:

func(int)

Custom View

A custom View must implement the CustomView interface, which extends the ViewsContainer and View interfaces. A custom View is created based on another, which is named Super View.

To simplify the task, there is already a basic CustomView implementation in the form of a CustomViewData structure.

Let's consider creating a custom View using the built-in Button element as an example:

  1. declare the Button interface as extending CustomView, and the buttonData structure as extending CustomViewData

    type Button interface { rui.CustomView }

    type buttonData struct { rui.CustomViewData }

  2. implement the CreateSuperView function

    func (button *buttonData) CreateSuperView(session Session) View { return rui.NewListLayout(session, rui.Params{ rui.Semantics: rui.ButtonSemantics, rui.Style: "ruiButton", rui.StyleDisabled: "ruiDisabledButton", rui.HorizontalAlign: rui.CenterAlign, rui.VerticalAlign: rui.CenterAlign, rui.Orientation: rui.StartToEndOrientation, }) }

  3. if necessary, override the methods of the CustomView interface, for Button this is the Focusable() function (since the button can receive focus, but ListLayout does not)

    func (button *buttonData) Focusable() bool { return true }

  4. write a function to create a Button:

    func NewButton(session rui.Session, params rui.Params) Button { button := new(buttonData) rui.InitCustomView(button, "Button", session, params) return button }

When creating a CustomView, it is mandatory to call the InitCustomView function. This function initializes the CustomViewData structure. The first argument is a pointer to the structure to be initialized, the second is the name assigned to your View, the third is the session and the fourth is the parameters

  1. registering the item. It is recommended to register in the init method of the package

    rui.RegisterViewCreator("Button", func(session rui.Session) rui.View { return NewButton(session, nil) })

All! The new element is ready

CanvasView

CanvasView is an area in which you can draw. To create a CanvasView, the function is used:

func NewCanvasView(session Session, params Params) CanvasView

CanvasView has only one additional property: "draw-function" (DrawFunction constant). Using this property, a drawing function is set with the following description

func(Canvas)

where Canvas is the drawing context with which to draw

The Canvas interface contains a number of functions for customizing styles, text and drawing itself.

All coordinates and sizes are set only in pixels, so SizeUnit is not used when drawing. float64 used everywhere

Setting the line style

The following functions of the Canvas interface are used to customize the line color:

  • SetSolidColorStrokeStyle(color Color) - the line will be drawn with a solid color

  • SetLinearGradientStrokeStyle(x0, y0 float64, color0 Color, x1, y1 float64, color1 Color, stopPoints []GradientPoint) - the line will be drawn using a linear gradient. The gradient starts at x0, y0, and color0, and the gradient ends at x1, y1, and color1. The []GradientPoint array specifies the intermediate points of the gradient. If there are no intermediate points, then nil can be passed as the last parameter

  • SetRadialGradientStrokeStyle(x0, y0, r0 float64, color0 Color, x1, y1, r1 float64, color1 Color, stopPoints []GradientPoint) - the line will be drawn using a radial gradient. x0, y0, r0, color0 - center coordinates, radius and color of the starting circle. x1, y1, r1, color1 - center coordinates, radius and color of the end circle. The []GradientPoint array specifies intermediate points of the gradient

The GradientPoint structure is described as

type GradientPoint struct {
	Offset float64
	Color Color
}

where Offset is a value in the range from 0 to 1 specifies the relative position of the intermediate point, Color is the color of this point.

Line width in pixels is set by the function

SetLineWidth(width float64)

The type of line ends is set using the function

SetLineCap(cap int)

where cap can take the following values

Value Constant View
0 ButtCap The ends of lines are squared off at the endpoints. Default value.
1 RoundCap The ends of lines are rounded. The center of the circle is at the end point.
2 SquareCap the ends of lines are squared off by adding a box with an equal width and half the height of the line's thickness.

The shape used to connect two line segments at their intersection is specified by the function

SetLineJoin(join int)

where join can take the following values

Value Constant View
0 MiterJoin Connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. This setting is affected by the miterLimit property
1 RoundJoin rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. The radius for these rounded corners is equal to the line width.
2 BevelJoin Fills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment.

By default, a solid line is drawn. If you want to draw a broken line, you must first set the pattern using the function

SetLineDash(dash []float64, offset float64)

where dash []float64 specifies the line pattern in the form of alternating line lengths and gaps. The second argument is the offset of the template relative to the beginning of the line.

Example

canvas.SetLineDash([]float64{16, 8, 4, 8}, 0)

The line is drawn as follows: a 16-pixel segment, then an 8-pixel gap, then a 4-pixel segment, then an 8-pixel gap, then a 16-pixel segment again, and so on.

Setting the fill style

The following functions of the Canvas interface are used to customize the fill style:

  • SetSolidColorFillStyle(color Color) - the shape will be filled with a solid color

  • SetLinearGradientFillStyle(x0, y0 float64, color0 Color, x1, y1 float64, color1 Color, stopPoints []GradientPoint) - the shape will be filled with a linear gradient. The gradient starts at x0, y0, and color0, and the gradient ends at x1, y1, and color1. The []GradientPoint array specifies the intermediate points of the gradient. If there are no intermediate points, then nil can be passed as the last parameter

  • SetRadialGradientFillStyle(x0, y0, r0 float64, color0 Color, x1, y1, r1 float64, color1 Color, stopPoints []GradientPoint) - the shape will be filled with a radial gradient. x0, y0, r0, color0 - center coordinates, radius and color of the starting circle. x1, y1, r1, color1 - center coordinates, radius and color of the end circle. Array []GradientPoint specifies intermediate points of the gradient

Drawing geometric shapes
Rectangle

Three functions can be used to draw rectangles:

FillRect(x, y, width, height float64)
StrokeRect(x, y, width, height float64)
FillAndStrokeRect(x, y, width, height float64)

FillRect draws a filled rectangle.

StrokeRect draws the outline of a rectangle.

FillAndStrokeRect draws a path and fills in the interior.

Rounded Rectangle

Similar to the rectangle, there are three drawing functions

FillRoundedRect(x, y, width, height, r float64)
StrokeRoundedRect(x, y, width, height, r float64)
FillAndStrokeRoundedRect(x, y, width, height, r float64)

where r is the radius of the rounding

Ellipse

Three functions can also be used to draw ellipses:

FillEllipse(x, y, radiusX, radiusY, rotation float64)
StrokeEllipse(x, y, radiusX, radiusY, rotation float64)
FillAndStrokeEllipse(x, y, radiusX, radiusY, rotation float64)

where x, y is the center of the ellipse, radiusX, radiusY are the radii of the ellipse along the X and Y axes, rotation - the angle of rotation of the ellipse relative to the center in radians.

Path

The Path interface allows you to describe a complex shape. Two Canvas methods are used to create a Path object:

NewPath() Path
NewPathFromSvg(data string) Path

The NewPath() method creates an empty shape. Next, you must describe the shape using the methods of the Path interface

The NewPathFromSvg(data string) Path method creates the shape described in the data parameter. The data parameter is a description of the shape in the format of a svg image element. For example

path := canvas.NewPathFromSvg("M 30,0 C 30,0 27,8.6486 17,21.622 7,34.595 0,40 0,40 0,40 6,44.3243 17,58.378 28,72.432 30,80 30,80 30,80 37.8387,65.074 43,58.378 53,45.405 60,40 60,40 60,40 53,34.5946 43,21.622 33,8.649 30,0 30,0 Z")

Once created, you must describe the shape. For this, the following interface functions can be used:

  • MoveTo(x, y float64) - move the current point to the specified coordinates;

  • LineTo(x, y float64) - add a line from the current point to the specified one;

  • ArcTo(x0, y0, x1, y1, radius float64) - add a circular arc using the specified control points and radius. If necessary, the arc is automatically connected to the last point of the path with a straight line. x0, y0 - coordinates of the first control point; x1, y1 - coordinates of the second control point; radius - radius of the arc. Must be non-negative.

  • Arc(x, y, radius, startAngle, endAngle float64, clockwise bool) - add a circular arc. x, y - coordinates of the arc center; radius - radius of the arc. Must be non-negative; startAngle - The angle, in radians, at which the arc begins, measured clockwise from the positive X-axis. endAngle - The angle, in radians, at which the arc ends, measured clockwise from the positive X-axis. clockwise - if true, the arc will be drawn clockwise between the start and end corners, otherwise counterclockwise

  • BezierCurveTo(cp0x, cp0y, cp1x, cp1y, x, y float64) - add a cubic Bezier curve from the current point. cp0x, cp0y - coordinates of the first control point; cp1x, cp1y - coordinates of the second control point; x, y - coordinates of the end point.

  • QuadraticCurveTo(cpx, cpy, x, y float64) - add a quadratic Bezier curve from the current point. cpx, cpy - coordinates of the control point; x, y - coordinates of the end point.

  • Ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle float64, clockwise bool) - add an elliptical arc. x, y - coordinates of the center of the ellipse; radiusX is the radius of the major axis of the ellipse. Must be non-negative; radiusY - radius of the minor axis of the ellipse. Must be non-negative; rotation - the rotation of the ellipse, expressed in radians; startAngle The angle of the start of the ellipse in radians, measured clockwise from the positive x-axis. endAngle The angle, in radians, at which the ellipse ends, measured clockwise from the positive x-axis. clockwise - if true, draws the ellipse clockwise, otherwise counterclockwise.

The Close () function is called at the end and connects the start and end points of the shape. Used only for closed shapes.

After the Path is formed, it can be drawn using the following 3 functions

FillPath(path Path)
StrokePath(path Path)
FillAndStrokePath(path Path)
Line

To draw a line, use the function

DrawLine(x0, y0, x1, y1 float64)
Text

To display text in specified coordinates, two functions are used

FillText(x, y float64, text string)
StrokeText(x, y float64, text string)

The StrokeText function draws the outline of the text, FillText draws the text itself.

The horizontal alignment of the text relative to the specified coordinates is set using the function

SetTextAlign(align int)

where align can be one of the following values:

Value Constant Alignment
0 LeftAlign The specified point is the leftmost point of the text
1 RightAlign The specified point is the rightmost point of the text
2 CenterAlign The text is centered on the specified point
3 StartAlign If the text is displayed from left to right, then the text output is equivalent to LeftAlign, otherwise RightAlign
4 EndAlign If the text is displayed from left to right, then the text output is equivalent to RightAlign, otherwise LeftAlign

The vertical alignment of the text relative to the specified coordinates is set using the function

SetTextBaseline(baseline int)

where baseline can be one of the following values:

Value Constant Alignment
0 AlphabeticBaseline Relatively normal baseline of text
1 TopBaseline Relative to the top border of the text
2 MiddleBaseline About the middle of the text
3 BottomBaseline To the bottom of the text
4 HangingBaseline Relative to the dangling baseline of the text (used in Tibetan and other Indian scripts)
5 IdeographicBaseline Relative to the ideographic baseline of the text

An ideographic baseline is the bottom of a character display if the main character is outside the alphabet baseline (Used in Chinese, Japanese, and Korean fonts).

To set the font parameters of the displayed text, use the functions

SetFont(name string, size SizeUnit)
SetFontWithParams(name string, size SizeUnit, params FontParams)

where FontParams is defined as

type FontParams struct {
	// Italic - if true then a font is italic
	Italic bool
	// SmallCaps - if true then a font uses small-caps glyphs
	SmallCaps bool
	// Weight - a font weight. Valid values: 0…9, there
	//   0 - a weight does not specify;
	//   1 - a minimal weight;
	//   4 - a normal weight;
	//   7 - a bold weight;
	//   9 - a maximal weight.
	Weight int
	// LineHeight - the height (relative to the font size of the element itself) of a line box.
	LineHeight SizeUnit
}

The TextWidth function allows you to find out the width of the displayed text in pixels

TextWidth(text string, fontName string, fontSize SizeUnit) float64
Image

Before drawing an image, it must first be loaded. The global function is used for this:

func LoadImage(url string, onLoaded func(Image), session Session) Image {

The image is loaded asynchronously. After the download is finished, the function passed in the second argument will be called. If the image was loaded successfully, then the LoadingStatus() function of the Image interface will return the value ImageReady (1), if an error occurred while loading, then this function will return ImageLoadingError (2). The textual description of the error is returned by the LoadingError() function

Unlike an ImageView, loading an Image does not take into account the pixel density. It is up to you to decide which image to upload. You can do it like this:

var url string
if session.PixelRatio() == 2 {
	url = "image@2x.png"
} else {
	url = "image.png"
}

The following functions are used to draw the image:

DrawImage(x, y float64, image Image)
DrawImageInRect(x, y, width, height float64, image Image)
DrawImageFragment(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight float64, image Image)

The DrawImage function displays the image as it is (without scaling): x, y - coordinates of the upper left corner of the image

The DrawImageInRect function displays the image with scaling: x, y are coordinates of the upper left corner of the image, width, height are width and height of the result

The DrawImageFragment function displays a fragment of the image with scaling: srcX, srcY, srcWidth, srcHeight describe the original area of the image, dstX, dstY, dstWidth, dstHeight describe the resulting area.

Image can also be used in fill style

SetImageFillStyle(image Image, repeat int)

where repeat can take on the following values:

Value Constant Description
0 NoRepeat Image is not repeated
1 RepeatXY Image is repeated vertically and horizontally
2 RepeatX The image is repeated horizontally only
3 RepeatY The image is repeated vertically only

AudioPlayer, VideoPlayer, MediaPlayer

AudioPlayer and VideoPlayer are elements for audio and video playback. Both elements implement the MediaPlayer interface. Most of the properties and all events of AudioPlayer and VideoPlayer are implemented through the MediaPlayer.

"src" property

The "src" property (Source constant) specifies one or more media sources. The "src" property can take on the following types:

  • string,
  • MediaSource,
  • []MediaSource.

The MediaSource structure is declared as

type MediaSource struct {
	Url      string
	MimeType string
}

where Url is a required parameter, MimeType is an optional mime file type

Since different browsers support different file formats and codecs, it is recommended to specify multiple sources in different formats. The player chooses the most suitable one from the list of sources. Setting mime types makes this process easier for the browser

"controls" property

The "controls" bool property (Controls constant) specifies whether UI elements should be displayed to control playback of the media resource. The default is false.

If the "controls" property is false for the AudioPlayer, then it will be invisible and will not take up screen space.

"loop" property

The "loop" bool property (Loop constant). If it set to true, then the media file will start over when it reaches the end. The default is false.

"muted" property

The "muted" bool property (constant Muted) enables (true) / disables (false) silent mode. The default is false.

"preload" property

The "preload" int property (constant Preload) defines what data should be preloaded. Valid values:

Value Constant Name Description
0 PreloadNone "none" Media file must not be pre-loaded
1 PreloadMetadata "metadata" Only metadata is preloaded
2 PreloadAuto "auto" The entire media file can be downloaded even if the user doesn't have to use it.

The default value is PreloadAuto (2)

"poster" property

The "poster" string property (Poster constant) is used only for VideoPlayer. It sets the url of the image that will be shown until the video is loaded. If this property is not set, then a black screen will be shown first, and then the first frame (as soon as it is loaded).

"video-width" and "video-height" properties

The "video-width" (VideoWidth constant) and "video-height" (VideoHeight constant) float64 properties are used only for VideoPlayer. It defines the width and height of the rendered video in pixels.

If "video-width" and "video-height" are not specified, then the actual dimensions of the video are used, while the dimensions of the container in which the video is placed are ignored and the video may overlap other interface elements. Therefore, it is recommended to set these values, for example, like this

rui.Set(view, "videoPlayerContainer", rui.ResizeEvent, func(frame rui.Frame) {
	rui.Set(view, "videoPlayer", rui.VideoWidth, frame.Width)
	rui.Set(view, "videoPlayer", rui.VideoHeight, frame.Height)
})

If only one of the "video-width" or "video-height" properties is set, then the second is calculated based on the aspect ratio of the video

Developments

MediaPlayer has two groups of events:

  1. has a handler like

    func(MediaPlayer)

You can also use func(). This group includes the following events:

  • "abort-event" (constant AbortEvent) - Fires when the resource is not fully loaded, but not as a result of an error.

  • "can-play-event" (CanPlayEvent constant) is fired when the user agent is able to play media but judges that there is not enough data loaded to play the media to the end without having to stop to further buffer the content.

  • "can-play-through-event" (constant CanPlayThroughEvent) is fired when the user agent is able to play the media and evaluates that enough data has been loaded to play the media to its end, without having to stop to further buffer the content.

  • "complete-event" (CompleteEvent constant) -

  • "emptied-event" (EmptiedEvent constant) is fired when the media becomes empty; for example when the media is already loaded (or partially loaded)

  • "ended-event" (EndedEvent constant) - Fires when playback stops, when the end of media is reached, or if no further data is available.

  • "loaded-data-event" (LoadedDataEvent constant) is fired when the first frame of the media has finished loading.

  • "loaded-metadata-event" (LoadedMetadataEvent constant) is fired when the metadata has been loaded.

  • "loadstart-event" (LoadStartEvent constant) is fired when the browser starts loading the resource.

  • "pause-event" (PauseEvent constant) is fired when a pause request is processed and the action pauses, most often when the Pause () method is called.

  • "play-event" (PlayEvent constant) is fired when the media file starts playing, for example, as a result of using the Play () method

  • "playing-event" (PlayingEvent constant) is fired when playback is about to start after being paused or delayed due to lack of data.

  • "progress-event" (ProgressEvent constant) is fired periodically when the browser loads the resource.

  • "seeked-event" (SeekedEvent constant) is fired when the playback speed has changed.

  • "seeking-event" (SeekingEvent constant) is fired when a seeking operation begins.

  • "stalled-event" (StalledEvent constant) is fired when the user agent tries to retrieve media data, but no data arrives unexpectedly.

  • "suspend-event" (SuspendEvent constant) is fired when media loading has been suspended.

  • "waiting-event" (WaitingEvent constant) is fired when playback is stopped due to a temporary lack of data

  1. has a handler like

    func(MediaPlayer, float64)

You can also use func(float64), func(MediaPlayer) and func(). This group includes events related to changing the parameters of the player. The new value of the changed parameter is passed as the second argument.

  • "duration-changed-event" (DurationChangedEvent constant) is fired when the duration attribute has been updated.

  • "time-updated-event" (TimeUpdatedEvent constant) is fired when the current time has been updated.

  • "volume-changed-event" (VolumeChangedEvent constant) is fired when the volume changes.

  • "rate-changed-event" (RateChangedEvent constant) is fired when the playback speed has changed.

A separate event that does not belong to these two groups, "player-error-event" (PlayerErrorEvent constant) is fired when the resource cannot be loaded due to an error (eg network error).

The handler for this event looks like

func(player MediaPlayer, code int, message string) 

You can also use func(int, string), func(MediaPlayer) and func(). Where the argument "message" is the error message, "code" is the error code:

Error code Constant Value
0 PlayerErrorUnknown Unknown error
1 PlayerErrorAborted Fetching the associated resource was interrupted by a user request.
2 PlayerErrorNetwork Some kind of network error has occurred that prevented the media from successfully ejecting, even though it was previously available.
3 PlayerErrorDecode Although the resource was previously identified as being used, an error occurred while trying to decode the media resource.
4 PlayerErrorSourceNotSupported The associated resource object or media provider was found to be invalid.
Methods

MediaPlayer has a number of methods for controlling player parameters:

  • Play() starts playback of a media file;

  • Pause() pauses playback;

  • SetCurrentTime(seconds float64) sets the current playback time in seconds;

  • CurrentTime() float64 returns the current playing time in seconds;

  • Duration() float64 returns the duration of the media file in seconds;

  • SetPlaybackRate(rate float64) sets the playback speed. Normal speed is 1.0;

  • PlaybackRate() float64 returns the current playback speed;

  • SetVolume(volume float64) sets the volume speed in the range from 0 (silence) to 1 (maximum volume);

  • Volume() float64 returns the current volume;

  • IsEnded() bool returns true if the end of the media file is reached;

  • IsPaused() bool returns true if playback is paused.

For quick access to these methods, there are global functions:

func MediaPlayerPlay(view View, playerID string)
func MediaPlayerPause(view View, playerID string)
func SetMediaPlayerCurrentTime(view View, playerID string, seconds float64)
func MediaPlayerCurrentTime(view View, playerID string) float64
func MediaPlayerDuration(view View, playerID string) float64
func SetMediaPlayerVolume(view View, playerID string, volume float64)
func MediaPlayerVolume(view View, playerID string) float64
func SetMediaPlayerPlaybackRate(view View, playerID string, rate float64)
func MediaPlayerPlaybackRate(view View, playerID string) float64
func IsMediaPlayerEnded(view View, playerID string) bool
func IsMediaPlayerPaused(view View, playerID string) bool

where view is the root View, playerID is the id of AudioPlayer or VideoPlayer

Popup

Popup is an interface that allows you to display an arbitrary View as a popup window. To create the Popup interface, use the function

NewPopup(view View, param Params) Popup

where view - View of popup content (cannot be nil); params - parameters of the popup window (may be nil). As parameters of the pop-up window, either any View properties or a number of additional properties (they will be described below) can be used.

Once a Popup has been created, it needs to be displayed. To do this, use the Show() method of the Popup interface. To simplify the code, you can use the ShowPopup function, which is defined as

func ShowPopup(view View, param Params) Popup {
	popup := NewPopup(view, param)
	if popup != nil {
		popup.Show()
	}
	return popup
}

To close a popup window, use the Dismiss() method of the Popup interface.

In addition to the Show() and Dismiss() methods, the Popup interface has the following methods:

  • Session() Session - returns the current session;
  • View() View - returns the contents of the popup window.
Popup header

The popup window can have a title. In order to add a title, you need to add title text. For this, the "title" property (Title constant) is used, which can take two types of values:

  • string
  • view

The "title-style" string property (TitleStyle constant) is used to set the title style. The default title style is "ruiPopupTitle". If you want all your popups to have the same style, it's better not to use the "title-style" property, but to override the "ruiPopupTitle" style.

The header can also have a window close button. To add it to the header, use the "close-button" bool property. Setting this property to "true" adds a window close button to the title bar (the default value is "false").

Arrow Popup

A pop-up window can have an arrow on one side. An arrow is specified using the "arrow" int property (Arrow constant). The "arrow" property can take the following values

Value Constant Arrow location
0 NoneArrow No arrow (default value)
1 Top Arrow Arrow at the top side of the pop-up window
2 RightArrow Arrow on the right side of the pop-up window
3 BottomArrow Arrow at the bottom of the pop-up window
4 LeftArrow Arrow on the left side of the pop-up window

The size of the arrow is specified using the "arrow-size" (ArrowSize constant) and "arrow-width" (ArrowWidth constant) SizeUnit properties. They specify the length ("arrow-size") and width ("arrow-width") of the arrow. If these properties are not set, then the constants "@ruiArrowSize" (the default value is 16px) and "@ruiArrowWidth" (the default value is 16px) are used.

The alignment of the arrow relative to the popup is set using the "arrow-align" int property (ArrowAlign constant). The "arrow-align" property can take the following values

Value Constants Alignment
0 TopAlign / LeftAlign Top/left alignment
1 BottomAlign / RightAlign Bottom/Right Alignment
2 CenterAlign Center alignment (default value)

You can also set an additional offset for the arrow. For this, the "arrow-offset" SizeUnit property (ArrowOffset constant) is used.

If the value of the "arrow-align" property is TopAlign/LeftAlign, then the offset is relative to the top/left side. If the value of the "arrow-align" property is BottomAlign/RightAlign, then the offset is relative to the bottom/right side. If the value of the "arrow-align" property is CenterAlign, then an offset (can be either positive or negative) is added as an arrow padding. That is, the arrow is aligned in the center with an offset

If "arrow-offset" is not set, then the default value for "arrow-align" equal to CenterAlign is 0. For other "arrow-align" values, the default value is the appropriate corner radius of the popup.

Close Popup

As it was said above, the Dismiss() method of the Popup interface is used to close the popup window.

If a close button is added to the window title, clicking on it automatically calls the Dismiss() method. You cannot override the behavior of the window's close button. If you still need to redefine the behavior of this button, then this can be done by creating a custom header and creating your own close button in it.

There is another way to automatically call the Dismiss() method. This is the "outside-close" bool property (OutsideClose constant). If this property is set to "true", then clicking outside the popup window automatically calls the Dismiss() method.

The "dismiss-event" event (DismissEvent constant) is used to track the closing of the popup. It occurs after the Popup disappears from the screen. The main listener for this event has the following format:

func(Popup)
Button area

It is often necessary to add buttons such as "OK", "Cancel", etc. to the popup window. Using the "buttons" property (Buttons constant) you can add buttons that will be placed at the bottom of the window. The "buttons" property can be assigned the following data types:

  • PopupButton
  • []PopupButton

Where the PopupButton structure is declared as

type PopupButton struct {
	Title   string
	OnClick func(Popup)
}

where Title is the text of the button, OnClick is the function called when the button is clicked.

By default, buttons are aligned to the right edge of the popup window. However, this behavior can be overridden. For this, the "buttons-align" int property (ButtonsAlign constant) is used, which can take the following values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Width alignment

The distance between the buttons is set using the "ruiPopupButtonGap" constant of the SizeUnit type. You can override it in your theme.

Popup alignment

By default, the popup is positioned in the center of the browser window. You can change this behavior using the "vertical-align" (VerticalAlign constant) and "horizontal-align" (HorizontalAlign constant) int properties.

The "vertical-align" property can take the following values:

Value Constant Name Alignment
0 TopAlign "top" Top alignment
1 BottomAlign "bottom" Bottom alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Height alignment

The "horizontal-align" property can take the following values:

Value Constant Name Alignment
0 LeftAlign "left" Left alignment
1 RightAlign "right" Right alignment
2 CenterAlign "center" Center alignment
3 StretchAlign "stretch" Width alignment

The "margin" property can be used to move the window.

For example, you can organize a popup window attached to a button like this

rui.ShowPopup(myPopupView, rui.Params{
	rui.HorizontalAlign: rui.LeftAlign,
	rui.VerticalAlign:   rui.TopAlign,
	rui.MarginLeft:      rui.Px(myButton.Frame().Left),
	rui.MarginTop:       rui.Px(myButton.Frame().Bottom()),
})
Standard Popup

The rui library already implements some standard popups. The following functions are used to display them.

func ShowMessage(title, text string, session Session)

This function displays a message with the title given in the "title" argument and the message text given in the "text" argument.

func ShowQuestion(title, text string, session Session, onYes func(), onNo func())

This function displays a message with the given title and text and two buttons "Yes" and "No". When the "Yes" button is clicked, the message is closed and the onYes function is called (if it is not nil). When the "No" button is pressed, the message is closed and the onNo function is called (if it is not nil).

func ShowCancellableQuestion(title, text string, session Session, onYes func(), onNo func(), onCancel func())

This function displays a message with the given title and text and three buttons "Yes", "No" and "Cancel". When the "Yes", "No" or "Cancel" button is pressed, the message is closed and the onYes, onNo or onCancel function (if it is not nil) is called, respectively.

func ShowMenu(session Session, params Params) Popup

This function displays the menu. Menu items are set using the Items property. The property is identical to Items and is identical to the ListView property of the same name. The "popup-menu-result" property (PopupMenuResult constant) sets the function to be called when a menu item is selected. Its format:

func(int)

Menu example:

rui.ShowMenu(session, rui.Params{
	rui.OutsideClose:    true,
	rui.Items:           []string{"Item 1", "Item 2", "Item 3"},
	rui.PopupMenuResult: func(index int) {
		// ...
	},
})

Animation

The library supports two types of animation:

  • Animated property value changes (hereinafter "transition animation")
  • Script animated change of one or more properties (hereinafter simply "animation script")
AnimationProperty interface

The AnimationProperty interface is used to set animation parameters. It extends the Properties interface. The interface is created using the function:

func NewAnimationProperty(params Params) AnimationProperty

Some of the properties of the AnimationProperty interface are used in both types of animation, the rest are used only in animation scripts.

Common properties are

Property Constant Type Default Description
"duration" Duration float64 1 Animation duration in seconds
"delay" Delay float64 0 Delay before animation in seconds
"timing-function" TimingFunction string "ease" The function of changing the animation speed

Properties used only in animation scripts will be described below.

"timing-function" property

The "timing-function" property describes in text the function of changing the speed of the animation. Functions can be divided into 2 types: simple functions and functions with parameters.

Simple functions

Function Constant Description
"ease" EaseTiming the speed increases towards the middle and slows down at the end.
"ease-in" EaseInTiming the speed is slow at first, but increases in the end.
"ease-out" EaseOutTiming speed is fast at first, but decreases rapidly. Most of the slow
"ease-in-out" EaseInOutTiming the speed is fast at first, but quickly decreases, and at the end it increases again.
"linear" LinearTiming constant speed

And there are two functions with parameters:

  • "steps(N)" - discrete function, where N is an integer specifying the number of steps. You can specify this function either as text or using the function:

    func StepsTiming(stepCount int) string

For example

animation := rui.NewAnimationProperty(rui.Params{
	rui.TimingFunction: rui.StepsTiming(10),
})

equivalent to

animation := rui.NewAnimationProperty(rui.Params{
	rui.TimingFunction: "steps(10)",
})
  • "cubic-bezier(x1, y1, x2, y2)" - time function of a cubic Bezier curve. x1, y1, x2, y2 are of type float64. x1 and x2 must be in the range [0...1]. You can specify this function either as text or using the function:

    func CubicBezierTiming(x1, y1, x2, y2 float64) string

Transition animation

Transition animation can be applied to properties of the type: SizeUnit, Color, AngleUnit, float64 and composite properties that contain elements of the listed types (for example, "shadow", "border", etc.).

If you try to animate other types of properties (for example, bool, string), no error will occur, there will simply be no animation.

There are two types of transition animations:

  • single-fold;
  • constant;

A one-time animation is triggered using the SetAnimated function of the View interface. This function has the following description:

SetAnimated(tag string, value any, animation AnimationProperty) bool

It assigns a new value to the property, and the change occurs using the specified animation. For example,

view.SetAnimated(rui.Width, rui.Px(400), rui.NewAnimationProperty(rui.Params{
	rui.Duration:       0.75,
	rui.TimingFunction: rui.EaseOutTiming,
}))

There is also a global function for animated one-time change of the property value of the child View

func SetAnimated(rootView View, viewID, tag string, value any, animation AnimationProperty) bool

A persistent animation runs every time the property value changes. To set the constant animation of the transition, use the "transition" property (the Transition constant). As a value, this property is assigned rui.Params, where the property name should be the key, and the value should be the AnimationProperty interface. For example,

view.Set(rui.Transition, rui.Params{
	rui.Height: rui.NewAnimationProperty(rui.Params{
		rui.Duration:       0.75,
		rui.TimingFunction: rui.EaseOutTiming,
	},
	rui.BackgroundColor: rui.NewAnimationProperty(rui.Params{
		rui.Duration:       1.5,
		rui.Delay:          0.5,
		rui.TimingFunction: rui.Linear,
	},
})

Calling the SetAnimated function does not change the value of the "transition" property.

To get the current list of permanent transition animations, use the function

func GetTransition(view View, subviewID ...string) Params

It is recommended to add new transition animations using the function

func AddTransition(view View, subviewID, tag string, animation AnimationProperty) bool

Calling this function is equivalent to the following code

transitions := rui.GetTransition(view, subviewID)
transitions[tag] = animation
rui.Set(view, subviewID, rui.Transition, transitions)
Transition animation events

The transition animation generates the following events

Event Constant Description
"transition-run-event" TransitionRunEvent The transition animation loop has started, i.e. before the delay
"transition-start-event" TransitionStartEvent The transition animation has actually started, i.e. after delay
"transition-end-event" TransitionEndEvent Transition animation finished
"transition-cancel-event" TransitionCancelEvent Transition animation interrupted

The main event listener has the following format:

func(View, string)

where the second argument is the name of the property.

You can also use a listener in the following format:

func()
func(string)
func(View)

Get lists of listeners for transition animation events using functions:

func GetTransitionRunListeners(view View, subviewID ...string) []func(View, string)
func GetTransitionStartListeners(view View, subviewID ...string) []func(View, string)
func GetTransitionEndListeners(view View, subviewID ...string) []func(View, string)
func GetTransitionCancelListeners(view View, subviewID ...string) []func(View, string)
Animation script

An animation script describes a more complex animation than a transition animation. To do this, additional properties are added to AnimationProperty:

"property" property

The "property" property (constant PropertyTag) describes property changes. []AnimatedProperty or AnimatedProperty is assigned as a value. The AnimatedProperty structure describes the change script of one property. She is described as

type AnimatedProperty struct {
	Tag       string
	From, To  any
	KeyFrames map[int]any
}

where Tag is the name of the property, From is the initial value of the property, To is the final value of the property, KeyFrames is intermediate property values (keyframes).

The required fields are Tag, From, To. The KeyFrames field is optional, it can be nil.

The KeyFrames field describes key frames. As a key of type int, the percentage of time elapsed since the beginning of the animation is used (exactly the beginning of the animation itself, the time specified by the "delay" property is excluded). And the value is the value of the property at a given moment in time. For example

prop := rui.AnimatedProperty {
	Tag:       rui.Width,
	From:      rui.Px(100),
	To:        rui.Px(200),
	KeyFrames: map[int]interface{
		90: rui.Px(220),
	}
}

In this example, the "width" property will grow from 100px to 220px 90% of the time. In the remaining 10% of the time, it will decrease from 220px to 200px.

The "property" property is assigned to []AnimatedProperty, which means that you can animate several properties at once.

You must set at least one "property" element, otherwise the animation will be ignored.

"id" property

The "id" string property (constant ID) specifies the animation identifier. Passed as a parameter to the animation event listener. If you do not plan to use event listeners for animation, then you do not need to set this property.

"iteration-count" property

The "iteration-count" int property (constant IterationCount) specifies the number of animation repetitions. The default is 1. A value less than zero causes the animation to repeat indefinitely.

"animation-direction" property

The "animation-direction" int property (an AnimationDirection constant) specifies whether the animation should play forward, backward, or alternately forward and backward between forward and backward playback of the sequence. It can take the following values:

Value Constant Description
0 NormalAnimation The animation plays forward every iteration, that is, when the animation ends, it is immediately reset to its starting position and played again.
1 ReverseAnimation The animation plays backwards, from the last position to the first, and then resets to the final position and plays again.
2 AlternateAnimation The animation changes direction in each cycle, that is, in the first cycle, it starts from the start position, reaches the end position, and in the second cycle, it continues from the end position and reaches the start position, and so on.
3 AlternateReverseAnimation The animation starts playing from the end position and reaches the start position, and in the next cycle, continuing from the start position, it goes to the end position.
Animation start

To start the animation script, you must assign the interface created by AnimationProperty to the "animation" property (the Animation constant). If the View is already displayed on the screen, then the animation starts immediately (taking into account the specified delay), otherwise the animation starts as soon as the View is displayed on the screen.

The "animation" property can be assigned AnimationProperty and [] AnimationProperty, ie. you can run several animations at the same time for one View

Example,

prop := rui.AnimatedProperty {
	Tag:       rui.Width,
	From:      rui.Px(100),
	To:        rui.Px(200),
	KeyFrames: map[int]interface{
		90: rui.Px(220),
	}
}
animation := rui.NewAnimationProperty(rui.Params{
	rui.PropertyTag:    []rui.AnimatedProperty{prop},
	rui.Duration:       2,
	rui.TimingFunction: LinearTiming,
})
rui.Set(view, "subview", rui.Animation, animation)
"animation-paused" property

The "animation-paused" bool property of View (AnimationPaused constant) allows the animation to be paused. In order to pause the animation, set this property to "true", and to resume to "false".

Attention. When you assign a value to the "animation" property, the "animation-paused" property is set to false.

Animation events

The animation script generates the following events

Event Constant Description
"animation-start-event" AnimationStartEvent Animation started
"animation-end-event" AnimationEndEvent Animation finished
"animation-cancel-event" AnimationCancelEvent Animation interrupted
"animation-iteration-event" AnimationIterationEvent A new iteration of animation has begun

Attention! Not all browsers support the "animation-cancel-event" event. This is currently only Safari and Firefox.

The main event data listener has the following format:

func(View, string)

where the second argument is the id of the animation.

You can also use a listener in the following format:

func()
func(string)
func(View)

Get lists of animation event listeners using functions:

func GetAnimationStartListeners(view View, subviewID ...string) []func(View, string)
func GetAnimationEndListeners(view View, subviewID ...string) []func(View, string)
func GetAnimationCancelListeners(view View, subviewID ...string) []func(View, string)
func GetAnimationIterationListeners(view View, subviewID ...string) []func(View, string)

Session

When a client creates a connection to a server, a Session interface is created for that connection. This interface is used to interact with the client. You can get the current Session interface by calling the Session() method of the View interface.

When a session is created, it gets a custom implementation of the SessionContent interface.

type SessionContent interface {
	CreateRootView(session rui.Session) rui.View
}

This interface is created by the function passed as a parameter when creating an application by the NewApplication function.

In addition to the mandatory CreateRootView() function, SessionContent can have several optional functions:

OnStart(session rui.Session)
OnFinish(session rui.Session)
OnResume(session rui.Session)
OnPause(session rui.Session)
OnDisconnect(session rui.Session)
OnReconnect(session rui.Session)

Immediately after creating a session, the CreateRootView function is called. After creating the root View, the OnStart function is called (if implemented)

The OnFinish function (if implemented) is called when the user closes the application page in the browser

The OnPause function is called when the application page in the client's browser becomes inactive. This happens if the user switches to a different browser tab / window, minimizes the browser, or switches to another application.

The OnResume function is called when the application page in the client's browser becomes active. Also, this function is called immediately after OnStart

The OnDisconnect function is called if the server loses connection with the client. This happens either when the connection is broken.

The OnReconnect function is called after the server reconnects with the client.

The Session interface provides the following methods:

  • DarkTheme() bool returns true if a dark theme is used. Determined by client-side settings

  • TouchScreen() bool returns true if client supports touch screen

  • PixelRatio() float64 returns the size of a logical pixel, i.e. how many physical pixels form a logical. For example, for iPhone, this value will be 2 or 3

  • TextDirection() int returns the direction of the letter: LeftToRightDirection (1) or RightToLeftDirection (2)

  • Constant(tag string) (string, bool) returns the value of a constant

  • Color(tag string) (Color, bool) returns the value of the color constant

  • SetCustomTheme(name string) bool sets the theme with the given name as the current one. Returns false if no topic with this name was found. Themes named "" are the default theme.

  • Language() string returns the current interface language, for example: "en", "ru", "ptBr"

  • SetLanguage(lang string) sets the current interface language (see "Support for multiple languages")

  • GetString(tag string) (string, bool) returns a textual text value for the current language (see "Support for multiple languages")

  • Content() SessionContent returns the current SessionContent instance

  • RootView() View returns the root View of the session

  • SetTitle(title string) sets the text of the browser title/tab

  • SetTitleColor(color Color) sets the color of the browser navigation bar. Supported only in Safari and Chrome for android

  • Get(viewID, tag string) any returns the value of the View property named tag. Equivalent to

    rui.Get(session.RootView(), viewID, tag)

  • Set(viewID, tag string, value interface {}) bool sets the value of the View property named tag.

    rui.Set(session.RootView(), viewID, tag, value)

  • DownloadFile(path string) downloads (saves) on the client side the file located at the specified path on the server. It is used when the client needs to transfer a file from the server.

  • DownloadFileData(filename string, data [] byte) downloads (saves) on the client side a file with a specified name and specified content. Typically used to transfer a file generated in server memory.

  • SetHotKey(keyCode KeyCode, controlKeys ControlKeyMask, fn func(Session)) - sets the function that will be called when the given hotkey is pressed.

Resource description format

Application resources (themes, views, translations) can be described as text (utf-8). This text is placed in a file with the ".rui" extension.

The root element of the resource file must be an object. It has the following format:

< object name > {
	< object data >
}

if the object name contains the following characters: '=', '{', '}', '[', ']', ',', '', '\t', '\n', '' ',' "','` ',' / 'and any spaces, then the object name must be enclosed in quotation marks. If these characters are not used, then quotation marks are optional.

You can use three types of quotation marks:

  • "…" is equivalent to the same string in the go language, i.e. inside you can use escape sequences: \n, \r, \, ", ', \0, \t, \x00, \u0000

  • '…' is similar to the line "…"

  • is equivalent to the same string in the go language, i.e. the text within this line remains as is. Inside you cannot use the ` character.

Object data is a set of < key > = < value > pairs separated by commas.

The key is a string of text. The design rules are the same as for the object name.

Values can be of 3 types:

  • Simple value - a line of text formatted according to the same rules as the name of the object

  • An object

  • Array of values

An array of values is enclosed in square brackets. Array elements are separated by commas. Elements can be simple values or objects.

There may be comments in the text. The design rules are the same as in the go language: // and / * ... * /

Example:

GridLayout {
	id = gridLayout, width = 100%, height = 100%,
	cell-width = "150px, 1fr, 30%", cell-height = "25%, 200px, 1fr",
	content = [
		// Subviews
		TextView { row = 0, column = 0:1,
			text = "View 1", text-align = center, vertical-align = center,
			background-color = #DDFF0000, radius = 8px, padding = 32px,
			border = _{ style = solid, width = 1px, color = #FFA0A0A0 }
		},
		TextView { row = 0:1, column = 2,
			text = "View 2", text-align = center, vertical-align = center,
			background-color = #DD00FF00, radius = 8px, padding = 32px,
			border = _{ style = solid, width = 1px, color = #FFA0A0A0 }
		},
		TextView { row = 1:2, column = 0,
			text = "View 3", text-align = center, vertical-align = center,
			background-color = #DD0000FF, radius = 8px, padding = 32px,
			border = _{ style = solid, width = 1px, color = #FFA0A0A0 }
		},
		TextView { row = 1, column = 1,
			text = "View 4", text-align = center, vertical-align = center,
			background-color = #DDFF00FF, radius = 8px, padding = 32px,
			border = _{ style = solid, width = 1px, color = #FFA0A0A0 }
		},
		TextView { row = 2, column = 1:2,
			text = "View 5", text-align = center, vertical-align = center,
			background-color = #DD00FFFF, radius = 8px, padding = 32px,
			border = _{ style = solid, width = 1px, color = #FFA0A0A0 }
		},
	]
}

To work with text resources, the DataNode interface is used

type DataNode interface {
	Tag() string
	Type() int
	Text() string
	Object() DataObject
	ArraySize() int
	ArrayElement(index int) DataValue
	ArrayElements() []DataValue
}

This element describes the underlying data element.

The Tag method returns the value of the key.

The data type is returned by the Type method. It returns one of 3 values

Value Constant Data type
0 TextNode Simple value
1 ObjectNode Object
2 ArrayNode Array

The Text() method is used to get a simple value. To get an object, use the Object() method. To get the elements of an array, use the ArraySize, ArrayElement and ArrayElements methods

Resources

Resources (pictures, themes, translations, etc.) with which the application works should be placed in subdirectories within one resource directory. Resources should be located in the following subdirectories:

  • images - all images are placed in this subdirectory. Here you can make nested subdirectories. In this case, they must be included in the file name. For example, "subdir/image1.png"

  • themes - application themes are placed in this subdirectory (see below)

  • views - View descriptions are placed in this subdirectory

  • strings - translations of text resources are placed in this subdirectory (see Support for multiple languages)

  • raw - all other resources are placed in this subdirectory: sounds, video, binary data, etc.

The resource directory can either be included in the executable file or located separately.

If the resources need to be included in the executable file, then the name of the directory must be "resources" and it must be connected as follows:

import (
	"embed"

	"github.com/anoshenko/rui"
)

//go:embed resources
var resources embed.FS

func main() {
	rui.AddEmbedResources(&resources)
	
	app := rui.NewApplication("Hello world", createHelloWorldSession)
	app.Start("localhost:8000")
}

If the resources are supplied as a separate directory, then it must be registered using the SetResourcePath function before creating the Application:

func main() {
	rui.SetResourcePath(path)
	
	app := rui.NewApplication("Hello world", createHelloWorldSession)
	app.Start("localhost:8000")
}

Images for screens with different pixel densities

If you need to add separate images to the resources for screens with different pixel densities, then this is done in the style of iOS, i.e. '@< density >x' is appended to the filename. For example

image@2x.png
image@3x.jpg
image@1.5x.gif

For example, you have images for three densities: image.png, image@2x.png, and image@3x.png. In this case, you only assign the value "image.png" to the "src" field of the ImageView. The library itself will find the rest in the "images" directory and transfer the image to the client with the required density

Themes

The topic includes three types of data:

  • constants
  • color constants
  • View styles

Themes are designed as a rui file and placed in the themes folder.

The root of the theme is an object named 'theme'. This object can contain the following properties:

  • name - an optional text property that specifies the name of the theme. If this property is not set or is equal to an empty string, then this is the default theme.

  • constants - property object defining constants. The name of the object can be anything. It is recommended to use "_". An object can have any number of text properties specifying the "constant name" = "value" pair. This section contains constants of type SizeUnit, AngleUnit, text and numeric. In order to assign a constant to any View property, you need to assign the name of the constant to the property by adding the '@' symbol at the beginning. For example

    theme { constants = _{ defaultPadding = 4px, buttonPadding = @defaultPadding, angle = 30deg, } }

    rui.Set(view, "subView", rui.Padding, "@defaultPadding")

  • constants:touch is property object defining constants used only for touch screen. For example, how to make indents larger on a touch screen:

    theme { constants = _{ defaultPadding = 4px, }, constants:touch = _{ defaultPadding = 12px, }, }

  • colors is an object property that defines color constants for a light skin (default theme). An object can have any number of text properties specifying the "color name" = "color" pair. Similar to constants, when assigning, you must add '@' at the beginning of the color name. For example

    theme { colors = _{ textColor = #FF101010, borderColor = @textColor, backgroundColor = white, } }

    rui.Set(view, "subView", rui.TextColor, "@textColor")

Color names such as "black", "white", "red", etc. are used without the '@' character. However, you can specify color constants with the same names. For example

theme {
	colors = _{
		red = blue,
	}
}

rui.Set(view, "subView", rui.TextColor, "@red") // blue text
rui.Set(view, "subView", rui.TextColor, "red")  // red text
  • colors:dark is an object property that defines color constants for a dark theme

  • styles is an array of common styles. Each element of the array must be an object. The object name is and is the name of the style. For example,

    theme { styles = [ demoPage { width = 100%, height = 100%, cell-width = "1fr, auto", }, demoPanel { width = 100%, height = 100%, orientation = start-to-end, }, ] }

To use styles, the View has two text properties "style" (Style constant) and "style-disabled" (StyleDisabled constant). The "style" property is assigned the property name that is applied to the View when the "disabled" property is set to false. The "style-disabled" property is assigned the property name that is applied to the View when the "disabled" property is set to true. If "style-disabled" is not specified, then the "style" property is used in both modes.

Attention! The '@' symbol should NOT be added to the style name. If you add the '@' symbol to the name, then the style name will be extracted from the constant of the same name. For example

theme {
	constants = _{
		@demoPanel = demoPage
	},
	styles = [
		demoPage {
			width = 100%,
			height = 100%,
			cell-width = "1fr, auto",
		},
		demoPanel {
			width = 100%,
			height = 100%,
			orientation = start-to-end,
		},
	]
}

rui.Set(view, "subView", rui.Style, "demoPanel")   // style == demoPanel
rui.Set(view, "subView", rui.Style, "@demoPanel")  // style == demoPage

In addition to general styles, you can add styles for specific work modes. To do this, the following modifiers are added to the name "styles":

  • ":portrait" or ":landscape" are respectively styles for portrait or landscape mode of the program. Attention means the aspect ratio of the program window, not the screen.

  • ":width-" - styles for a screen whose width is in the range specified in logical pixels.

  • ":width" - styles for a screen whose width does not exceed the specified value in logical pixels.

  • ":width-" - styles for a screen whose width is greater than the specified value in logical pixels.

  • ":height-" - styles for a screen whose height is in the range specified in logical pixels.

  • ":height" - styles for a screen whose height does not exceed the specified value in logical pixels.

  • ":height-" - styles for a screen whose height is greater than the specified value in logical pixels.

For example

theme {
	styles = [
		demoPage {
			width = 100%,
			height = 100%,
			cell-width = "1fr, auto",
		},
		demoPage2 {
			row = 0,
			column = 1,
		}
	],
	styles:landscape = [
		demoPage {
			width = 100%,
			height = 100%,
			cell-height = "1fr, auto",
		},
		demoPage2 {
			row = 1,
			column = 0,
		}
	],
	styles:portrait:width320 = [
		samplePage {
			width = 100%,
			height = 50%,
		},
	],
	styles:portrait:width320-640 = [
		samplePage {
			width = 90%,
			height = 60%,
		},
	],
	styles:portrait:width640- = [
		samplePage {
			width = 80%,
			height = 70%,
		},
	],
}

Standard constants and styles

The library defines a number of constants and styles. You can override them in your themes.

System styles that you can override:

Style name Описание
ruiApp This style is used to set the default text style (font, size, etc.)
ruiView Default View Style
ruiArticle The style to use if the "semantics" property is set to "article"
ruiSection The style used if the "semantics" property is set to "section"
ruiAside The style used if the "semantics" property is set to "aside"
ruiHeader The style used if the "semantics" property is set to "header"
ruiMain The style used if the "semantics" property is set to "main"
ruiFooter Style used if the "semantics" property is set to "footer"
ruiNavigation Style used if property "semantics" is set to "navigation"
ruiFigure Style used if property "semantics" is set to "figure"
ruiFigureCaption Style used if property "semantics" is set to "figure-caption"
ruiButton Style used if property "semantics" is set to "button"
ruiParagraph The style used if the "semantics" property is set to "paragraph"
ruiH1 Style used if property "semantics" is set to "h1"
ruiH2 Style used if property "semantics" is set to "h2"
ruiH3 Style used if property "semantics" is set to "h3"
ruiH4 Style used if property "semantics" is set to "h4"
ruiH5 Style used if property "semantics" is set to "h5"
ruiH6 Style used if property "semantics" is set to "h6"
ruiBlockquote Style used if the "semantics" property is set to "blockquote"
ruiCode Style used if property "semantics" is set to "code"
ruiTable Default TableView style
ruiTableHead Default TableView header style
ruiTableFoot Default TableView footer style
ruiTableRow Default TableView row style
ruiTableColumn Default TableView column style
ruiTableCell Default TableView cell style
ruiDisabledButton Button style if property "disabled" is set to true
ruiCheckbox Checkbox style
ruiListItem ListView item style
ruiListItemSelected Style the selected ListView item when the ListView does not have focus
ruiListItemFocused Style the selected ListView item when the ListView has focus
ruiPopup Popup style
ruiPopupTitle Popup title style
ruiMessageText Popup text style (Message, Question)
ruiPopupMenuItem Popup menu item style

System color constants that you can override:

Color constant name Description
ruiBackgroundColor Background color
ruiTextColor Text color
ruiDisabledTextColor Banned text color
ruiHighlightColor Backlight color
ruiHighlightTextColor Highlighted text color
ruiButtonColor Button color
ruiButtonActiveColor Focus button color
ruiButtonTextColor Button text color
ruiButtonDisabledColor Denied button color
ruiButtonDisabledTextColor Disabled button text color
ruiSelectedColor Background color of inactive selected ListView item
ruiSelectedTextColor Text color of inactive selected ListView item
ruiPopupBackgroundColor Popup background color
ruiPopupTextColor Popup text color
ruiPopupTitleColor Popup title background color
ruiPopupTitleTextColor Popup Title Text Color
ruiTooltipBackground Tooltip background color
ruiTooltipTextColor Tooltip text color
ruiTooltipShadowColor Tooltip shadow color

Constants that you can override:

Constant name Description
ruiButtonHorizontalPadding Horizontal padding inside the button
ruiButtonVerticalPadding Vertical padding inside the button
ruiButtonMargin External button access
ruiButtonRadius Button corner radius
ruiButtonHighlightDilation Width of the outer border of the active button
ruiButtonHighlightBlur Blur the active button frame
ruiCheckboxGap Break between checkbox and content
ruiListItemHorizontalPadding Horizontal padding inside a ListView item
ruiListItemVerticalPadding Vertical padding inside a ListView item
ruiPopupTitleHeight Popup title height
ruiPopupTitlePadding Popup title padding
ruiPopupButtonGap Break between popup buttons

Multi-language support

If you want to add support for several languages to the program, you need to place the translation files in the "strings" folder of the resources. Translation files must have the "rui" extension and the following format

strings {
	<language 1> = _{
		<text 1> = <translation 1>,
		<text 2> = <translation 2>,
		…
	},
	<язык 2> = _{
		<text 1> = <translation 1>,
		<text 2> = <translation 2>,
		…
	},
	…
}

If the translation for each language is placed in a separate file, then the following format can be used

strings:<language> {
	<text 1> = <translation 1>,
	<text 2> = <translation 2>,
	…
}

For example, if all translations are in one file strings.rui

strings {
	ru = _{
		"Yes" = "Да",
		"No" = "Нет",
	},
	de = _{
		"Yes" = "Ja",
		"No" = "Nein",
	},
}

If in different. ru.rui file:

strings:ru {
	"Yes" = "Да",
	"No" = "Нет",
}

de.rui file:

strings:de {
	"Yes" = "Ja",
	"No" = "Nein",
}

The translation can also be split into multiple files.

Translations are automatically inserted in all Views.

However, if you are drawing text in a CanvasView, then you must request the translation yourself. To do this, there is a method in the Session interface:

GetString(tag string) (string, bool)

If there is no translation of the given string, then the method will return the original string and false as the second parameter.

You can get the current language using the Language() method of the Session interface. The current language is determined by the user's browser settings. You can change the session language using the SetLanguage(lang string) method of the Session interface.

Documentation

Index

Constants

View Source
const (
	// Animation is the constant for "animation" property tag.
	//
	// Used by View.
	// Sets and starts animations.
	//
	// Supported types: AnimationProperty, []AnimationProperty.
	//
	// Internal type is []AnimationProperty, other types converted to it during assignment.
	// See AnimationProperty description for more details.
	Animation PropertyName = "animation"

	// AnimationPaused is the constant for "animation-paused" property tag.
	//
	// Used by AnimationProperty.
	// Controls whether the animation is running or paused.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Animation is paused.
	//   - false, 0, "false", "no", "off", or "0" - Animation is playing.
	AnimationPaused PropertyName = "animation-paused"

	// Transition is the constant for "transition" property tag.
	//
	// Used by View.
	//
	// Sets transition animation of view properties. Each provided property must contain AnimationProperty which describe how
	// particular property will be animated on property value change. Transition animation can be applied to properties of the
	// type SizeUnit, Color, AngleUnit, float64 and composite properties that contain elements of the listed types(for
	// example, "shadow", "border", etc.). If we'll try to animate other properties with internal type like bool or
	// string no error will occur, simply there will be no animation.
	//
	// Supported types: Params.
	//
	// See Params description for more details.
	Transition PropertyName = "transition"

	// PropertyTag is the constant for "property" property tag.
	//
	// Used by AnimationProperty.
	//
	// Describes a scenario for changing a View's property. Used only for animation script.
	//
	// Supported types: []AnimatedProperty, AnimatedProperty.
	//
	// Internal type is []AnimatedProperty, other types converted to it during assignment.
	// See AnimatedProperty description for more details.
	PropertyTag PropertyName = "property"

	// Duration is the constant for "duration" property tag.
	//
	// Used by AnimationProperty.
	//
	// Sets the length of time in seconds that an animation takes to complete one cycle.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Duration PropertyName = "duration"

	// Delay is the constant for "delay" property tag.
	//
	// Used by AnimationProperty.
	//
	// Specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform
	// the animation. The animation can start later, immediately from its beginning or immediately and partway through the
	// animation.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Delay PropertyName = "delay"

	// TimingFunction is the constant for "timing-function" property tag.
	//
	// Used by AnimationProperty.
	//
	// Set how an animation progresses through the duration of each cycle.
	//
	// Supported types: string.
	//
	// Values:
	//   - "ease" (EaseTiming) - Speed increases towards the middle and slows down at the end.
	//   - "ease-in" (EaseInTiming) - Speed is slow at first, but increases in the end.
	//   - "ease-out" (EaseOutTiming) - Speed is fast at first, but decreases in the end.
	//   - "ease-in-out" (EaseInOutTiming) - Speed is slow at first, but quickly increases and at the end it decreases again.
	//   - "linear" (LinearTiming) - Constant speed.
	//   - "step(n)" (StepTiming(n int) function) - Timing function along stepCount stops along the transition, displaying each stop for equal lengths of time.
	//   - "cubic-bezier(x1, y1, x2, y2)" (CubicBezierTiming(x1, y1, x2, y2 float64) function) - Cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].
	TimingFunction PropertyName = "timing-function"

	// IterationCount is the constant for "iteration-count" property tag.
	//
	// Used by AnimationProperty.
	//
	// Sets the number of times an animation sequence should be played before stopping. Used only for animation script.
	//
	// Supported types: int, string.
	//
	// Internal type is int, other types converted to it during assignment.
	IterationCount PropertyName = "iteration-count"

	// AnimationDirection is the constant for "animation-direction" property tag.
	//
	// Used by AnimationProperty.
	//
	// Whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward
	// and backward. Used only for animation script.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NormalAnimation) or "normal" - The animation plays forward every iteration, that is, when the animation ends, it is immediately reset to its starting position and played again.
	//   - 1 (ReverseAnimation) or "reverse" - The animation plays backwards, from the last position to the first, and then resets to the final position and plays again.
	//   - 2 (AlternateAnimation) or "alternate" - The animation changes direction in each cycle, that is, in the first cycle, it starts from the start position, reaches the end position, and in the second cycle, it continues from the end position and reaches the start position, and so on.
	//   - 3 (AlternateReverseAnimation) or "alternate-reverse" - The animation starts playing from the end position and reaches the start position, and in the next cycle, continuing from the start position, it goes to the end position.
	AnimationDirection PropertyName = "animation-direction"

	// NormalAnimation is value of the "animation-direction" property.
	//
	// The animation plays forwards each cycle. In other words, each time the animation cycles,
	// the animation will reset to the beginning state and start over again. This is the default value.
	NormalAnimation = 0

	// ReverseAnimation is value of the "animation-direction" property.
	//
	// The animation plays backwards each cycle. In other words, each time the animation cycles,
	// the animation will reset to the end state and start over again. Animation steps are performed
	// backwards, and timing functions are also reversed.
	//
	// For example, an "ease-in" timing function becomes "ease-out".
	ReverseAnimation = 1

	// AlternateAnimation is value of the "animation-direction" property.
	//
	// The animation reverses direction each cycle, with the first iteration being played forwards.
	// The count to determine if a cycle is even or odd starts at one.
	AlternateAnimation = 2

	// AlternateReverseAnimation is value of the "animation-direction" property.
	//
	// The animation reverses direction each cycle, with the first iteration being played backwards.
	// The count to determine if a cycle is even or odd starts at one.
	AlternateReverseAnimation = 3

	// EaseTiming - a timing function which increases in velocity towards the middle of the transition, slowing back down at the end
	EaseTiming = "ease"

	// EaseInTiming - a timing function which starts off slowly, with the transition speed increasing until complete
	EaseInTiming = "ease-in"

	// EaseOutTiming - a timing function which starts transitioning quickly, slowing down the transition continues.
	EaseOutTiming = "ease-out"

	// EaseInOutTiming - a timing function which starts transitioning slowly, speeds up, and then slows down again.
	EaseInOutTiming = "ease-in-out"

	// LinearTiming - a timing function at an even speed
	LinearTiming = "linear"
)

Constants which related to view's animation

View Source
const (
	// BorderBox is the value of the following properties:
	//   - BackgroundClip - The background extends to the outside edge of the border (but underneath the border in z-ordering).
	//   - BackgroundOrigin - The background is positioned relative to the border box.
	//   - MaskClip - The painted content is clipped to the border box.
	//   - MaskOrigin - The mask is positioned relative to the border box.
	BorderBox = 0

	// PaddingBox is value of the BackgroundClip and MaskClip property:
	//   - BackgroundClip - The background extends to the outside edge of the padding. No background is drawn beneath the border.
	//   - BackgroundOrigin - The background is positioned relative to the padding box.
	//   - MaskClip - The painted content is clipped to the padding box.
	//   - MaskOrigin - The mask is positioned relative to the padding box.
	PaddingBox = 1

	// ContentBox is value of the BackgroundClip and MaskClip property:
	//   - BackgroundClip - The background is painted within (clipped to) the content box.
	//   - BackgroundOrigin - The background is positioned relative to the content box.
	//   - MaskClip - The painted content is clipped to the content box.
	//   - MaskOrigin - The mask is positioned relative to the content box.
	ContentBox = 2
)
View Source
const (
	// NoRepeat is value of the Repeat property of an background image:
	//
	// The image is not repeated (and hence the background image painting area
	// will not necessarily be entirely covered). The position of the non-repeated
	// background image is defined by the background-position CSS property.
	NoRepeat = 0

	// RepeatXY is value of the Repeat property of an background image:
	//
	// The image is repeated as much as needed to cover the whole background
	// image painting area. The last image will be clipped if it doesn't fit.
	RepeatXY = 1

	// RepeatX is value of the Repeat property of an background image:
	//
	// The image is repeated horizontally as much as needed to cover
	// the whole width background image painting area. The image is not repeated vertically.
	// The last image will be clipped if it doesn't fit.
	RepeatX = 2

	// RepeatY is value of the Repeat property of an background image:
	//
	// The image is repeated vertically as much as needed to cover
	// the whole height background image painting area. The image is not repeated horizontally.
	// The last image will be clipped if it doesn't fit.
	RepeatY = 3

	// RepeatRound is value of the Repeat property of an background image:
	//
	// As the allowed space increases in size, the repeated images will stretch (leaving no gaps)
	// until there is room (space left >= half of the image width) for another one to be added.
	// When the next image is added, all of the current ones compress to allow room.
	RepeatRound = 4

	// RepeatSpace is value of the Repeat property of an background image:
	//
	// The image is repeated as much as possible without clipping. The first and last images
	// are pinned to either side of the element, and whitespace is distributed evenly between the images.
	RepeatSpace = 5

	// ScrollAttachment is value of the Attachment property of an background image:
	//
	// The background is fixed relative to the element itself and does not scroll with its contents.
	// (It is effectively attached to the element's border.)
	ScrollAttachment = 0

	// FixedAttachment is value of the Attachment property of an background image:
	//
	// The background is fixed relative to the viewport. Even if an element has
	// a scrolling mechanism, the background doesn't move with the element.
	FixedAttachment = 1

	// LocalAttachment is value of the Attachment property of an background image:
	//
	// The background is fixed relative to the element's contents. If the element has a scrolling mechanism,
	// the background scrolls with the element's contents, and the background painting area
	// and background positioning area are relative to the scrollable area of the element
	// rather than to the border framing them.
	LocalAttachment = 2
)

Constants related to view's background description

View Source
const (
	// NoneLine constant specifies that there is no border
	NoneLine = 0

	// SolidLine constant specifies the border/line as a solid line
	SolidLine = 1

	// DashedLine constant specifies the border/line as a dashed line
	DashedLine = 2

	// DottedLine constant specifies the border/line as a dotted line
	DottedLine = 3

	// DoubleLine constant specifies the border/line as a double solid line
	DoubleLine = 4

	// DoubleLine constant specifies the border/line as a double solid line
	WavyLine = 5

	// LeftStyle is the constant for "left-style" property tag.
	//
	// Used by BorderProperty.
	// Left border line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//  - 0 (NoneLine) or "none" - The border will not be drawn.
	//  - 1 (SolidLine) or "solid" - Solid line as a border.
	//  - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//  - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//  - 4 (DoubleLine) or "double" - Double line as a border.
	LeftStyle PropertyName = "left-style"

	// RightStyle is the constant for "right-style" property tag.
	//
	// Used by BorderProperty.
	// Right border line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//  - 0 (NoneLine) or "none" - The border will not be drawn.
	//  - 1 (SolidLine) or "solid" - Solid line as a border.
	//  - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//  - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//  - 4 (DoubleLine) or "double" - Double line as a border.
	RightStyle PropertyName = "right-style"

	// TopStyle is the constant for "top-style" property tag.
	//
	// Used by BorderProperty.
	// Top border line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//  - 0 (NoneLine) or "none" - The border will not be drawn.
	//  - 1 (SolidLine) or "solid" - Solid line as a border.
	//  - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//  - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//  - 4 (DoubleLine) or "double" - Double line as a border.
	TopStyle PropertyName = "top-style"

	// BottomStyle is the constant for "bottom-style" property tag.
	//
	// Used by BorderProperty.
	// Bottom border line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//  - 0 (NoneLine) or "none" - The border will not be drawn.
	//  - 1 (SolidLine) or "solid" - Solid line as a border.
	//  - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//  - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//  - 4 (DoubleLine) or "double" - Double line as a border.
	BottomStyle PropertyName = "bottom-style"

	// LeftWidth is the constant for "left-width" property tag.
	//
	// Used by BorderProperty.
	// Left border line width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	LeftWidth PropertyName = "left-width"

	// RightWidth is the constant for "right-width" property tag.
	//
	// Used by BorderProperty.
	// Right border line width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	RightWidth PropertyName = "right-width"

	// TopWidth is the constant for "top-width" property tag.
	//
	// Used by BorderProperty.
	// Top border line width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	TopWidth PropertyName = "top-width"

	// BottomWidth is the constant for "bottom-width" property tag.
	//
	// Used by BorderProperty.
	// Bottom border line width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BottomWidth PropertyName = "bottom-width"

	// LeftColor is the constant for "left-color" property tag.
	//
	// Used by BorderProperty.
	// Left border line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	LeftColor PropertyName = "left-color"

	// RightColor is the constant for "right-color" property tag.
	//
	// Used by BorderProperty.
	// Right border line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	RightColor PropertyName = "right-color"

	// TopColor is the constant for "top-color" property tag.
	//
	// Used by BorderProperty.
	// Top border line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	TopColor PropertyName = "top-color"

	// BottomColor is the constant for "bottom-color" property tag.
	//
	// Used by BorderProperty.
	// Bottom border line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BottomColor PropertyName = "bottom-color"
)

Constants related to view's border description

View Source
const (
	// MiterJoin - Connected segments are joined by extending their outside edges
	// to connect at a single point, with the effect of filling an additional
	// lozenge-shaped area. This setting is affected by the miterLimit property
	MiterJoin LineJoin = 0

	// RoundJoin - rounds off the corners of a shape by filling an additional sector
	// of disc centered at the common endpoint of connected segments.
	// The radius for these rounded corners is equal to the line width.
	RoundJoin LineJoin = 1

	// BevelJoin - Fills an additional triangular area between the common endpoint
	// of connected segments, and the separate outside rectangular corners of each segment.
	BevelJoin LineJoin = 2

	// ButtCap - the ends of lines are squared off at the endpoints. Default value.
	ButtCap LineCap = 0

	// RoundCap - the ends of lines are rounded.
	RoundCap LineCap = 1

	// SquareCap - the ends of lines are squared off by adding a box with an equal width
	// and half the height of the line's thickness.
	SquareCap LineCap = 2

	// AlphabeticBaseline - the text baseline is the normal alphabetic baseline. Default value.
	AlphabeticBaseline = 0

	// TopBaseline - the text baseline is the top of the em square.
	TopBaseline = 1

	// MiddleBaseline - the text baseline is the middle of the em square.
	MiddleBaseline = 2

	// BottomBaseline - the text baseline is the bottom of the bounding box.
	// This differs from the ideographic baseline in that the ideographic baseline doesn't consider descenders.
	BottomBaseline = 3

	// HangingBaseline - the text baseline is the hanging baseline. (Used by Tibetan and other Indic scripts.)
	HangingBaseline = 4

	// IdeographicBaseline - the text baseline is the ideographic baseline; this is
	// the bottom of the body of the characters, if the main body of characters protrudes
	// beneath the alphabetic baseline. (Used by Chinese, Japanese, and Korean scripts.)
	IdeographicBaseline = 5

	// StartAlign - the text is aligned at the normal start of the line (left-aligned
	// for left-to-right locales, right-aligned for right-to-left locales).
	StartAlign = 3

	// EndAlign - the text is aligned at the normal end of the line (right-aligned
	// for left-to-right locales, left-aligned for right-to-left locales).
	EndAlign = 4
)

Constants related to canvas view operations

View Source
const (
	// TextNode - node is the pair "tag - text value". Syntax: <tag> = <text>
	TextNode = 0
	// ObjectNode - node is the pair "tag - object". Syntax: <tag> = <object name>{...}
	ObjectNode = 1
	// ArrayNode - node is the pair "tag - object". Syntax: <tag> = [...]
	ArrayNode = 2
)

Constants which are used to describe a node type, see DataNode

View Source
const (
	// SingleLineText - single-line text type of EditView
	SingleLineText = 0

	// PasswordText - password type of EditView
	PasswordText = 1

	// EmailText - e-mail type of EditView. Allows to enter one email
	EmailText = 2

	// EmailsText - e-mail type of EditView. Allows to enter multiple emails separated by comma
	EmailsText = 3

	// URLText - url type of EditView. Allows to enter one url
	URLText = 4

	// PhoneText - telephone type of EditView. Allows to enter one phone number
	PhoneText = 5

	// MultiLineText - multi-line text type of EditView
	MultiLineText = 6
)

Constants for the values of an EditView "edit-view-type" property

View Source
const (
	// ImageLoading is the image loading status: in the process of loading
	ImageLoading = 0
	// ImageReady is the image loading status: the image is loaded successfully
	ImageReady = 1
	// ImageLoadingError is the image loading status: an error occurred while loading
	ImageLoadingError = 2
)

Constants which represent return values of the LoadingStatus function of an Image view

View Source
const (
	// LoadedEvent is the constant for "loaded-event" property tag.
	//
	// Used by ImageView.
	// Occur when the image has been loaded.
	//
	// General listener format:
	//  func(image rui.ImageView)
	//
	// where:
	// image - Interface of an image view which generated this event.
	//
	// Allowed listener formats:
	//  func()
	LoadedEvent PropertyName = "loaded-event"

	// ErrorEvent is the constant for "error-event" property tag.
	//
	// Used by ImageView.
	// Occur when the image loading has been failed.
	//
	// General listener format:
	//  func(image rui.ImageView)
	//
	// where:
	// image - Interface of an image view which generated this event.
	//
	// Allowed listener formats:
	//  func()
	ErrorEvent PropertyName = "error-event"

	// NoneFit - value of the "object-fit" property of an ImageView. The replaced content is not resized
	NoneFit = 0

	// ContainFit - value of the "object-fit" property of an ImageView. The replaced content
	// is scaled to maintain its aspect ratio while fitting within the element’s content box.
	// The entire object is made to fill the box, while preserving its aspect ratio, so the object
	// will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
	ContainFit = 1

	// CoverFit - value of the "object-fit" property of an ImageView. The replaced content
	// is sized to maintain its aspect ratio while filling the element’s entire content box.
	// If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
	CoverFit = 2

	// FillFit - value of the "object-fit" property of an ImageView. The replaced content is sized
	// to fill the element’s content box. The entire object will completely fill the box.
	// If the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit.
	FillFit = 3

	// ScaleDownFit - value of the "object-fit" property of an ImageView. The content is sized as
	// if NoneFit or ContainFit were specified, whichever would result in a smaller concrete object size.
	ScaleDownFit = 4
)

Constants which represent ImageView specific properties and events

View Source
const (
	// AltKey is the mask of the "alt" key
	AltKey ControlKeyMask = 1
	// CtrlKey is the mask of the "ctrl" key
	CtrlKey ControlKeyMask = 2
	// ShiftKey is the mask of the "shift" key
	ShiftKey ControlKeyMask = 4
	// MetaKey is the mask of the "meta" key
	MetaKey ControlKeyMask = 8

	// KeyA represent "A" key on the keyboard
	KeyA KeyCode = "KeyA"

	// KeyB represent "B" key on the keyboard
	KeyB KeyCode = "KeyB"

	// KeyC represent "C" key on the keyboard
	KeyC KeyCode = "KeyC"

	// KeyD represent "D" key on the keyboard
	KeyD KeyCode = "KeyD"

	// KeyE represent "E" key on the keyboard
	KeyE KeyCode = "KeyE"

	// KeyF represent "F" key on the keyboard
	KeyF KeyCode = "KeyF"

	// KeyG represent "G" key on the keyboard
	KeyG KeyCode = "KeyG"

	// KeyH represent "H" key on the keyboard
	KeyH KeyCode = "KeyH"

	// KeyI represent "I" key on the keyboard
	KeyI KeyCode = "KeyI"

	// KeyJ represent "J" key on the keyboard
	KeyJ KeyCode = "KeyJ"

	// KeyK represent "K" key on the keyboard
	KeyK KeyCode = "KeyK"

	// KeyL represent "L" key on the keyboard
	KeyL KeyCode = "KeyL"

	// KeyM represent "M" key on the keyboard
	KeyM KeyCode = "KeyM"

	// KeyN represent "N" key on the keyboard
	KeyN KeyCode = "KeyN"

	// KeyO represent "O" key on the keyboard
	KeyO KeyCode = "KeyO"

	// KeyP represent "P" key on the keyboard
	KeyP KeyCode = "KeyP"

	// KeyQ represent "Q" key on the keyboard
	KeyQ KeyCode = "KeyQ"

	// KeyR represent "R" key on the keyboard
	KeyR KeyCode = "KeyR"

	// KeyS represent "S" key on the keyboard
	KeyS KeyCode = "KeyS"

	// KeyT represent "T" key on the keyboard
	KeyT KeyCode = "KeyT"

	// KeyU represent "U" key on the keyboard
	KeyU KeyCode = "KeyU"

	// KeyV represent "V" key on the keyboard
	KeyV KeyCode = "KeyV"

	// KeyW represent "W" key on the keyboard
	KeyW KeyCode = "KeyW"

	// KeyX represent "X" key on the keyboard
	KeyX KeyCode = "KeyX"

	// KeyY represent "Y" key on the keyboard
	KeyY KeyCode = "KeyY"

	// KeyZ represent "Z" key on the keyboard
	KeyZ KeyCode = "KeyZ"

	// Digit0Key represent "Digit0" key on the keyboard
	Digit0Key KeyCode = "Digit0"

	// Digit1Key represent "Digit1" key on the keyboard
	Digit1Key KeyCode = "Digit1"

	// Digit2Key represent "Digit2" key on the keyboard
	Digit2Key KeyCode = "Digit2"

	// Digit3Key represent "Digit3" key on the keyboard
	Digit3Key KeyCode = "Digit3"

	// Digit4Key represent "Digit4" key on the keyboard
	Digit4Key KeyCode = "Digit4"

	// Digit5Key represent "Digit5" key on the keyboard
	Digit5Key KeyCode = "Digit5"

	// Digit6Key represent "Digit6" key on the keyboard
	Digit6Key KeyCode = "Digit6"

	// Digit7Key represent "Digit7" key on the keyboard
	Digit7Key KeyCode = "Digit7"

	// Digit8Key represent "Digit8" key on the keyboard
	Digit8Key KeyCode = "Digit8"

	// Digit9Key represent "Digit9" key on the keyboard
	Digit9Key KeyCode = "Digit9"

	// SpaceKey represent "Space" key on the keyboard
	SpaceKey KeyCode = "Space"

	// MinusKey represent "Minus" key on the keyboard
	MinusKey KeyCode = "Minus"

	// EqualKey represent "Equal" key on the keyboard
	EqualKey KeyCode = "Equal"

	// IntlBackslashKey represent "IntlBackslash" key on the keyboard
	IntlBackslashKey KeyCode = "IntlBackslash"

	// BracketLeftKey represent "BracketLeft" key on the keyboard
	BracketLeftKey KeyCode = "BracketLeft"

	// BracketRightKey represent "BracketRight" key on the keyboard
	BracketRightKey KeyCode = "BracketRight"

	// SemicolonKey represent "Semicolon" key on the keyboard
	SemicolonKey KeyCode = "Semicolon"

	// CommaKey represent "Comma" key on the keyboard
	CommaKey KeyCode = "Comma"

	// PeriodKey represent "Period" key on the keyboard
	PeriodKey KeyCode = "Period"

	// QuoteKey represent "Quote" key on the keyboard
	QuoteKey KeyCode = "Quote"

	// BackquoteKey represent "Backquote" key on the keyboard
	BackquoteKey KeyCode = "Backquote"

	// SlashKey represent "Slash" key on the keyboard
	SlashKey KeyCode = "Slash"

	// EscapeKey represent "Escape" key on the keyboard
	EscapeKey KeyCode = "Escape"

	// EnterKey represent "Enter" key on the keyboard
	EnterKey KeyCode = "Enter"

	// TabKey represent "Tab" key on the keyboard
	TabKey KeyCode = "Tab"

	// CapsLockKey represent "CapsLock" key on the keyboard
	CapsLockKey KeyCode = "CapsLock"

	// DeleteKey represent "Delete" key on the keyboard
	DeleteKey KeyCode = "Delete"

	// InsertKey represent "Insert" key on the keyboard
	InsertKey KeyCode = "Insert"

	// HelpKey represent "Help" key on the keyboard
	HelpKey KeyCode = "Help"

	// BackspaceKey represent "Backspace" key on the keyboard
	BackspaceKey KeyCode = "Backspace"

	// PrintScreenKey represent "PrintScreen" key on the keyboard
	PrintScreenKey KeyCode = "PrintScreen"

	// ScrollLockKey represent "ScrollLock" key on the keyboard
	ScrollLockKey KeyCode = "ScrollLock"

	// PauseKey represent "Pause" key on the keyboard
	PauseKey KeyCode = "Pause"

	// ContextMenuKey represent "ContextMenu" key on the keyboard
	ContextMenuKey KeyCode = "ContextMenu"

	// ArrowLeftKey represent "ArrowLeft" key on the keyboard
	ArrowLeftKey KeyCode = "ArrowLeft"

	// ArrowRightKey represent "ArrowRight" key on the keyboard
	ArrowRightKey KeyCode = "ArrowRight"

	// ArrowUpKey represent "ArrowUp" key on the keyboard
	ArrowUpKey KeyCode = "ArrowUp"

	// ArrowDownKey represent "ArrowDown" key on the keyboard
	ArrowDownKey KeyCode = "ArrowDown"

	// HomeKey represent "Home" key on the keyboard
	HomeKey KeyCode = "Home"

	// EndKey represent "End" key on the keyboard
	EndKey KeyCode = "End"

	// PageUpKey represent "PageUp" key on the keyboard
	PageUpKey KeyCode = "PageUp"

	// PageDownKey represent "PageDown" key on the keyboard
	PageDownKey KeyCode = "PageDown"

	// F1Key represent "F1" key on the keyboard
	F1Key KeyCode = "F1"

	// F2Key represent "F2" key on the keyboard
	F2Key KeyCode = "F2"

	// F3Key represent "F3" key on the keyboard
	F3Key KeyCode = "F3"

	// F4Key represent "F4" key on the keyboard
	F4Key KeyCode = "F4"

	// F5Key represent "F5" key on the keyboard
	F5Key KeyCode = "F5"

	// F6Key represent "F6" key on the keyboard
	F6Key KeyCode = "F6"

	// F7Key represent "F7" key on the keyboard
	F7Key KeyCode = "F7"

	// F8Key represent "F8" key on the keyboard
	F8Key KeyCode = "F8"

	// F9Key represent "F9" key on the keyboard
	F9Key KeyCode = "F9"

	// F10Key represent "F10" key on the keyboard
	F10Key KeyCode = "F10"

	// F11Key represent "F11" key on the keyboard
	F11Key KeyCode = "F11"

	// F12Key represent "F12" key on the keyboard
	F12Key KeyCode = "F12"

	// F13Key represent "F13" key on the keyboard
	F13Key KeyCode = "F13"

	// NumLockKey represent "NumLock" key on the keyboard
	NumLockKey KeyCode = "NumLock"

	// NumpadKey0 represent "Numpad0" key on the keyboard
	NumpadKey0 KeyCode = "Numpad0"

	// NumpadKey1 represent "Numpad1" key on the keyboard
	NumpadKey1 KeyCode = "Numpad1"

	// NumpadKey2 represent "Numpad2" key on the keyboard
	NumpadKey2 KeyCode = "Numpad2"

	// NumpadKey3 represent "Numpad3" key on the keyboard
	NumpadKey3 KeyCode = "Numpad3"

	// NumpadKey4 represent "Numpad4" key on the keyboard
	NumpadKey4 KeyCode = "Numpad4"

	// NumpadKey5 represent "Numpad5" key on the keyboard
	NumpadKey5 KeyCode = "Numpad5"

	// NumpadKey6 represent "Numpad6" key on the keyboard
	NumpadKey6 KeyCode = "Numpad6"

	// NumpadKey7 represent "Numpad7" key on the keyboard
	NumpadKey7 KeyCode = "Numpad7"

	// NumpadKey8 represent "Numpad8" key on the keyboard
	NumpadKey8 KeyCode = "Numpad8"

	// NumpadKey9 represent "Numpad9" key on the keyboard
	NumpadKey9 KeyCode = "Numpad9"

	// NumpadDecimalKey represent "NumpadDecimal" key on the keyboard
	NumpadDecimalKey KeyCode = "NumpadDecimal"

	// NumpadEnterKey represent "NumpadEnter" key on the keyboard
	NumpadEnterKey KeyCode = "NumpadEnter"

	// NumpadAddKey represent "NumpadAdd" key on the keyboard
	NumpadAddKey KeyCode = "NumpadAdd"

	// NumpadSubtractKey represent "NumpadSubtract" key on the keyboard
	NumpadSubtractKey KeyCode = "NumpadSubtract"

	// NumpadMultiplyKey represent "NumpadMultiply" key on the keyboard
	NumpadMultiplyKey KeyCode = "NumpadMultiply"

	// NumpadDivideKey represent "NumpadDivide" key on the keyboard
	NumpadDivideKey KeyCode = "NumpadDivide"

	// ShiftLeftKey represent "ShiftLeft" key on the keyboard
	ShiftLeftKey KeyCode = "ShiftLeft"

	// ShiftRightKey represent "ShiftRight" key on the keyboard
	ShiftRightKey KeyCode = "ShiftRight"

	// ControlLeftKey represent "ControlLeft" key on the keyboard
	ControlLeftKey KeyCode = "ControlLeft"

	// ControlRightKey represent "ControlRight" key on the keyboard
	ControlRightKey KeyCode = "ControlRight"

	// AltLeftKey represent "AltLeft" key on the keyboard
	AltLeftKey KeyCode = "AltLeft"

	// AltRightKey represent "AltRight" key on the keyboard
	AltRightKey KeyCode = "AltRight"

	// MetaLeftKey represent "MetaLeft" key on the keyboard
	MetaLeftKey KeyCode = "MetaLeft"

	// MetaRightKey represent "MetaRight" key on the keyboard
	MetaRightKey KeyCode = "MetaRight"
)

Constants for specific keyboard keys.

View Source
const (
	// TopDownOrientation - subviews are arranged from top to bottom. Synonym of VerticalOrientation
	TopDownOrientation = 0

	// StartToEndOrientation - subviews are arranged from left to right. Synonym of HorizontalOrientation
	StartToEndOrientation = 1

	// BottomUpOrientation - subviews are arranged from bottom to top
	BottomUpOrientation = 2

	// EndToStartOrientation - subviews are arranged from right to left
	EndToStartOrientation = 3
)

Constants which represent values of the "orientation" property of the ListLayout

View Source
const (
	// ListWrapOff - subviews are scrolled and "true" if a new row/column starts
	ListWrapOff = 0

	// ListWrapOn - the new row/column starts at bottom/right
	ListWrapOn = 1

	// ListWrapReverse - the new row/column starts at top/left
	ListWrapReverse = 2
)

Constants which represent values of the "list-wrap" property of the ListLayout

View Source
const (
	// VerticalOrientation is the vertical ListView orientation
	VerticalOrientation = 0

	// HorizontalOrientation is the horizontal ListView orientation
	HorizontalOrientation = 1
)

Constants which represent values of the "orientation" property of the ListView. These are aliases for values used in ListLayout "orientation" property like TopDownOrientation and StartToEndOrientation

View Source
const (
	// NoneCheckbox is value of "checkbox" property: no checkbox
	NoneCheckbox = 0

	// SingleCheckbox is value of "checkbox" property: only one item can be checked
	SingleCheckbox = 1

	// MultipleCheckbox is value of "checkbox" property: several items can be checked
	MultipleCheckbox = 2
)

Constants which represent values of a "checkbox" property of ListView

View Source
const (
	// ClickEvent is the constant for "click-event" property tag.
	//
	// Used by View.
	// Occur when the user clicks on the view.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	ClickEvent PropertyName = "click-event"

	// DoubleClickEvent is the constant for "double-click-event" property tag.
	//
	// Used by View.
	// Occur when the user double clicks on the view.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	DoubleClickEvent PropertyName = "double-click-event"

	// MouseDown is the constant for "mouse-down" property tag.
	//
	// Used by View.
	// Is fired at a View when a pointing device button is pressed while the pointer is inside the view.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	MouseDown PropertyName = "mouse-down"

	// MouseUp is the constant for "mouse-up" property tag.
	//
	// Used by View.
	// Is fired at a View when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is
	// located inside it. "mouse-up" events are the counterpoint to "mouse-down" events.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	MouseUp PropertyName = "mouse-up"

	// MouseMove is the constant for "mouse-move" property tag.
	//
	// Used by View.
	// Is fired at a view when a pointing device(usually a mouse) is moved while the cursor's hotspot is inside it.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	MouseMove PropertyName = "mouse-move"

	// MouseOut is the constant for "mouse-out" property tag.
	//
	// Used by View.
	// Is fired at a View when a pointing device (usually a mouse) is used to move the cursor so that it is no longer
	// contained within the view or one of its children. "mouse-out" is also delivered to a view if the cursor enters a child
	// view, because the child view obscures the visible area of the view.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	MouseOut PropertyName = "mouse-out"

	// MouseOver is the constant for "mouse-over" property tag.
	//
	// Used by View.
	// Is fired at a View when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the view or one
	// of its child views.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	MouseOver PropertyName = "mouse-over"

	// ContextMenuEvent is the constant for "context-menu-event" property tag.
	//
	// Used by View.
	// Occur when the user calls the context menu by the right mouse clicking.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.MouseEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Mouse event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.MouseEvent)
	//  func()
	ContextMenuEvent PropertyName = "context-menu-event"

	// PrimaryMouseButton is a number of the main pressed button, usually the left button or the un-initialized state
	PrimaryMouseButton = 0

	// AuxiliaryMouseButton is a number of the auxiliary pressed button, usually the wheel button
	// or the middle button (if present)
	AuxiliaryMouseButton = 1

	// SecondaryMouseButton is a number of the secondary pressed button, usually the right button
	SecondaryMouseButton = 2

	// MouseButton4 is a number of the fourth button, typically the Browser Back button
	MouseButton4 = 3

	// MouseButton5 is a number of the fifth button, typically the Browser Forward button
	MouseButton5 = 4

	// PrimaryMouseMask is the mask of the primary button (usually the left button)
	PrimaryMouseMask = 1

	// SecondaryMouseMask is the mask of the secondary button (usually the right button)
	SecondaryMouseMask = 2

	// AuxiliaryMouseMask  is the mask of the auxiliary button (usually the mouse wheel button or middle button)
	AuxiliaryMouseMask = 4

	// MouseMask4 is the mask of the 4th button (typically the "Browser Back" button)
	MouseMask4 = 8

	//MouseMask5 is the mask of the  5th button (typically the "Browser Forward" button)
	MouseMask5 = 16
)

Constants related to View mouse events properties

View Source
const (
	// NumberEditor - type of NumberPicker. NumberPicker is presented by editor
	NumberEditor = 0

	// NumberSlider - type of NumberPicker. NumberPicker is presented by slider
	NumberSlider = 1
)

Constants which describe values of the "number-picker-type" property of a NumberPicker

View Source
const (
	// Title is the constant for "title" property tag.
	//
	// Used by Popup, TabsLayout.
	//
	// Usage in Popup:
	// Define the title.
	//
	// Supported types: string.
	//
	// Usage in TabsLayout:
	// Set the title of the tab. The property is set for the child view of TabsLayout.
	//
	// Supported types: string.
	Title = "title"

	// TitleStyle is the constant for "title-style" property tag.
	//
	// Used by Popup.
	// Set popup title style. Default title style is "ruiPopupTitle".
	//
	// Supported types: string.
	TitleStyle PropertyName = "title-style"

	// CloseButton is the constant for "close-button" property tag.
	//
	// Used by Popup.
	// Controls whether a close button can be added to the popup. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Close button will be added to a title bar of a window.
	//   - false, 0, "false", "no", "off", "0" - Popup without a close button.
	CloseButton PropertyName = "close-button"

	// OutsideClose is the constant for "outside-close" property tag.
	//
	// Used by Popup.
	// Controls whether popup can be closed by clicking outside of the window. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Clicking outside the popup window will automatically call the Dismiss() method.
	//   - false, 0, "false", "no", "off", "0" - Clicking outside the popup window has no effect.
	OutsideClose PropertyName = "outside-close"

	// Buttons is the constant for "buttons" property tag.
	//
	// Used by Popup.
	// Buttons that will be placed at the bottom of the popup.
	//
	// Supported types: PopupButton, []PopupButton.
	//
	// Internal type is []PopupButton, other types converted to it during assignment.
	// See PopupButton description for more details.
	Buttons PropertyName = "buttons"

	// ButtonsAlign is the constant for "buttons-align" property tag.
	//
	// Used by Popup.
	// Set the horizontal alignment of popup buttons.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Width alignment.
	ButtonsAlign PropertyName = "buttons-align"

	// DismissEvent is the constant for "dismiss-event" property tag.
	//
	// Used by Popup.
	// Used to track the closing state of the Popup. It occurs after the Popup disappears from the screen.
	//
	// General listener format:
	//
	//  func(popup rui.Popup)
	//
	// where:
	// popup - Interface of a popup which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	DismissEvent PropertyName = "dismiss-event"

	// Arrow is the constant for "arrow" property tag.
	//
	// Used by Popup.
	// Add an arrow to popup. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneArrow) or "none" - No arrow.
	//   - 1 (TopArrow) or "top" - Arrow at the top side of the pop-up window.
	//   - 2 (RightArrow) or "right" - Arrow on the right side of the pop-up window.
	//   - 3 (BottomArrow) or "bottom" - Arrow at the bottom of the pop-up window.
	//   - 4 (LeftArrow) or "left" - Arrow on the left side of the pop-up window.
	Arrow PropertyName = "arrow"

	// ArrowAlign is the constant for "arrow-align" property tag.
	//
	// Used by Popup.
	// Set the horizontal alignment of the popup arrow. Default value is "center".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign/LeftAlign) or "top" - Top/left alignment.
	//   - 1 (BottomAlign/RightAlign) or "bottom" - Bottom/right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	ArrowAlign PropertyName = "arrow-align"

	// ArrowSize is the constant for "arrow-size" property tag.
	//
	// Used by Popup.
	// Set the size(length) of the popup arrow. Default value is 16px defined by @ruiArrowSize constant.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	ArrowSize PropertyName = "arrow-size"

	// ArrowWidth is the constant for "arrow-width" property tag.
	//
	// Used by Popup.
	// Set the width of the popup arrow. Default value is 16px defined by @ruiArrowWidth constant.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	ArrowWidth PropertyName = "arrow-width"

	// ShowTransform is the constant for "show-transform" property tag.
	//
	// Used by Popup.
	// Specify start translation, scale and rotation over x, y and z axes as well as a distortion
	// for an animated Popup showing/hidding.
	//
	// Supported types: TransformProperty, string.
	//
	// See TransformProperty description for more details.
	//
	// Conversion rules:
	//   - TransformProperty - stored as is, no conversion performed.
	//   - string - string representation of Transform interface. Example:
	//
	//	"_{ translate-x = 10px, scale-y = 1.1}"
	ShowTransform = "show-transform"

	// ShowDuration is the constant for "show-duration" property tag.
	//
	// Used by Popup.
	// Sets the length of time in seconds that a Popup show/hide animation takes to complete.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ShowDuration = "show-duration"

	// ShowTiming is the constant for "show-timing" property tag.
	//
	// Used by Popup.
	// Set how a Popup show/hide animation progresses through the duration of each cycle.
	//
	// Supported types: string.
	//
	// Values:
	//   - "ease" (EaseTiming) - Speed increases towards the middle and slows down at the end.
	//   - "ease-in" (EaseInTiming) - Speed is slow at first, but increases in the end.
	//   - "ease-out" (EaseOutTiming) - Speed is fast at first, but decreases in the end.
	//   - "ease-in-out" (EaseInOutTiming) - Speed is slow at first, but quickly increases and at the end it decreases again.
	//   - "linear" (LinearTiming) - Constant speed.
	//   - "step(n)" (StepTiming(n int) function) - Timing function along stepCount stops along the transition, displaying each stop for equal lengths of time.
	//   - "cubic-bezier(x1, y1, x2, y2)" (CubicBezierTiming(x1, y1, x2, y2 float64) function) - Cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].
	ShowTiming = "show-timing"

	// ShowOpacity is the constant for "show-opacity" property tag.
	//
	// Used by Popup.
	// In [1..0] range sets the start opacity of Popup show animation (the finish animation opacity is 1).
	// Opacity is the degree to which content behind the view is hidden, and is the opposite of transparency.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ShowOpacity = "show-opacity"

	// ArrowOffset is the constant for "arrow-offset" property tag.
	//
	// Used by Popup.
	// Set the offset of the popup arrow.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	ArrowOffset PropertyName = "arrow-offset"

	// NoneArrow is value of the popup "arrow" property: no arrow
	NoneArrow = 0

	// TopArrow is value of the popup "arrow" property:
	// Arrow at the top side of the pop-up window
	TopArrow = 1

	// RightArrow is value of the popup "arrow" property:
	// Arrow on the right side of the pop-up window
	RightArrow = 2

	// BottomArrow is value of the popup "arrow" property:
	// Arrow at the bottom of the pop-up window
	BottomArrow = 3

	// LeftArrow is value of the popup "arrow" property:
	// Arrow on the left side of the pop-up window
	LeftArrow = 4
)

Constants for Popup specific properties and events

View Source
const (
	// Visible - default value of the view Visibility property: View is visible
	Visible = 0

	// Invisible - value of the view Visibility property: View is invisible but takes place
	Invisible = 1

	// Gone - value of the view Visibility property: View is invisible and does not take place
	Gone = 2

	// OverflowHidden - value of the view "overflow" property:
	// Content is clipped if necessary to fit the padding box. No scrollbars are provided,
	// and no support for allowing the user to scroll (such as by dragging or using a scroll wheel) is allowed.
	// The content can be scrolled programmatically, so the element is still a scroll container.
	OverflowHidden = 0

	// OverflowVisible - value of the view "overflow" property:
	// Content is not clipped and may be rendered outside the padding box.
	OverflowVisible = 1

	// OverflowScroll - value of the view "overflow" property:
	// Content is clipped if necessary to fit the padding box. Browsers always display scrollbars whether or
	// not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes.
	OverflowScroll = 2

	// OverflowAuto - value of the view "overflow" property:
	// Depends on the browser user agent. If content fits inside the padding box, it looks the same as OverflowVisible,
	// but still establishes a new block formatting context. Desktop browsers provide scrollbars if content overflows.
	OverflowAuto = 3

	// NoneTextTransform - not transform text
	NoneTextTransform = 0

	// CapitalizeTextTransform - capitalize text
	CapitalizeTextTransform = 1

	// LowerCaseTextTransform - transform text to lower case
	LowerCaseTextTransform = 2

	// UpperCaseTextTransform - transform text to upper case
	UpperCaseTextTransform = 3

	// HorizontalTopToBottom - content flows horizontally from left to right, vertically from top to bottom.
	// The next horizontal line is positioned below the previous line.
	HorizontalTopToBottom = 0

	// HorizontalBottomToTop - content flows horizontally from left to right, vertically from bottom to top.
	// The next horizontal line is positioned above the previous line.
	HorizontalBottomToTop = 1

	// VerticalRightToLeft - content flows vertically from top to bottom, horizontally from right to left.
	// The next vertical line is positioned to the left of the previous line.
	VerticalRightToLeft = 2

	// VerticalLeftToRight - content flows vertically from top to bottom, horizontally from left to right.
	// The next vertical line is positioned to the right of the previous line.
	VerticalLeftToRight = 3

	// MixedTextOrientation - rotates the characters of horizontal scripts 90° clockwise.
	// Lays out the characters of vertical scripts naturally. Default value.
	MixedTextOrientation = 0

	// UprightTextOrientation - lays out the characters of horizontal scripts naturally (upright),
	// as well as the glyphs for vertical scripts. Note that this keyword causes all characters
	// to be considered as left-to-right: the used value of "text-direction" is forced to be "left-to-right".
	UprightTextOrientation = 1

	// SystemTextDirection - direction of a text and other elements defined by system. This is the default value.
	SystemTextDirection = 0

	// LeftToRightDirection - text and other elements go from left to right.
	LeftToRightDirection = 1

	//RightToLeftDirection - text and other elements go from right to left.
	RightToLeftDirection = 2

	// ThinFont - the value of "text-weight" property: the thin (hairline) text weight
	ThinFont = 1

	// ExtraLightFont - the value of "text-weight" property: the extra light (ultra light) text weight
	ExtraLightFont = 2

	// LightFont - the value of "text-weight" property: the light text weight
	LightFont = 3

	// NormalFont - the value of "text-weight" property (default value): the normal text weight
	NormalFont = 4

	// MediumFont - the value of "text-weight" property: the medium text weight
	MediumFont = 5

	// SemiBoldFont - the value of "text-weight" property: the semi bold (demi bold) text weight
	SemiBoldFont = 6

	// BoldFont - the value of "text-weight" property: the bold text weight
	BoldFont = 7

	// ExtraBoldFont - the value of "text-weight" property: the extra bold (ultra bold) text weight
	ExtraBoldFont = 8

	// BlackFont - the value of "text-weight" property: the black (heavy) text weight
	BlackFont = 9

	// TopAlign - top vertical-align for the "vertical-align" property
	TopAlign = 0

	// BottomAlign - bottom vertical-align for the "vertical-align" property
	BottomAlign = 1

	// LeftAlign - the left horizontal-align for the "horizontal-align" property
	LeftAlign = 0

	// RightAlign - the right horizontal-align for the "horizontal-align" property
	RightAlign = 1

	// CenterAlign - the center horizontal/vertical-align for the "horizontal-align"/"vertical-align" property
	CenterAlign = 2

	// StretchAlign - the stretch horizontal/vertical-align for the "horizontal-align"/"vertical-align" property
	StretchAlign = 3

	// JustifyAlign - the justify text align for "text-align" property
	JustifyAlign = 3

	// BaselineAlign - the baseline cell-vertical-align for the "cell-vertical-align" property
	BaselineAlign = 4

	// WhiteSpaceNormal - sequences of white space are collapsed. Newline characters in the source
	// are handled the same as other white space. Lines are broken as necessary to fill line boxes.
	WhiteSpaceNormal = 0

	// WhiteSpaceNowrap - collapses white space as for normal, but suppresses line breaks (text wrapping)
	// within the source.
	WhiteSpaceNowrap = 1

	// WhiteSpacePre - sequences of white space are preserved. Lines are only broken at newline
	// characters in the source and at <br> elements.
	WhiteSpacePre = 2

	// WhiteSpacePreWrap - Sequences of white space are preserved. Lines are broken at newline
	// characters, at <br>, and as necessary to fill line boxes.
	WhiteSpacePreWrap = 3

	// WhiteSpacePreLine - sequences of white space are collapsed. Lines are broken at newline characters,
	// at <br>, and as necessary to fill line boxes.
	WhiteSpacePreLine = 4

	// WhiteSpaceBreakSpaces - the behavior is identical to that of WhiteSpacePreWrap, except that:
	//   - Any sequence of preserved white space always takes up space, including at the end of the line.
	//   - A line breaking opportunity exists after every preserved white space character, including between white space characters.
	//   - Such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size).
	WhiteSpaceBreakSpaces = 5

	// WordBreakNormal - use the default line break rule.
	WordBreakNormal = 0

	// WordBreakAll - to prevent overflow, word breaks should be inserted between any two characters
	// (excluding Chinese/Japanese/Korean text).
	WordBreakAll = 1

	// WordBreakKeepAll - word breaks should not be used for Chinese/Japanese/Korean (CJK) text.
	// Non-CJK text behavior is the same as for normal.
	WordBreakKeepAll = 2

	// WordBreakWord - when the block boundaries are exceeded, the remaining whole words can be split
	// in an arbitrary place, unless a more suitable place for the line break is found.
	WordBreakWord = 3

	// TextOverflowClip - truncate the text at the limit of the content area, therefore the truncation
	// can happen in the middle of a character.
	TextOverflowClip = 0

	// TextOverflowEllipsis - display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) to represent clipped text.
	// The ellipsis is displayed inside the content area, decreasing the amount of text displayed.
	// If there is not enough space to display the ellipsis, it is clipped.
	TextOverflowEllipsis = 1

	// DefaultSemantics - default value of the view Semantic property
	DefaultSemantics = 0

	// ArticleSemantics - value of the view Semantic property: view represents a self-contained
	// composition in a document, page, application, or site, which is intended to be
	// independently distributable or reusable (e.g., in syndication)
	ArticleSemantics = 1

	// SectionSemantics - value of the view Semantic property: view represents
	// a generic standalone section of a document, which doesn't have a more specific
	// semantic element to represent it.
	SectionSemantics = 2

	// AsideSemantics - value of the view Semantic property: view represents a portion
	// of a document whose content is only indirectly related to the document's main content.
	// Asides are frequently presented as sidebars or call-out boxes.
	AsideSemantics = 3

	// HeaderSemantics - value of the view Semantic property: view represents introductory
	// content, typically a group of introductory or navigational aids. It may contain
	// some heading elements but also a logo, a search form, an author name, and other elements.
	HeaderSemantics = 4

	// MainSemantics - value of the view Semantic property: view represents the dominant content
	// of the application. The main content area consists of content that is directly related
	// to or expands upon the central topic of a document, or the central functionality of an application.
	MainSemantics = 5

	// FooterSemantics - value of the view Semantic property: view represents a footer for its
	// nearest sectioning content or sectioning root element. A footer view typically contains
	// information about the author of the section, copyright data or links to related documents.
	FooterSemantics = 6

	// NavigationSemantics - value of the view Semantic property: view represents a section of
	// a page whose purpose is to provide navigation links, either within the current document
	// or to other documents. Common examples of navigation sections are menus, tables of contents,
	// and indexes.
	NavigationSemantics = 7

	// FigureSemantics - value of the view Semantic property: view represents self-contained content,
	// potentially with an optional caption, which is specified using the FigureCaptionSemantics view.
	FigureSemantics = 8

	// FigureCaptionSemantics - value of the view Semantic property: view represents a caption or
	// legend describing the rest of the contents of its parent FigureSemantics view.
	FigureCaptionSemantics = 9

	// ButtonSemantics - value of the view Semantic property: view a clickable button
	ButtonSemantics = 10

	// ParagraphSemantics - value of the view Semantic property: view represents a paragraph.
	// Paragraphs are usually represented in visual media as blocks of text separated
	// from adjacent blocks by blank lines and/or first-line indentation
	ParagraphSemantics = 11

	// H1Semantics - value of the view Semantic property: view represent of first level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H1Semantics = 12

	// H2Semantics - value of the view Semantic property: view represent of second level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H2Semantics = 13

	// H3Semantics - value of the view Semantic property: view represent of third level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H3Semantics = 14

	// H4Semantics - value of the view Semantic property: view represent of fourth level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H4Semantics = 15

	// H5Semantics - value of the view Semantic property: view represent of fifth level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H5Semantics = 16

	// H6Semantics - value of the view Semantic property: view represent of sixth level section headings.
	// H1Semantics is the highest section level and H6Semantics is the lowest.
	H6Semantics = 17

	// BlockquoteSemantics - value of the view Semantic property: view indicates that
	// the enclosed text is an extended quotation.
	BlockquoteSemantics = 18

	// CodeSemantics - value of the view Semantic property: view displays its contents styled
	// in a fashion intended to indicate that the text is a short fragment of computer code
	CodeSemantics = 19

	// NoneFloat - value of the view "float" property: the View must not float.
	NoneFloat = 0

	// LeftFloat - value of the view "float" property: the View must float on the left side of its containing block.
	LeftFloat = 1

	// RightFloat - value of the view "float" property: the View must float on the right side of its containing block.
	RightFloat = 2

	// NoneResize - value of the view "resize" property: the View The offers no user-controllable method for resizing it.
	NoneResize = 0

	// BothResize - value of the view "resize" property: the View displays a mechanism for allowing
	// the user to resize it, which may be resized both horizontally and vertically.
	BothResize = 1

	// HorizontalResize - value of the view "resize" property: the View displays a mechanism for allowing
	// the user to resize it in the horizontal direction.
	HorizontalResize = 2

	// VerticalResize - value of the view "resize" property: the View displays a mechanism for allowing
	// the user to resize it in the vertical direction.
	VerticalResize = 3

	// RowAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
	// Views are placed by filling each row in turn, adding new rows as necessary.
	RowAutoFlow = 0

	// ColumnAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
	// Views are placed by filling each column in turn, adding new columns as necessary.
	ColumnAutoFlow = 1

	// RowDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
	// Views are placed by filling each row, adding new rows as necessary.
	// "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later.
	// This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.
	RowDenseAutoFlow = 2

	// ColumnDenseAutoFlow - value of the "grid-auto-flow" property of the GridLayout:
	// Views are placed by filling each column, adding new columns as necessary.
	// "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later.
	// This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.
	ColumnDenseAutoFlow = 3

	// BlendNormal - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the top color, regardless of what the bottom color is.
	// The effect is like two opaque pieces of paper overlapping.
	BlendNormal = 0

	// BlendMultiply - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of multiplying the top and bottom colors.
	// A black layer leads to a black final layer, and a white layer leads to no change.
	// The effect is like two images printed on transparent film overlapping.
	BlendMultiply = 1

	// BlendScreen - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of inverting the colors, multiplying them, and inverting that value.
	// A black layer leads to no change, and a white layer leads to a white final layer.
	// The effect is like two images shone onto a projection screen.
	BlendScreen = 2

	// BlendOverlay - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of multiply if the bottom color is darker, or screen if the bottom color is lighter.
	// This blend mode is equivalent to hard-light but with the layers swapped.
	BlendOverlay = 3

	// BlendDarken - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is composed of the darkest values of each color channel.
	BlendDarken = 4

	// BlendLighten - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is composed of the lightest values of each color channel.
	BlendLighten = 5

	// BlendColorDodge - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of dividing the bottom color by the inverse of the top color.
	// A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color.
	// This blend mode is similar to screen, but the foreground need only be as light as the inverse of the backdrop to create a fully lit color.
	BlendColorDodge = 6

	// BlendColorBurn - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of inverting the bottom color, dividing the value by the top color, and inverting that value.
	// A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image.
	// This blend mode is similar to multiply, but the foreground need only be as dark as the inverse of the backdrop to make the final image black.
	BlendColorBurn = 7

	// BlendHardLight - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of multiply if the top color is darker, or screen if the top color is lighter.
	// This blend mode is equivalent to overlay but with the layers swapped. The effect is similar to shining a harsh spotlight on the backdrop.
	BlendHardLight = 8

	// BlendSoftLight - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is similar to hard-light, but softer. This blend mode behaves similar to hard-light.
	// The effect is similar to shining a diffused spotlight on the backdrop*.*
	BlendSoftLight = 9

	// BlendDifference - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is the result of subtracting the darker of the two colors from the lighter one.
	// A black layer has no effect, while a white layer inverts the other layer's color.
	BlendDifference = 10

	// BlendExclusion - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color is similar to difference, but with less contrast.
	// As with difference, a black layer has no effect, while a white layer inverts the other layer's color.
	BlendExclusion = 11

	// BlendHue - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
	BlendHue = 12

	// BlendSaturation - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color has the saturation of the top color, while using the hue and luminosity of the bottom color.
	// A pure gray backdrop, having no saturation, will have no effect.
	BlendSaturation = 13

	// BlendColor - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color has the hue and saturation of the top color, while using the luminosity of the bottom color.
	// The effect preserves gray levels and can be used to colorize the foreground.
	BlendColor = 14

	// BlendLuminosity - value of the "mix-blend-mode" and "background-blend-mode" property:
	// The final color has the luminosity of the top color, while using the hue and saturation of the bottom color.
	// This blend mode is equivalent to BlendColor, but with the layers swapped.
	BlendLuminosity = 15

	// ColumnFillBalance - value of the "column-fill" property: content is equally divided between columns.
	ColumnFillBalance = 0

	// ColumnFillAuto - value of the "column-fill" property:
	// Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
	ColumnFillAuto = 1

	// TextWrapOn - value of the "text-wrap" property:
	// text is wrapped across lines at appropriate characters (for example spaces,
	// in languages like English that use space separators) to minimize overflow.
	TextWrapOn = 0

	// TextWrapOff - value of the "text-wrap" property: text does not wrap across lines.
	// It will overflow its containing element rather than breaking onto a new line.
	TextWrapOff = 1

	// TextWrapBalance - value of the "text-wrap" property: text is wrapped in a way
	// that best balances the number of characters on each line, enhancing layout quality
	// and legibility. Because counting characters and balancing them across multiple lines
	// is computationally expensive, this value is only supported for blocks of text
	// spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).
	TextWrapBalance = 2
)

Constants for various specific properties of a views

View Source
const (
	// Side is the constant for "side" property tag.
	//
	// Used by Resizable.
	// Determines which side of the container is used to resize. The value of property is an or-combination of values listed.
	// Default value is "all".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 1 (TopSide) or "top" - Top frame side.
	//   - 2 (RightSide) or "right" - Right frame side.
	//   - 4 (BottomSide) or "bottom" - Bottom frame side.
	//   - 8 (LeftSide) or "left" - Left frame side.
	//   - 15 (AllSides) or "all" - All frame sides.
	Side = "side"

	// ResizeBorderWidth is the constant for "resize-border-width" property tag.
	//
	// Used by Resizable.
	// Specifies the width of the resizing border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	ResizeBorderWidth = "resize-border-width"
)

Constants for Resizable specific properties and events

View Source
const (
	// TopSide is value of the "side" property: the top side is used to resize
	TopSide = 1

	// RightSide is value of the "side" property: the right side is used to resize
	RightSide = 2

	// BottomSide is value of the "side" property: the bottom side is used to resize
	BottomSide = 4

	// LeftSide is value of the "side" property: the left side is used to resize
	LeftSide = 8

	// AllSides is value of the "side" property: all sides is used to resize
	AllSides = TopSide | RightSide | BottomSide | LeftSide
)

Constants for values of Resizable "side" property. These constants can be ORed if needed.

View Source
const (
	// NoneSelection the selection is forbidden.
	NoneSelection = 0
	// CellSelection the selection of a single cell only is enabled.
	CellSelection = 1
	// RowSelection the selection of a table row only is enabled.
	RowSelection = 2
)

Constants which represent values of "selection-mode" property of a TableView

View Source
const (
	// TopTabs - tabs of TabsLayout are on the top
	TopTabs = 0
	// BottomTabs - tabs of TabsLayout are on the bottom
	BottomTabs = 1
	// LeftTabs - tabs of TabsLayout are on the left. Bookmarks are rotated counterclockwise 90 degrees.
	LeftTabs = 2
	// RightTabs - tabs of TabsLayout are on the right. Bookmarks are rotated clockwise 90 degrees.
	RightTabs = 3
	// LeftListTabs - tabs of TabsLayout are on the left
	LeftListTabs = 4
	// RightListTabs - tabs of TabsLayout are on the right
	RightListTabs = 5
	// HiddenTabs - tabs of TabsLayout are hidden
	HiddenTabs = 6
)

Constants that are the values of the "tabs" property of a TabsLayout

View Source
const (
	// DefaultMedia means that style appliance will not be related to client's window orientation
	DefaultMedia = 0

	// PortraitMedia means that style apply on clients with portrait window orientation
	PortraitMedia = 1

	// PortraitMedia means that style apply on clients with landscape window orientation
	LandscapeMedia = 2
)

Constants used as a values for MediaStyleParams member Orientation

View Source
const PopupMenuResult = "popup-menu-result"

PopupMenuResult is the constant for "popup-menu-result" property tag.

Used by `Popup`. Set the function to be called when the menu item of popup menu is selected.

Supported types: `func(index int)`.

Variables

View Source
var ProtocolInDebugLog = false

ProtocolInDebugLog If it is set to true, then the protocol of the exchange between clients and the server is displayed in the debug log

Functions

func AddEmbedResources

func AddEmbedResources(fs *embed.FS)

AddEmbedResources adds embedded resources to the list of application resources

func AddTheme added in v0.6.0

func AddTheme(theme Theme)

AddTheme adds theme to application

func AddTransition added in v0.2.0

func AddTransition(view View, subviewID string, tag PropertyName, animation AnimationProperty) bool

AddTransition adds the transition for the subview property. If the second argument (subviewID) is not specified or it is "" then the transition is added to the first argument (view)

func AllImageResources added in v0.6.0

func AllImageResources() []string

AllImageResources returns the list of all image resouces

func AllRawResources

func AllRawResources() []string

AllRawResources returns the list of all raw resouces

func AppendEditText

func AppendEditText(view View, subviewID string, text string)

AppendEditText appends the text to the EditView content. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func AppendView

func AppendView(rootView View, containerID string, view View) bool

AppendView appends a view to the end of the list of a view children

func BlurView added in v0.7.0

func BlurView(view View)

BlurView removes keyboard focus from the specified View.

func BlurViewByID added in v0.7.0

func BlurViewByID(viewID string, session Session)

BlurViewByID removes keyboard focus from the View with the specified viewID.

func CubicBezierTiming

func CubicBezierTiming(x1, y1, x2, y2 float64) string

CubicBezierTiming return a cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].

func DebugLog

func DebugLog(text string)

DebugLog print the text to the debug log

func DebugLogF

func DebugLogF(format string, a ...any)

DebugLogF print the text to the debug log

func ErrorLog

func ErrorLog(text string)

ErrorLog print the text to the error log

func ErrorLogF

func ErrorLogF(format string, a ...any)

ErrorLogF print the text to the error log

func FinishApp added in v0.7.0

func FinishApp()

FinishApp finishes application

func FocusView

func FocusView(view View, subviewID ...string)

FocusView sets focus on the specified subview, if it can be focused. The focused View is the View which will receive keyboard events by default. If the second argument (subviewID) is not specified or it is "" then focus is set on the first argument (view)

func FocusViewByID

func FocusViewByID(viewID string, session Session)

FocusView sets focus on the View with the specified viewID, if it can be focused. The focused View is the View which will receive keyboard events by default.

func Get

func Get(rootView View, viewID string, tag PropertyName) any

Get returns a value of the property with name "tag" of the "rootView" subview with "viewID" id value.

The type of return value depends on the property.

If the subview don't exists or the property is not set then nil is returned.

If the second argument (subviewID) is "" then a listener for the first argument (view) is get

func GetAnimationCancelListeners added in v0.2.0

func GetAnimationCancelListeners(view View, subviewID ...string) []func(View, string)

GetAnimationCancelListeners returns the "animation-cancel-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetAnimationEndListeners added in v0.2.0

func GetAnimationEndListeners(view View, subviewID ...string) []func(View, string)

GetAnimationEndListeners returns the "animation-end-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetAnimationIterationListeners added in v0.2.0

func GetAnimationIterationListeners(view View, subviewID ...string) []func(View, string)

GetAnimationIterationListeners returns the "animation-iteration-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetAnimationStartListeners added in v0.2.0

func GetAnimationStartListeners(view View, subviewID ...string) []func(View, string)

GetAnimationStartListeners returns the "animation-start-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetAvoidBreak

func GetAvoidBreak(view View, subviewID ...string) bool

GetAvoidBreak returns "true" if avoids any break from being inserted within the principal box, and "false" if allows, but does not force, any break to be inserted within the principal box. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetBackfaceVisible

func GetBackfaceVisible(view View, subviewID ...string) bool

GetBackfaceVisible returns a bool property that sets whether the back face of an element is visible when turned towards the user. Values: true - the back face is visible when turned towards the user (default value). false - the back face is hidden, effectively making the element invisible when turned away from the user. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetBackgroundBlendMode added in v0.11.0

func GetBackgroundBlendMode(view View, subviewID ...string) int

GetBackgroundBlendMode returns a "background-blend-mode" of the subview. Returns one of next values:

BlendNormal (0), BlendMultiply (1), BlendScreen (2), BlendOverlay (3), BlendDarken (4), BlendLighten (5), BlendColorDodge (6), BlendColorBurn (7), BlendHardLight (8), BlendSoftLight (9), BlendDifference (10), BlendExclusion (11), BlendHue (12), BlendSaturation (13), BlendColor (14), BlendLuminosity (15)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetBackgroundClip added in v0.18.0

func GetBackgroundClip(view View, subviewID ...string) int

GetBackgroundClip returns a "background-clip" of the subview. Returns one of next values:

BorderBox (0), PaddingBox (1), ContentBox (2)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetBackgroundOrigin added in v0.18.0

func GetBackgroundOrigin(view View, subviewID ...string) int

GetBackgroundOrigin returns a "background-origin" of the subview. Returns one of next values:

BorderBox (0), PaddingBox (1), ContentBox (2)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCellHorizontalAlign

func GetCellHorizontalAlign(view View, subviewID ...string) int

GetCellHorizontalAlign returns the vertical align of a GridLayout cell content: LeftAlign (0), RightAlign (1), CenterAlign (2), StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCellVerticalAlign

func GetCellVerticalAlign(view View, subviewID ...string) int

GetCellVerticalAlign returns the vertical align of a GridLayout cell content: TopAlign (0), BottomAlign (1), CenterAlign (2), StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCheckboxChangedListeners added in v0.17.0

func GetCheckboxChangedListeners(view View, subviewID ...string) []func(Checkbox, bool)

GetCheckboxChangedListeners returns the CheckboxChangedListener list of an Checkbox subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCheckboxHorizontalAlign added in v0.9.0

func GetCheckboxHorizontalAlign(view View, subviewID ...string) int

GetCheckboxHorizontalAlign return the vertical align of a Checkbox subview: LeftAlign (0), RightAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetCheckboxVerticalAlign added in v0.9.0

func GetCheckboxVerticalAlign(view View, subviewID ...string) int

GetCheckboxVerticalAlign return the vertical align of a Checkbox subview: TopAlign (0), BottomAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetClickListeners

func GetClickListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetClickListeners returns the "click-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColorChangedListeners

func GetColorChangedListeners(view View, subviewID ...string) []func(ColorPicker, Color, Color)

GetColorChangedListeners returns the ColorChangedListener list of an ColorPicker subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColumnCount

func GetColumnCount(view View, subviewID ...string) int

GetColumnCount returns int value which specifies number of columns into which the content of ColumnLayout is break. If the return value is 0 then the number of columns is calculated based on the "column-width" property. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetColumnFill added in v0.11.0

func GetColumnFill(view View, subviewID ...string) int

GetColumnFill returns a "column-fill" property value of the subview. Returns one of next values: ColumnFillBalance (0) or ColumnFillAuto (1) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColumnSeparatorStyle

func GetColumnSeparatorStyle(view View, subviewID ...string) int

ColumnSeparatorStyle returns int value which specifies the style of the line drawn between columns in a multi-column layout. Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4). If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetContextMenuListeners

func GetContextMenuListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetContextMenuListeners returns the "context-menu" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCurrent added in v0.4.0

func GetCurrent(view View, subviewID ...string) int

GetCurrent returns the index of the selected item (<0 if there is no a selected item) or the current view index (StackLayout, TabsLayout). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDataList added in v0.15.0

func GetDataList(view View, subviewID ...string) []string

GetDataList returns the data list of an editor. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDateChangedListeners

func GetDateChangedListeners(view View, subviewID ...string) []func(DatePicker, time.Time, time.Time)

GetDateChangedListeners returns the DateChangedListener list of an DatePicker subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDatePickerMax

func GetDatePickerMax(view View, subviewID ...string) (time.Time, bool)

GetDatePickerMax returns the max date of DatePicker subview and "true" as the second value if the min date is set, "false" as the second value otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDatePickerMin

func GetDatePickerMin(view View, subviewID ...string) (time.Time, bool)

GetDatePickerMin returns the min date of DatePicker subview and "true" as the second value if the min date is set, "false" as the second value otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDatePickerStep

func GetDatePickerStep(view View, subviewID ...string) int

GetDatePickerStep returns the date changing step in days of DatePicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDatePickerValue

func GetDatePickerValue(view View, subviewID ...string) time.Time

GetDatePickerValue returns the date of DatePicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDisabledStyle

func GetDisabledStyle(view View, subviewID ...string) string

GetDisabledStyle returns the disabled subview style id. If the second argument (subviewID) is not specified or it is "" then a style of the first argument (view) is returned

func GetDoubleClickListeners

func GetDoubleClickListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetDoubleClickListeners returns the "double-click-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDropDownDisabledItems added in v0.6.0

func GetDropDownDisabledItems(view View, subviewID ...string) []int

GetDropDownDisabledItems return an array of disabled(non selectable) items indices of DropDownList. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDropDownItemSeparators added in v0.17.0

func GetDropDownItemSeparators(view View, subviewID ...string) []int

GetDropDownItemSeparators return an array of indices of DropDownList items after which a separator should be added. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDropDownItems

func GetDropDownItems(view View, subviewID ...string) []string

GetDropDownItems return the DropDownList items list. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetDropDownListeners

func GetDropDownListeners(view View, subviewID ...string) []func(DropDownList, int, int)

GetDropDownListeners returns the "drop-down-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetEditViewPattern

func GetEditViewPattern(view View, subviewID ...string) string

GetEditViewPattern returns a value of the Pattern property of EditView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetEditViewType

func GetEditViewType(view View, subviewID ...string) int

GetEditViewType returns a value of the Type property of EditView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetFilePickerAccept added in v0.3.0

func GetFilePickerAccept(view View, subviewID ...string) []string

GetFilePickerAccept returns sets the list of allowed file extensions or MIME types. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetFileSelectedListeners added in v0.3.0

func GetFileSelectedListeners(view View, subviewID ...string) []func(FilePicker, []FileInfo)

GetFileSelectedListeners returns the "file-selected-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetFocusListeners

func GetFocusListeners(view View, subviewID ...string) []func(View)

GetFocusListeners returns a FocusListener list. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetFontName

func GetFontName(view View, subviewID ...string) string

GetFontName returns the subview font. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetGridAutoFlow added in v0.7.0

func GetGridAutoFlow(view View, subviewID ...string) int

GetGridAutoFlow returns the value of the "grid-auto-flow" property If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetHint

func GetHint(view View, subviewID ...string) string

GetHint returns a hint text of the subview. If the second argument (subviewID) is not specified or it is "" then a text of the first argument (view) is returned.

func GetHorizontalAlign

func GetHorizontalAlign(view View, subviewID ...string) int

GetHorizontalAlign return the vertical align of a list/checkbox: LeftAlign (0), RightAlign (1), CenterAlign (2), StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetImageViewAltText

func GetImageViewAltText(view View, subviewID ...string) string

GetImageViewAltText returns an alternative text description of an ImageView subview. If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetImageViewFit

func GetImageViewFit(view View, subviewID ...string) int

GetImageViewFit returns how the content of a replaced ImageView subview: NoneFit (0), ContainFit (1), CoverFit (2), FillFit (3), or ScaleDownFit (4). If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetImageViewHorizontalAlign

func GetImageViewHorizontalAlign(view View, subviewID ...string) int

GetImageViewHorizontalAlign return the vertical align of an ImageView subview: LeftAlign (0), RightAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetImageViewSource

func GetImageViewSource(view View, subviewID ...string) string

GetImageViewSource returns the image URL of an ImageView subview. If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetImageViewVerticalAlign

func GetImageViewVerticalAlign(view View, subviewID ...string) int

GetImageViewVerticalAlign return the vertical align of an ImageView subview: TopAlign (0), BottomAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetKeyDownListeners

func GetKeyDownListeners(view View, subviewID ...string) []func(View, KeyEvent)

GetKeyDownListeners returns the "key-down-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetKeyUpListeners

func GetKeyUpListeners(view View, subviewID ...string) []func(View, KeyEvent)

GetKeyUpListeners returns the "key-up-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListHorizontalAlign

func GetListHorizontalAlign(view View, subviewID ...string) int

GetListHorizontalAlign returns the vertical align of a ListLayout or ListView subview: LeftAlign (0), RightAlign (1), CenterAlign (2), or StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemCheckedListeners

func GetListItemCheckedListeners(view View, subviewID ...string) []func(ListView, []int)

GetListItemCheckedListeners returns a ListItemCheckedListener of the ListView. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemClickedListeners

func GetListItemClickedListeners(view View, subviewID ...string) []func(ListView, int)

GetListItemClickedListeners returns a ListItemClickedListener of the ListView. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemHorizontalAlign

func GetListItemHorizontalAlign(view View, subviewID ...string) int

ItemHorizontalAlign returns the horizontal align of the ListView item content: LeftAlign (0), RightAlign (1), CenterAlign (2), StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemSelectedListeners

func GetListItemSelectedListeners(view View, subviewID ...string) []func(ListView, int)

GetListItemSelectedListeners returns a ListItemSelectedListener of the ListView. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemVerticalAlign

func GetListItemVerticalAlign(view View, subviewID ...string) int

GetListItemVerticalAlign returns the vertical align of the ListView item content: TopAlign (0), BottomAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListOrientation

func GetListOrientation(view View, subviewID ...string) int

GetListOrientation returns the orientation of a ListLayout or ListView subview: TopDownOrientation (0), StartToEndOrientation (1), BottomUpOrientation (2), or EndToStartOrientation (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListVerticalAlign

func GetListVerticalAlign(view View, subviewID ...string) int

GetListVerticalAlign returns the vertical align of a ListLayout or ListView sibview: TopAlign (0), BottomAlign (1), CenterAlign (2), or StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListViewCheckbox

func GetListViewCheckbox(view View, subviewID ...string) int

GetListViewCheckbox returns the ListView checkbox type: NoneCheckbox (0), SingleCheckbox (1), or MultipleCheckbox (2). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListViewCheckboxHorizontalAlign

func GetListViewCheckboxHorizontalAlign(view View, subviewID ...string) int

GetListViewCheckboxHorizontalAlign returns the horizontal align of the ListView checkbox: LeftAlign (0), RightAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListViewCheckboxVerticalAlign

func GetListViewCheckboxVerticalAlign(view View, subviewID ...string) int

GetListViewCheckboxVerticalAlign returns the vertical align of the ListView checkbox: TopAlign (0), BottomAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListViewCheckedItems

func GetListViewCheckedItems(view View, subviewID ...string) []int

GetListViewCheckedItems returns the array of ListView checked items. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListWrap

func GetListWrap(view View, subviewID ...string) int

GetListWrap returns the wrap type of a ListLayout or ListView subview: ListWrapOff (0), ListWrapOn (1), or ListWrapReverse (2) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetLocalIP

func GetLocalIP() string

GetLocalIP return IP address of the machine interface

func GetLostFocusListeners

func GetLostFocusListeners(view View, subviewID ...string) []func(View)

GetLostFocusListeners returns a LostFocusListener list. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMaskClip added in v0.18.0

func GetMaskClip(view View, subviewID ...string) int

GetMaskClip returns a "mask-clip" of the subview. Returns one of next values:

BorderBox (0), PaddingBox (1), ContentBox (2)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMaskOrigin added in v0.18.0

func GetMaskOrigin(view View, subviewID ...string) int

GetMaskOrigin returns a "mask-origin" of the subview. Returns one of next values:

BorderBox (0), PaddingBox (1), ContentBox (2)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMaxLength

func GetMaxLength(view View, subviewID ...string) int

GetMaxLength returns a maximal length of EditView. If a maximal length is not limited then 0 is returned If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned.

func GetMixBlendMode added in v0.11.0

func GetMixBlendMode(view View, subviewID ...string) int

GetMixBlendMode returns a "mix-blend-mode" of the subview. Returns one of next values:

BlendNormal (0), BlendMultiply (1), BlendScreen (2), BlendOverlay (3), BlendDarken (4), BlendLighten (5), BlendColorDodge (6), BlendColorBurn (7), BlendHardLight (8), BlendSoftLight (9), BlendDifference (10), BlendExclusion (11), BlendHue (12), BlendSaturation (13), BlendColor (14), BlendLuminosity (15)

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMouseDownListeners

func GetMouseDownListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetMouseDownListeners returns the "mouse-down" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMouseMoveListeners

func GetMouseMoveListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetMouseMoveListeners returns the "mouse-move" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMouseOutListeners

func GetMouseOutListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetMouseOutListeners returns the "mouse-out" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMouseOverListeners

func GetMouseOverListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetMouseOverListeners returns the "mouse-over" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMouseUpListeners

func GetMouseUpListeners(view View, subviewID ...string) []func(View, MouseEvent)

GetMouseUpListeners returns the "mouse-up" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNotTranslate

func GetNotTranslate(view View, subviewID ...string) bool

GetNotTranslate returns value of "not-translate" property of the subview. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned.

func GetNumberChangedListeners

func GetNumberChangedListeners(view View, subviewID ...string) []func(NumberPicker, float64, float64)

GetNumberChangedListeners returns the NumberChangedListener list of an NumberPicker subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNumberPickerMinMax

func GetNumberPickerMinMax(view View, subviewID ...string) (float64, float64)

GetNumberPickerMinMax returns the min and max value of NumberPicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNumberPickerPrecision added in v0.18.0

func GetNumberPickerPrecision(view View, subviewID ...string) int

GetNumberPickerPrecision returns the precision of displaying fractional part in editor of NumberPicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNumberPickerStep

func GetNumberPickerStep(view View, subviewID ...string) float64

GetNumberPickerStep returns the value changing step of NumberPicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNumberPickerType

func GetNumberPickerType(view View, subviewID ...string) int

GetNumberPickerType returns the type of NumberPicker subview. Valid values: NumberEditor (0) - NumberPicker is presented by editor (default type); NumberSlider (1) - NumberPicker is presented by slider. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetNumberPickerValue

func GetNumberPickerValue(view View, subviewID ...string) float64

GetNumberPickerValue returns the value of NumberPicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetOpacity

func GetOpacity(view View, subviewID ...string) float64

GetOpacity returns the subview opacity. If the second argument (subviewID) is not specified or it is "" then an opacity of the first argument (view) is returned

func GetOrder added in v0.11.0

func GetOrder(view View, subviewID ...string) int

GetOrder returns the subview order to layout an item in a ListLayout or GridLayout container. If the second argument (subviewID) is not specified or it is "" then an order of the first argument (view) is returned

func GetOverflow added in v0.9.0

func GetOverflow(view View, subviewID ...string) int

GetOverflow returns a value of the subview "overflow" property. Returns one of next values: OverflowHidden (0), OverflowVisible (1), OverflowScroll (2), OverflowAuto (3) If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned

func GetPerspectiveOrigin

func GetPerspectiveOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit)

GetPerspectiveOrigin returns a x- and y-coordinate of the position at which the viewer is looking. It is used as the vanishing point by the Perspective property. The default value is (50%, 50%). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerCancelListeners

func GetPointerCancelListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerCancelListeners returns the "pointer-cancel" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerDownListeners

func GetPointerDownListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerDownListeners returns the "pointer-down" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerMoveListeners

func GetPointerMoveListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerMoveListeners returns the "pointer-move" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerOutListeners

func GetPointerOutListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerOutListeners returns the "pointer-out" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerOverListeners

func GetPointerOverListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerOverListeners returns the "pointer-over" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPointerUpListeners

func GetPointerUpListeners(view View, subviewID ...string) []func(View, PointerEvent)

GetPointerUpListeners returns the "pointer-up" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetProgressBarMax

func GetProgressBarMax(view View, subviewID ...string) float64

GetProgressBarMax returns the max value of ProgressBar subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetProgressBarValue

func GetProgressBarValue(view View, subviewID ...string) float64

GetProgressBarValue returns the value of ProgressBar subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetPushDuration added in v0.18.0

func GetPushDuration(view View, subviewID ...string) float64

GetPushDuration returns the length of time in seconds that an push/pop StackLayout animation takes to complete. If the second argument (subviewID) is not specified or it is "" then a width of the first argument (view) is returned

func GetPushTiming added in v0.18.0

func GetPushTiming(view View, subviewID ...string) string

GetPushTiming returns the function which sets how an push/pop animation progresses. If the second argument (subviewID) is not specified or it is "" then a width of the first argument (view) is returned

func GetResize added in v0.7.0

func GetResize(view View, subviewID ...string) int

GetResize returns the "resize" property value if the subview. One of the following values is returned: NoneResize (0), BothResize (1), HorizontalResize (2), or VerticalResize (3) If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned

func GetResizeListeners

func GetResizeListeners(view View, subviewID ...string) []func(View, Frame)

GetResizeListeners returns the list of "resize-event" listeners. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then the listeners list of the first argument (view) is returned

func GetScale

func GetScale(view View, subviewID ...string) (float64, float64, float64)

GetScale returns a x-, y-, and z-axis scaling value of a 2D/3D scale. The default value is 1. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetScrollListeners

func GetScrollListeners(view View, subviewID ...string) []func(View, Frame)

GetScrollListeners returns the list of "scroll-event" listeners. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then the listeners list of the first argument (view) is returned

func GetSemantics

func GetSemantics(view View, subviewID ...string) int

GetSemantics returns the subview semantics. Valid semantics values are DefaultSemantics (0), ArticleSemantics (1), SectionSemantics (2), AsideSemantics (3), HeaderSemantics (4), MainSemantics (5), FooterSemantics (6), NavigationSemantics (7), FigureSemantics (8), FigureCaptionSemantics (9), ButtonSemantics (10), ParagraphSemantics (11), H1Semantics (12) - H6Semantics (17), BlockquoteSemantics (18), and CodeSemantics (19). If the second argument (subviewID) is not specified or it is "" then a semantics of the first argument (view) is returned

func GetSkew

func GetSkew(view View, subviewID ...string) (AngleUnit, AngleUnit)

GetSkew returns a angles to use to distort the element along the abscissa (x-axis) and the ordinate (y-axis). The default value is 0. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetString

func GetString(tag, lang string) (string, bool)

GetString returns the text for the language which is defined by "lang" parameter

func GetStyle

func GetStyle(view View, subviewID ...string) string

GetStyle returns the subview style id. If the second argument (subviewID) is not specified or it is "" then a style of the first argument (view) is returned

func GetSvgImageViewHorizontalAlign added in v0.12.0

func GetSvgImageViewHorizontalAlign(view View, subviewID ...string) int

GetSvgImageViewHorizontalAlign return the vertical align of an SvgImageView subview: LeftAlign (0), RightAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetSvgImageViewVerticalAlign added in v0.12.0

func GetSvgImageViewVerticalAlign(view View, subviewID ...string) int

GetSvgImageViewVerticalAlign return the vertical align of an SvgImageView subview: TopAlign (0), BottomAlign (1), CenterAlign (2) If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetTabIndex added in v0.11.0

func GetTabIndex(view View, subviewID ...string) int

GetTabIndex returns the subview tab-index. If the second argument (subviewID) is not specified or it is "" then a tab-index of the first argument (view) is returned

func GetTabSize added in v0.9.0

func GetTabSize(view View, subviewID ...string) int

GetTabSize returns the subview width of tab characters (U+0009) in spaces. If the second argument (subviewID) is not specified or it is "" then a width of the first argument (view) is returned

func GetTableCellClickedListeners added in v0.5.0

func GetTableCellClickedListeners(view View, subviewID ...string) []func(TableView, int, int)

GetTableCellClickedListeners returns listeners of event which occurs when the user clicks on a table cell. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableCellSelectedListeners added in v0.5.0

func GetTableCellSelectedListeners(view View, subviewID ...string) []func(TableView, int, int)

GetTableCellSelectedListeners returns listeners of event which occurs when a table cell becomes selected. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableFootHeight added in v0.5.0

func GetTableFootHeight(view View, subviewID ...string) int

GetTableFootHeight returns the number of rows in the table footer. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableHeadHeight added in v0.5.0

func GetTableHeadHeight(view View, subviewID ...string) int

GetTableHeadHeight returns the number of rows in the table header. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableRowClickedListeners added in v0.5.0

func GetTableRowClickedListeners(view View, subviewID ...string) []func(TableView, int)

GetTableRowClickedListeners returns listeners of event which occurs when the user clicks on a table row. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableRowSelectedListeners added in v0.5.0

func GetTableRowSelectedListeners(view View, subviewID ...string) []func(TableView, int)

GetTableRowSelectedListeners returns listeners of event which occurs when a table row becomes selected. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableSelectionMode added in v0.5.0

func GetTableSelectionMode(view View, subviewID ...string) int

GetTableSelectionMode returns the mode of the TableView elements selection. Valid values are NoneSelection (0), CellSelection (1), and RowSelection (2). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTableVerticalAlign added in v0.5.0

func GetTableVerticalAlign(view View, subviewID ...string) int

GetTableVerticalAlign returns a vertical align in a TableView cell. Returns one of next values: TopAlign (0), BottomAlign (1), CenterAlign (2), and BaselineAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetText

func GetText(view View, subviewID ...string) string

GetText returns a text of the EditView subview. If the second argument (subviewID) is not specified or it is "" then a text of the first argument (view) is returned.

func GetTextAlign

func GetTextAlign(view View, subviewID ...string) int

GetTextAlign returns a text align of the subview. Returns one of next values:

LeftAlign = 0, RightAlign = 1, CenterAlign = 2, JustifyAlign = 3

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextChangedListeners

func GetTextChangedListeners(view View, subviewID ...string) []func(EditView, string, string)

GetTextChangedListeners returns the TextChangedListener list of an EditView or MultiLineEditView subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextDirection

func GetTextDirection(view View, subviewID ...string) int

GetTextDirection - returns a direction of text, table columns, and horizontal overflow. Valid values are SystemTextDirection (0), LeftToRightDirection (1), and RightToLeftDirection (2). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextLineStyle

func GetTextLineStyle(view View, subviewID ...string) int

GetTextLineStyle returns the stroke style of the decoration line that is used on text in an element, such as a line-through, underline, or overline. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextOverflow

func GetTextOverflow(view View, subviewID ...string) int

GetTextOverflow returns a value of the "text-overflow" property: TextOverflowClip (0) or TextOverflowEllipsis (1). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextTransform

func GetTextTransform(view View, subviewID ...string) int

GetTextTransform returns a text transform of the subview. Return one of next values: NoneTextTransform (0), CapitalizeTextTransform (1), LowerCaseTextTransform (2) or UpperCaseTextTransform (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextWeight

func GetTextWeight(view View, subviewID ...string) int

GetTextWeight returns a text weight of the subview. Returns one of next values: 1, 2, 3, 4 (normal text), 5, 6, 7 (bold text), 8 and 9 If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextWrap added in v0.16.0

func GetTextWrap(view View, subviewID ...string) int

GetTextAlign returns how text inside of the subview is wrapped. Returns one of next values:

TextWrapOn = 0, TextWrapOff = 1, TextWrapBalance = 3

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTimeChangedListeners

func GetTimeChangedListeners(view View, subviewID ...string) []func(TimePicker, time.Time, time.Time)

GetTimeChangedListeners returns the TimeChangedListener list of an TimePicker subview. If there are no listeners then the empty list is returned If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTimePickerMax

func GetTimePickerMax(view View, subviewID ...string) (time.Time, bool)

GetTimePickerMax returns the max time of TimePicker subview and "true" as the second value if the min time is set, "false" as the second value otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTimePickerMin

func GetTimePickerMin(view View, subviewID ...string) (time.Time, bool)

GetTimePickerMin returns the min time of TimePicker subview and "true" as the second value if the min time is set, "false" as the second value otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTimePickerStep

func GetTimePickerStep(view View, subviewID ...string) int

GetTimePickerStep returns the time changing step in seconds of TimePicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTimePickerValue

func GetTimePickerValue(view View, subviewID ...string) time.Time

GetTimePickerValue returns the time of TimePicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTooltip added in v0.13.0

func GetTooltip(view View, subviewID ...string) string

GetTooltip returns a tooltip text of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTouchCancelListeners

func GetTouchCancelListeners(view View, subviewID ...string) []func(View, TouchEvent)

GetTouchCancelListeners returns the "touch-cancel" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTouchEndListeners

func GetTouchEndListeners(view View, subviewID ...string) []func(View, TouchEvent)

GetTouchEndListeners returns the "touch-end" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTouchMoveListeners

func GetTouchMoveListeners(view View, subviewID ...string) []func(View, TouchEvent)

GetTouchMoveListeners returns the "touch-move" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTouchStartListeners

func GetTouchStartListeners(view View, subviewID ...string) []func(View, TouchEvent)

GetTouchStartListeners returns the "touch-start" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransformOrigin added in v0.18.0

func GetTransformOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)

GetTransformOrigin returns a x-, y-, and z-coordinate of the point around which a view transformation is applied. The default value is (50%, 50%, 50%). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransitionCancelListeners added in v0.2.0

func GetTransitionCancelListeners(view View, subviewID ...string) []func(View, string)

GetTransitionCancelListeners returns the "transition-cancel-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransitionEndListeners added in v0.2.0

func GetTransitionEndListeners(view View, subviewID ...string) []func(View, string)

GetTransitionEndListeners returns the "transition-end-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransitionRunListeners added in v0.2.0

func GetTransitionRunListeners(view View, subviewID ...string) []func(View, string)

GetTransitionRunListeners returns the "transition-run-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransitionStartListeners added in v0.2.0

func GetTransitionStartListeners(view View, subviewID ...string) []func(View, string)

GetTransitionStartListeners returns the "transition-start-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransitions added in v0.9.0

func GetTransitions(view View, subviewID ...string) map[PropertyName]AnimationProperty

GetTransitions returns the subview transitions. The result is always non-nil. If the second argument (subviewID) is not specified or it is "" then transitions of the first argument (view) is returned

func GetTranslate

func GetTranslate(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)

GetTranslate returns a x-, y-, and z-axis translation value of a 2D/3D translation If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetVerticalAlign

func GetVerticalAlign(view View, subviewID ...string) int

GetVerticalAlign return the vertical align of a list: TopAlign (0), BottomAlign (1), CenterAlign (2), StretchAlign (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetVerticalTextOrientation

func GetVerticalTextOrientation(view View, subviewID ...string) int

GetVerticalTextOrientation returns a orientation of the text characters in a line. It only affects text in vertical mode (when "writing-mode" is "vertical-right-to-left" or "vertical-left-to-right"). Valid values are MixedTextOrientation (0), UprightTextOrientation (1), and SidewaysTextOrientation (2). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetVisibility

func GetVisibility(view View, subviewID ...string) int

GetVisibility returns the subview visibility. One of the following values is returned: Visible (0), Invisible (1), or Gone (2) If the second argument (subviewID) is not specified or it is "" then a visibility of the first argument (view) is returned

func GetWritingMode

func GetWritingMode(view View, subviewID ...string) int

GetWritingMode returns whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. Valid values are HorizontalTopToBottom (0), HorizontalBottomToTop (1), VerticalRightToLeft (2) and VerticalLeftToRight (3) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetZIndex

func GetZIndex(view View, subviewID ...string) int

GetZIndex returns the subview z-order. If the second argument (subviewID) is not specified or it is "" then a z-order of the first argument (view) is returned

func InitCustomView

func InitCustomView(customView CustomView, tag string, session Session, params Params) bool

InitCustomView initializes fields of CustomView by default values

func InlineImageFromResource added in v0.12.0

func InlineImageFromResource(filename string) (string, bool)

InlineImageFromResource reads image from resources and converts it to an inline image. Supported png, jpeg, gif, and svg files

func InsertView

func InsertView(rootView View, containerID string, view View, index int) bool

Insert inserts a view to the "index" position in the list of a view children

func IsAnimationPaused added in v0.2.0

func IsAnimationPaused(view View, subviewID ...string) bool

IsAnimationPaused returns "true" if an animation of the subview is paused, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsCheckboxChecked

func IsCheckboxChecked(view View, subviewID ...string) bool

IsCheckboxChecked returns true if the Checkbox is checked, false otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsColumnSpanAll added in v0.11.0

func IsColumnSpanAll(view View, subviewID ...string) bool

IsColumnSpanAll returns a "column-span-all" property value of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsDetailsExpanded

func IsDetailsExpanded(view View, subviewID ...string) bool

IsDetailsExpanded returns a value of the Expanded property of DetailsView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsDisabled

func IsDisabled(view View, subviewID ...string) bool

IsDisabled returns "true" if the subview is disabled If the second argument (subviewID) is not specified or it is "" then a state of the first argument (view) is returned

func IsEditViewWrap

func IsEditViewWrap(view View, subviewID ...string) bool

IsEditViewWrap returns a value of the EditWrap property of MultiLineEditView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsItalic

func IsItalic(view View, subviewID ...string) bool

IsItalic returns "true" if a text font of the subview is displayed in italics, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsListViewCheckedItem

func IsListViewCheckedItem(view View, subviewID string, index int) bool

IsListViewCheckedItem returns true if the ListView item with index is checked, false otherwise. If the second argument (subviewID) is "" then a value from the first argument (view) is returned.

func IsMediaPlayerEnded

func IsMediaPlayerEnded(view View, playerID string) bool

IsMediaPlayerEnded function tells whether the media element is ended.

func IsMediaPlayerPaused

func IsMediaPlayerPaused(view View, playerID string) bool

IsMediaPlayerPaused function tells whether the media element is paused.

func IsMoveToFrontAnimation added in v0.18.0

func IsMoveToFrontAnimation(view View, subviewID ...string) bool

IsMoveToFrontAnimation returns "true" if an animation is used when calling the MoveToFront/MoveToFrontByID method of StackLayout interface. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsMultipleFilePicker added in v0.3.0

func IsMultipleFilePicker(view View, subviewID ...string) bool

IsMultipleFilePicker returns "true" if multiple files can be selected in the FilePicker, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsOverline

func IsOverline(view View, subviewID ...string) bool

IsOverline returns "true" if a text font of the subview is displayed overlined, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsReadOnly

func IsReadOnly(view View, subviewID ...string) bool

IsReadOnly returns the true if a EditView works in read only mode. If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned.

func IsSmallCaps

func IsSmallCaps(view View, subviewID ...string) bool

IsSmallCaps returns "true" if a text font of the subview is displayed in small caps, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsSpellcheck

func IsSpellcheck(view View, subviewID ...string) bool

IsSpellcheck returns a value of the Spellcheck property of EditView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsStrikethrough

func IsStrikethrough(view View, subviewID ...string) bool

IsStrikethrough returns "true" if a text font of the subview is displayed strikethrough, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsSummaryMarkerHidden added in v0.18.0

func IsSummaryMarkerHidden(view View, subviewID ...string) bool

IsDetailsExpanded returns a value of the HideSummaryMarker property of DetailsView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsTimingFunctionValid added in v0.9.0

func IsTimingFunctionValid(timingFunction string, session Session) bool

IsTimingFunctionValid returns "true" if the "timingFunction" argument is the valid timing function.

func IsUnderline

func IsUnderline(view View, subviewID ...string) bool

IsUnderline returns "true" if a text font of the subview is displayed underlined, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func IsUserSelect added in v0.8.0

func IsUserSelect(view View, subviewID ...string) bool

IsUserSelect returns "true" if the user can select text, "false" otherwise. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func LastError added in v0.3.0

func LastError() string

LastError returns the last error text

func LoadFilePickerFile added in v0.3.0

func LoadFilePickerFile(view View, subviewID string, file FileInfo, result func(FileInfo, []byte))

LoadFilePickerFile loads the content of the selected file. This function is asynchronous. The "result" function will be called after loading the data. If the second argument (subviewID) is "" then the file from the first argument (view) is loaded

func MediaPlayerCurrentTime

func MediaPlayerCurrentTime(view View, playerID string) float64

MediaPlayerCurrentTime returns the current playback time in seconds.

func MediaPlayerDuration

func MediaPlayerDuration(view View, playerID string) float64

MediaPlayerDuration returns the value indicating the total duration of the media in seconds. If no media data is available, the returned value is NaN.

func MediaPlayerPause

func MediaPlayerPause(view View, playerID string)

MediaPlayerPause will pause playback of the media, if the media is already in a paused state this method will have no effect.

func MediaPlayerPlay

func MediaPlayerPlay(view View, playerID string)

MediaPlayerPlay attempts to begin playback of the media.

func MediaPlayerPlaybackRate

func MediaPlayerPlaybackRate(view View, playerID string) float64

MediaPlayerPlaybackRate returns the rate at which the media is being played back.

func MediaPlayerVolume

func MediaPlayerVolume(view View, playerID string) float64

Volume returns the audio volume, from 0.0 (silent) to 1.0 (loudest).

func NewHandler added in v0.13.3

func NewHandler(urlPrefix string, createContentFunc func(Session) SessionContent, params AppParams) *httpHandler

NewHandler is used to embed the rui application in third-party web frameworks (net/http, gin, echo...).

Example for echo:

e := echo.New()
e.Any(`/ui/*`, func()echo.HandlerFunc{
	rui.AddEmbedResources(&resources)

	h := rui.NewHandler("/ui", CreateSessionContent, rui.AppParams{
		Title: `Awesome app`,
		Icon: `favicon.png`,
	})

	return func(c echo.Context) error {
		h.ServeHTTP(c.Response(), c.Request())
		return nil
	}
})

func OpenBrowser

func OpenBrowser(url string) bool

OpenBrowser open browser with specific URL locally. Useful for applications which run on local machine or for debug purposes.

func OpenRawResource added in v0.17.0

func OpenRawResource(filename string) fs.File

OpenRawResource returns the contents of the raw resource with the specified name

func ReadRawResource

func ReadRawResource(filename string) []byte

ReadRawResource returns the contents of the raw resource with the specified name

func RedrawCanvasView

func RedrawCanvasView(rootView View, canvasViewID string)

RedrawCanvasView finds CanvasView with canvasViewID and redraws it

func RegisterViewCreator

func RegisterViewCreator(tag string, creator func(Session) View) bool

RegisterViewCreator register function of creating view

func ReloadListViewData

func ReloadListViewData(view View, subviewID ...string)

ReloadListViewData updates ListView content If the second argument (subviewID) is not specified or it is "" then content the first argument (view) is updated.

func ReloadTableViewCell added in v0.13.0

func ReloadTableViewCell(row, column int, view View, subviewID ...string) bool

ReloadTableViewCell updates the given table cell. If the last argument (subviewID) is not specified or it is "" then updates the cell of the first argument (TableView).

func ReloadTableViewData added in v0.6.0

func ReloadTableViewData(view View, subviewID ...string) bool

ReloadTableViewData updates TableView If the second argument (subviewID) is not specified or it is "" then updates the first argument (TableView).

func ScrollViewTo

func ScrollViewTo(view View, subviewID string, x, y float64)

ScrollTo scrolls the view's content to the given position. If the second argument (subviewID) is "" then the first argument (view) is used

func ScrollViewToEnd

func ScrollViewToEnd(view View, subviewID ...string)

ScrollViewToEnd scrolls the view's content to the end of view. If the second argument (subviewID) is not specified or it is "" then the first argument (view) is used

func ScrollViewToStart

func ScrollViewToStart(view View, subviewID ...string)

ScrollViewToEnd scrolls the view's content to the start of view. If the second argument (subviewID) is not specified or it is "" then the first argument (view) is used

func Set

func Set(rootView View, viewID string, tag PropertyName, value any) bool

Set sets the property with name "tag" of the "rootView" subview with "viewID" id by value. Result:

  • true - success,
  • false - error (incompatible type or invalid format of a string value, see AppLog).

If the second argument (subviewID) is "" then a listener for the first argument (view) is set

func SetAnimated

func SetAnimated(rootView View, viewID string, tag PropertyName, value any, animation AnimationProperty) bool

SetAnimated sets the property with name "tag" of the "rootView" subview with "viewID" id by value. Result: true - success, false - error (incompatible type or invalid format of a string value, see AppLog).

func SetChangeListener added in v0.4.0

func SetChangeListener(view View, viewID string, tag PropertyName, listener func(View, PropertyName))

SetChangeListener sets a listener for changing a subview property value.

If the second argument (subviewID) is "" then a listener for the first argument (view) is set

func SetDebugLog

func SetDebugLog(f func(string))

SetDebugLog sets a function for outputting debug info. The default value is nil (debug info is ignored)

func SetErrorLog

func SetErrorLog(f func(string))

SetErrorLog sets a function for outputting error messages. The default value is log.Println(text)

func SetMediaPlayerCurrentTime

func SetMediaPlayerCurrentTime(view View, playerID string, seconds float64)

SetMediaPlayerCurrentTime sets the current playback time in seconds.

func SetMediaPlayerPlaybackRate

func SetMediaPlayerPlaybackRate(view View, playerID string, rate float64)

SetMediaPlayerPlaybackRate sets the rate at which the media is being played back. This is used to implement user controls for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.

func SetMediaPlayerVolume

func SetMediaPlayerVolume(view View, playerID string, volume float64)

SetVolume sets the audio volume, from 0.0 (silent) to 1.0 (loudest).

func SetParams

func SetParams(rootView View, viewID string, params Params) bool

SetParams sets properties with name "tag" of the "rootView" subview. Result:

  • true - all properties were set successful,
  • false - error (incompatible type or invalid format of a string value, see AppLog).

func SetResourcePath

func SetResourcePath(path string)

SetResourcePath set path of the resource directory

func SetWidth added in v0.18.0

func SetWidth[T SizeUnit | float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](size T, view View, subviewID ...string) bool

func ShowCancellableQuestion

func ShowCancellableQuestion(title, text string, session Session, onYes func(), onNo func(), onCancel func())

ShowCancellableQuestion displays a message with the given title and text and three buttons "Yes", "No" and "Cancel".

When the "Yes", "No" or "Cancel" button is pressed, the message is closed and the onYes, onNo or onCancel function (if it is not nil) is called, respectively.

func ShowMessage

func ShowMessage(title, text string, session Session)

ShowMessage displays the popup with the title given in the "title" argument and the message text given in the "text" argument.

func ShowQuestion

func ShowQuestion(title, text string, session Session, onYes func(), onNo func())

ShowQuestion displays a message with the given title and text and two buttons "Yes" and "No".

When the "Yes" button is clicked, the message is closed and the onYes function is called (if it is not nil).

When the "No" button is pressed, the message is closed and the onNo function is called (if it is not nil).

func StartApp added in v0.5.0

func StartApp(addr string, createContentFunc func(Session) SessionContent, params AppParams)

StartApp - create the new application and start it

func StepsTiming

func StepsTiming(stepCount int) string

StepsTiming return a timing function along stepCount stops along the transition, displaying each stop for equal lengths of time

func UpdateContent added in v0.16.0

func UpdateContent(view View, subviewID ...string)

UpdateContent updates child Views of ListLayout/GridLayout subview if the "content" property value is set to ListAdapter/GridAdapter, otherwise does nothing. If the second argument (subviewID) is not specified or it is "" then the first argument (view) updates.

Types

type AbsoluteLayout

type AbsoluteLayout interface {
	ViewsContainer
}

AbsoluteLayout represent an AbsoluteLayout view where child views can be arbitrary positioned

func NewAbsoluteLayout

func NewAbsoluteLayout(session Session, params Params) AbsoluteLayout

NewAbsoluteLayout create new AbsoluteLayout object and return it

type AngleUnit

type AngleUnit struct {
	// Type of the angle value
	Type AngleUnitType

	// Value of the angle in Type units
	Value float64
}

AngleUnit used to represent an angular values

func Deg

func Deg[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) AngleUnit

Deg creates AngleUnit with Degree type

func GetRotate

func GetRotate(view View, subviewID ...string) (float64, float64, float64, AngleUnit)

GetRotate returns a x-, y, z-coordinate of the vector denoting the axis of rotation, and the angle of the view rotation If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func Grad

func Grad[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) AngleUnit

Grad create AngleUnit with Gradian type

func PiRad

func PiRad[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) AngleUnit

PiRad create AngleUnit with PiRadian type

func Rad

func Rad[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) AngleUnit

Rad create AngleUnit with Radian type

func StringToAngleUnit

func StringToAngleUnit(value string) (AngleUnit, bool)

StringToAngleUnit converts the string argument to AngleUnit

func (AngleUnit) Equal

func (angle AngleUnit) Equal(size2 AngleUnit) bool

Equal compare two AngleUnit. Return true if AngleUnit are equal

func (AngleUnit) String

func (angle AngleUnit) String() string

String - convert AngleUnit to string

func (AngleUnit) ToDegree

func (angle AngleUnit) ToDegree() AngleUnit

ToDegree returns the angle in degrees

func (AngleUnit) ToGradian

func (angle AngleUnit) ToGradian() AngleUnit

ToGradian returns the angle in gradians (1⁄400 of a full circle)

func (AngleUnit) ToRadian

func (angle AngleUnit) ToRadian() AngleUnit

ToDegree returns the angle in radians

func (AngleUnit) ToTurn

func (angle AngleUnit) ToTurn() AngleUnit

ToTurn returns the angle in turns (1 turn = 360 degree)

type AngleUnitType

type AngleUnitType uint8

AngleUnitType : type of enumerated constants for define a type of AngleUnit value. Can take the following values: Radian, Degree, Gradian, and Turn

const (
	// Radian - angle in radians
	Radian AngleUnitType = 0

	// Radian - angle in radians * π
	PiRadian AngleUnitType = 1

	// Degree - angle in degrees
	Degree AngleUnitType = 2

	// Gradian - angle in gradian (1⁄400 of a full circle)
	Gradian AngleUnitType = 3

	// Turn - angle in turns (1 turn = 360 degree)
	Turn AngleUnitType = 4
)

Constants which represent values or the AngleUnitType

type AnimatedProperty added in v0.2.0

type AnimatedProperty struct {
	// Tag is the name of the property
	Tag PropertyName
	// From is the initial value of the property
	From any
	// To is the final value of the property
	To any
	// KeyFrames is intermediate property values
	KeyFrames map[int]any
}

AnimatedProperty describes the change script of one property

type AnimationProperty added in v0.18.0

type AnimationProperty interface {
	Properties
	fmt.Stringer

	// Start starts the animation for the view specified by the first argument.
	// The second argument specifies the animation event listener (can be nil)
	Start(view View, listener func(view View, animation AnimationProperty, event PropertyName)) bool
	// Stop stops the animation
	Stop()
	// Pause pauses the animation
	Pause()
	// Resume resumes an animation that was stopped using the Pause method
	Resume()
	// contains filtered or unexported methods
}

AnimationProperty interface is used to set animation parameters. Used properties:

"property", "id", "duration", "delay", "timing-function", "iteration-count", and "animation-direction"

func GetAnimation added in v0.2.0

func GetAnimation(view View, subviewID ...string) []AnimationProperty

GetAnimation returns the subview animations. The result is always non-nil. If the second argument (subviewID) is not specified or it is "" then transitions of the first argument (view) is returned

func GetTransition added in v0.2.0

func GetTransition(view View, subviewID string, tag PropertyName) AnimationProperty

GetTransition returns the subview property transition. If there is no transition for the given property then nil is returned. If the second argument (subviewID) is not specified or it is "" then transitions of the first argument (view) is returned

func NewAnimation added in v0.2.0

func NewAnimation(id string, timingFunc string, duration float64, delay float64, direction int, iterationCount int, property AnimatedProperty, properties ...AnimatedProperty) AnimationProperty

NewTransitionAnimation creates the animation scenario.

  • id - specifies the animation identifier.
  • timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used;
  • duration - specifies the length of time in seconds that an animation takes to complete one cycle. Must be > 0;
  • delay - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation.
  • direction - specifies whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. Only the following values ​​can be used: 0 (NormalAnimation), 1 (ReverseAnimation), 2 (AlternateAnimation), and 3 (AlternateReverseAnimation);
  • iterationCount - specifies the number of times an animation sequence should be played before stopping. A negative value specifies infinite repetition;
  • property, properties - describes a scenario for changing a View's property.

func NewAnimationProperty added in v0.18.0

func NewAnimationProperty(params Params) AnimationProperty

NewAnimationProperty creates a new animation object and return its interface

The following properties can be used:

  • "id" (ID) - specifies the animation identifier. Used only for animation script.
  • "duration" (Duration) - specifies the length of time in seconds that an animation takes to complete one cycle;
  • "delay" (Delay) - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation;
  • "timing-function" (TimingFunction) - specifies how an animation progresses through the duration of each cycle;
  • "iteration-count" (IterationCount) - specifies the number of times an animation sequence should be played before stopping. Used only for animation script;
  • "animation-direction" (AnimationDirection) - specifies whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. Used only for animation script;
  • "property" (PropertyTag) - describes a scenario for changing a View's property. Used only for animation script.

func NewTransitionAnimation added in v0.18.0

func NewTransitionAnimation(timingFunc string, duration float64, delay float64) AnimationProperty

NewTransitionAnimation creates animation data for the transition.

  • timingFunc - specifies how an animation progresses through the duration of each cycle. If it is "" then "easy" function is used;
  • duration - specifies the length of time in seconds that an animation takes to complete one cycle. Must be > 0;
  • delay - specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning or immediately and partway through the animation.

type AppParams added in v0.5.0

type AppParams struct {
	// Title - title of the app window/tab
	Title string

	// TitleColor - background color of the app window/tab (applied only for Safari and Chrome for Android)
	TitleColor Color

	// Icon - the icon file name
	Icon string

	// CertFile - path of a certificate for the server must be provided
	// if neither the Server's TLSConfig.Certificates nor TLSConfig.GetCertificate are populated.
	// If the certificate is signed by a certificate authority, the certFile should be the concatenation
	// of the server's certificate, any intermediates, and the CA's certificate.
	CertFile string

	AutoCertDomain string

	// KeyFile - path of a private key for the server must be provided
	// if neither the Server's TLSConfig.Certificates nor TLSConfig.GetCertificate are populated.
	KeyFile string

	// Redirect80 - if true then the function of redirect from port 80 to 443 is created
	Redirect80 bool

	// NoSocket - if true then WebSockets will not be used and information exchange
	// between the client and the server will be carried out only via http.
	NoSocket bool

	// SocketAutoClose - time in seconds after which the socket is automatically closed for an inactive session.
	// The countdown begins after the OnPause event arrives.
	// If the value of this property is less than or equal to 0 then the socket is not closed.
	SocketAutoClose int
}

AppParams defines parameters of the app

type Application

type Application interface {
	// Finish finishes the application
	Finish()

	// Params returns application parameters set by StartApp function
	Params() AppParams
	// contains filtered or unexported methods
}

Application represent generic application interface, see also Session

type AudioPlayer

type AudioPlayer interface {
	MediaPlayer
}

AudioPlayer is a type of a View which can play audio files

func AudioPlayerByID

func AudioPlayerByID(rootView View, id string, ids ...string) AudioPlayer

AudioPlayerByID return the AudioPlayer path to which is specified using the arguments id, ids. Example

view := AudioPlayerByID(rootView, "id1", "id2", "id3")
view := AudioPlayerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not AudioPlayer, the function will return nil

func NewAudioPlayer

func NewAudioPlayer(session Session, params Params) AudioPlayer

NewAudioPlayer create new MediaPlayer object and return it

type BackgroundElement

type BackgroundElement interface {
	Properties
	fmt.Stringer

	// Tag returns type of the background element.
	// Possible values are: "image", "conic-gradient", "linear-gradient" and "radial-gradient"
	Tag() string

	// Clone creates a new copy of BackgroundElement
	Clone() BackgroundElement
	// contains filtered or unexported methods
}

BackgroundElement describes the background element

func GetBackground added in v0.18.0

func GetBackground(view View, subviewID ...string) []BackgroundElement

GetBackground returns the view background.

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMask added in v0.18.0

func GetMask(view View, subviewID ...string) []BackgroundElement

GetMask returns the view mask.

If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func NewBackgroundConicGradient added in v0.6.0

func NewBackgroundConicGradient(params Params) BackgroundElement

NewBackgroundConicGradient creates the new background conic gradient

The following properties can be used:

  • "gradient" Gradient - Describes gradient stop points. This is a mandatory property while describing background gradients.
  • "center-x" CenterX - center X point of the gradient.
  • "center-y" CenterY - center Y point of the gradient.
  • "from" From - start angle position of the gradient.
  • "repeating" Repeating - Defines whether stop points needs to be repeated after the last one.

func NewBackgroundImage

func NewBackgroundImage(params Params) BackgroundElement

NewBackgroundImage creates the new background image

The following properties can be used:

  • "src" Source - the name of the image in the "images" folder of the resources, or the URL of the image or inline-image.
  • "width" Width - the width of the image.
  • "height" Height - the height of the image.
  • "image-horizontal-align" ImageHorizontalAlign - the horizontal alignment of the image relative to view's bounds.
  • "image-vertical-align" ImageVerticalAlign - the vertical alignment of the image relative to view's bounds.
  • "repeat" Repeat - the repetition of the image.
  • "fit" Fit - the image scaling parameters.
  • "attachment" Attachment - defines whether a background image's position is fixed within the viewport or scrolls with its containing block.

func NewBackgroundLinearGradient

func NewBackgroundLinearGradient(params Params) BackgroundElement

NewBackgroundLinearGradient creates the new background linear gradient.

The following properties can be used:

  • "gradient" Gradient - Describes gradient stop points. This is a mandatory property while describing background gradients.
  • "direction" Direction - Defines the direction of the gradient line.
  • "repeating" Repeating - Defines whether stop points needs to be repeated after the last one.

func NewBackgroundRadialGradient

func NewBackgroundRadialGradient(params Params) BackgroundElement

NewBackgroundRadialGradient creates the new background radial gradient.

The following properties can be used:

  • "gradient" (Gradient) - Describes gradient stop points. This is a mandatory property while describing background gradients.
  • "center-x" (CenterX), "center-y" (CenterY) - Defines the gradient center point cooordinates.
  • "radial-gradient-radius" (RadialGradientRadius) - Defines radius of the radial gradient.
  • "radial-gradient-shape" (RadialGradientShape) - Defines shape of the radial gradient.
  • "repeating" (Repeating) - Defines whether stop points needs to be repeated after the last one.

func NewCircleRadialGradient added in v0.18.0

func NewCircleRadialGradient[radiusType SizeUnit | RadialGradientRadiusType](xCenter, yCenter SizeUnit, radius radiusType, repeating bool, point1 GradientPoint, point2 GradientPoint, points ...GradientPoint) BackgroundElement

NewCircleRadialGradient creates the new background circle radial gradient.

func NewEllipseRadialGradient added in v0.18.0

func NewEllipseRadialGradient[radiusType []SizeUnit | RadialGradientRadiusType](xCenter, yCenter SizeUnit, radius radiusType, repeating bool, point1 GradientPoint, point2 GradientPoint, points ...GradientPoint) BackgroundElement

NewEllipseRadialGradient creates the new background ellipse radial gradient.

func NewLinearGradient added in v0.18.0

func NewLinearGradient[DirectionType LinearGradientDirectionType | AngleUnit](direction DirectionType, repeating bool, point1 GradientPoint, point2 GradientPoint, points ...GradientPoint) BackgroundElement

NewLinearGradient creates the new background linear gradient.

type BackgroundGradientAngle added in v0.6.0

type BackgroundGradientAngle struct {
	// Color - the color of the key angle. Must not be nil.
	// Can take a value of Color type or string (color constant or textual description of the color)
	Color any
	// Angle - the key angle. Optional (may be nil).
	// Can take a value of AngleUnit type or string (angle constant or textual description of the angle)
	Angle any
}

BackgroundGradientAngle defined an element of the conic gradient

func (*BackgroundGradientAngle) String added in v0.6.0

func (point *BackgroundGradientAngle) String() string

String convert internal representation of BackgroundGradientAngle into a string.

type BackgroundGradientPoint

type BackgroundGradientPoint struct {
	// Color - the color of the point. Must not be nil.
	// Can take a value of Color type or string (color constant or textual description of the color)
	Color any
	// Pos - the distance from the start of the gradient straight line. Optional (may be nil).
	// Can take a value of SizeUnit type or string (size constant or textual description of the SizeUnit)
	Pos any
}

BackgroundGradientPoint define point on gradient straight line

func (*BackgroundGradientPoint) String added in v0.14.0

func (point *BackgroundGradientPoint) String() string

String convert internal representation of BackgroundGradientPoint into a string.

type BorderProperty

type BorderProperty interface {
	Properties
	fmt.Stringer

	// ViewBorders returns top, right, bottom and left borders information all together
	ViewBorders(session Session) ViewBorders
	// contains filtered or unexported methods
}

BorderProperty is the interface of a view border data

func NewBorder

func NewBorder(params Params) BorderProperty

NewBorder creates the new BorderProperty. The following properties can be used:

"style" (Style). Determines the line style (int). Valid values: 0 (NoneLine), 1 (SolidLine), 2 (DashedLine), 3 (DottedLine), or 4 (DoubleLine);

"color" (ColorTag). Determines the line color (Color);

"width" (Width). Determines the line thickness (SizeUnit).

type Bounds

type Bounds struct {
	Top, Right, Bottom, Left SizeUnit
}

Bounds describe bounds of rectangle.

func DefaultBounds

func DefaultBounds() Bounds

DefaultBounds return bounds with Top, Right, Bottom and Left fields set to Auto

func GetMargin

func GetMargin(view View, subviewID ...string) Bounds

Margin returns the subview margin. If the second argument (subviewID) is not specified or it is "" then a margin of the first argument (view) is returned

func GetPadding

func GetPadding(view View, subviewID ...string) Bounds

GetPadding returns the subview padding. If the second argument (subviewID) is not specified or it is "" then a padding of the first argument (view) is returned

func (*Bounds) SetAll

func (bounds *Bounds) SetAll(value SizeUnit)

SetAll set the Top, Right, Bottom and Left field to the equal value

func (*Bounds) String

func (bounds *Bounds) String() string

String convert Bounds to string

type BoundsProperty

type BoundsProperty interface {
	Properties
	fmt.Stringer

	// Bounds returns top, right, bottom and left size of the bounds
	Bounds(session Session) Bounds
	// contains filtered or unexported methods
}

BorderProperty is an interface of a bounds property data

func NewBounds added in v0.18.0

func NewBounds[topType SizeUnit | int | float64, rightType SizeUnit | int | float64, bottomType SizeUnit | int | float64, leftType SizeUnit | int | float64](
	top topType, right rightType, bottom bottomType, left leftType) BoundsProperty

NewBounds creates the new BoundsProperty object.

The arguments specify the boundaries in a clockwise direction: "top", "right", "bottom", and "left".

If the argument is specified as int or float64, the value is considered to be in pixels.

func NewBoundsProperty

func NewBoundsProperty(params Params) BoundsProperty

NewBoundsProperty creates the new BoundsProperty object.

The following SizeUnit properties can be used: "left" (Left), "right" (Right), "top" (Top), and "bottom" (Bottom).

type BoxRadius

type BoxRadius struct {
	TopLeftX, TopLeftY, TopRightX, TopRightY, BottomLeftX, BottomLeftY, BottomRightX, BottomRightY SizeUnit
}

BoxRadius defines radii of rounds the corners of an element's outer border edge

func GetRadius

func GetRadius(view View, subviewID ...string) BoxRadius

Radius returns the BoxRadius structure of the subview. If the second argument (subviewID) is not specified or it is "" then a BoxRadius of the first argument (view) is returned.

func (BoxRadius) AllAnglesIsEqual

func (radius BoxRadius) AllAnglesIsEqual() bool

AllAnglesIsEqual returns 'true' if all angles is equal, 'false' otherwise

func (BoxRadius) String

func (radius BoxRadius) String() string

String returns a string representation of a BoxRadius struct

type Button

type Button interface {
	CustomView
}

Button represent a Button view

func ButtonByID

func ButtonByID(rootView View, id string, ids ...string) Button

ButtonByID return the Button path to which is specified using the arguments id, ids. Example

view := ButtonByID(rootView, "id1", "id2", "id3")
view := ButtonByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not Button, the function will return nil

func NewButton

func NewButton(session Session, params Params) Button

NewButton create new Button object and return it

type Canvas

type Canvas interface {
	// View return the view for the drawing
	View() CanvasView
	// Width returns the width in pixels of the canvas area
	Width() float64
	// Height returns the height in pixels of the canvas area
	Height() float64

	// Save saves the entire state of the canvas by pushing the current state onto a stack.
	Save()
	// Restore restores the most recently saved canvas state by popping the top entry
	// in the drawing state stack. If there is no saved state, this method does nothing.
	Restore()

	// ClipPath turns the rectangle into the current clipping region. It replaces any previous clipping region.
	ClipRect(x, y, width, height float64)
	// ClipPath turns the path into the current clipping region. It replaces any previous clipping region.
	ClipPath(path Path)

	// SetScale adds a scaling transformation to the canvas units horizontally and/or vertically.
	//   * x - scaling factor in the horizontal direction. A negative value flips pixels across
	//       the vertical axis. A value of 1 results in no horizontal scaling;
	//   * y - scaling factor in the vertical direction. A negative value flips pixels across
	//       the horizontal axis. A value of 1 results in no vertical scaling.
	SetScale(x, y float64)

	// SetTranslation adds a translation transformation to the current matrix.
	//   * x - distance to move in the horizontal direction. Positive values are to the right, and negative to the left;
	//   * y - distance to move in the vertical direction. Positive values are down, and negative are up.
	SetTranslation(x, y float64)

	// SetRotation adds a rotation to the transformation matrix.
	//   angle - the rotation angle, clockwise in radians
	SetRotation(angle float64)

	// SetTransformation multiplies the current transformation with the matrix described by the arguments
	// of this method. This lets you scale, rotate, translate (move), and skew the context.
	// The transformation matrix is described by:
	//  ⎡ xScale xSkew  dx ⎤
	//  ⎢ ySkew  yScale dy ⎥
	//  ⎣   0      0     1 ⎦
	// where
	//   * xScale, yScale - horizontal and vertical scaling. A value of 1 results in no scaling;
	//   * xSkew, ySkew - horizontal and vertical skewing;
	//   * dx, dy - horizontal and vertical translation (moving).
	SetTransformation(xScale, yScale, xSkew, ySkew, dx, dy float64)

	// ResetTransformation resets the current transform to the identity matrix
	ResetTransformation()

	// SetSolidColorFillStyle sets the color to use inside shapes
	SetSolidColorFillStyle(color Color)

	// SetSolidColorStrokeStyle sets color to use for the strokes (outlines) around shapes
	SetSolidColorStrokeStyle(color Color)

	// SetLinearGradientFillStyle sets a gradient along the line connecting two given coordinates to use inside shapes
	//   * x0, y0 - coordinates of the start point;
	//   * x1, y1 - coordinates of the end point;
	//   * startColor, endColor - the start and end color
	//   * stopPoints - the array of stop points
	SetLinearGradientFillStyle(x0, y0 float64, color0 Color, x1, y1 float64, color1 Color, stopPoints []GradientPoint)

	// SetLinearGradientStrokeStyle sets a gradient along the line connecting two given coordinates to use for the strokes (outlines) around shapes
	//   * x0, y0 - coordinates of the start point;
	//   * x1, y1 - coordinates of the end point;
	//   * color0, color1 - the start and end color
	//   * stopPoints - the array of stop points
	SetLinearGradientStrokeStyle(x0, y0 float64, color0 Color, x1, y1 float64, color1 Color, stopPoints []GradientPoint)

	// SetRadialGradientFillStyle sets a radial gradient using the size and coordinates of two circles
	// to use inside shapes
	//   * x0, y0 - coordinates of the center of the start circle;
	//   * r0 - the radius of the start circle;
	//   * x1, y1 - coordinates the center of the end circle;
	//   * r1 - the radius of the end circle;
	//   * color0, color1 - the start and end color
	//   * stopPoints - the array of stop points
	SetRadialGradientFillStyle(x0, y0, r0 float64, color0 Color, x1, y1, r1 float64, color1 Color, stopPoints []GradientPoint)

	// SetRadialGradientStrokeStyle sets a radial gradient using the size and coordinates of two circles
	// to use for the strokes (outlines) around shapes
	//   * x0, y0 - coordinates of the center of the start circle;
	//   * r0 - the radius of the start circle;
	//   * x1, y1 - coordinates the center of the end circle;
	//   * r1 - the radius of the end circle;
	//   * color0, color1 - the start and end color
	//   * stopPoints - the array of stop points
	SetRadialGradientStrokeStyle(x0, y0, r0 float64, color0 Color, x1, y1, r1 float64, color1 Color, stopPoints []GradientPoint)

	// SetConicGradientFillStyle sets a conic gradient around a point
	// to use inside shapes
	//   * x, y - coordinates of the center of the conic gradient in pilels;
	//   * startAngle - the angle at which to begin the gradient, in radians. The angle starts from a line going horizontally right from the center, and proceeds clockwise.
	//   * startColor - the start color;
	//   * endColor - the end color;
	//   * stopPoints - the array of stop points. The Pos field of GradientPoint, in the range from 0 to 1, specifies the angle in turns.
	SetConicGradientFillStyle(x, y, startAngle float64, startColor, endColor Color, stopPoints []GradientPoint)

	// SetConicGradientFillStyle sets a conic gradient around a point
	// to use inside shapes
	//   * x, y - coordinates of the center of the conic gradient in pilels;
	//   * startAngle - the angle at which to begin the gradient, in radians. The angle starts from a line going horizontally right from the center, and proceeds clockwise.
	//   * startColor - the start color;
	//   * endColor - the end color;
	//   * stopPoints - the array of stop points. The Pos field of GradientPoint, in the range from 0 to 1, specifies the angle in turns.
	SetConicGradientStrokeStyle(x, y, startAngle float64, startColor, endColor Color, stopPoints []GradientPoint)

	// SetImageFillStyle set the image as the filling pattern.
	//
	// repeat - indicating how to repeat the pattern's image. Possible values are:
	//   * NoRepeat (0) - neither direction,
	//   * RepeatXY (1) - both directions,
	//   * RepeatX (2) - horizontal only,
	//   * RepeatY (3) - vertical only.
	SetImageFillStyle(image Image, repeat int)

	// SetLineWidth the line width, in coordinate space units. Zero, negative, Infinity, and NaN values are ignored.
	SetLineWidth(width float64)

	// SetLineJoin sets the shape used to join two line segments where they meet.
	// Valid values: MiterJoin (0), RoundJoin (1), BevelJoin (2). All other values are ignored.
	SetLineJoin(join LineJoin)

	// SetLineJoin sets the shape used to draw the end points of lines.
	// Valid values: ButtCap (0), RoundCap (1), SquareCap (2). All other values are ignored.
	SetLineCap(cap LineCap)

	// SetLineDash sets the line dash pattern used when stroking lines.
	// dash - an array of values that specify alternating lengths of lines and gaps which describe the pattern.
	// offset - the line dash offset
	SetLineDash(dash []float64, offset float64)

	// SetFont sets the current text style to use when drawing text
	SetFont(name string, size SizeUnit)
	// SetFontWithParams sets the current text style to use when drawing text
	SetFontWithParams(name string, size SizeUnit, params FontParams)

	// TextWidth calculates metrics of the text drawn by a given font
	TextMetrics(text string, fontName string, fontSize SizeUnit, fontParams FontParams) TextMetrics

	// SetTextBaseline sets the current text baseline used when drawing text. Valid values:
	// AlphabeticBaseline (0), TopBaseline (1), MiddleBaseline (2), BottomBaseline (3),
	// HangingBaseline (4), and IdeographicBaseline (5). All other values are ignored.
	SetTextBaseline(baseline int)

	// SetTextAlign sets the current text alignment used when drawing text. Valid values:
	// LeftAlign (0), RightAlign (1), CenterAlign (2), StartAlign (3), and EndAlign(4). All other values are ignored.
	SetTextAlign(align int)

	// SetShadow sets shadow parameters:
	//   * offsetX, offsetY - the distance that shadows will be offset horizontally and vertically;
	//   * blur - the amount of blur applied to shadows. Must be non-negative;
	//   * color - the color of shadows.
	SetShadow(offsetX, offsetY, blur float64, color Color)

	// ResetShadow sets shadow parameters to default values (invisible shadow)
	ResetShadow()

	// ClearRect erases the pixels in a rectangular area by setting them to transparent black
	ClearRect(x, y, width, height float64)

	// FillRect draws a rectangle that is filled according to the current FillStyle.
	FillRect(x, y, width, height float64)

	// StrokeRect draws a rectangle that is stroked (outlined) according to the current strokeStyle
	// and other context settings
	StrokeRect(x, y, width, height float64)

	// FillAndStrokeRect draws a rectangle that is filled according to the current FillStyle and
	// is stroked (outlined) according to the current strokeStyle and other context settings
	FillAndStrokeRect(x, y, width, height float64)

	// FillRoundedRect draws a rounded rectangle that is filled according to the current FillStyle.
	FillRoundedRect(x, y, width, height, r float64)

	// StrokeRoundedRect draws a rounded rectangle that is stroked (outlined) according
	// to the current strokeStyle and other context settings
	StrokeRoundedRect(x, y, width, height, r float64)

	// FillAndStrokeRoundedRect draws a rounded rectangle that is filled according to the current FillStyle
	// and is stroked (outlined) according to the current strokeStyle and other context settings
	FillAndStrokeRoundedRect(x, y, width, height, r float64)

	// FillEllipse draws a ellipse that is filled according to the current FillStyle.
	//   * x, y - coordinates of the ellipse's center;
	//   * radiusX - the ellipse's major-axis radius. Must be non-negative;
	//   * radiusY - the ellipse's minor-axis radius. Must be non-negative;
	//   * rotation - the rotation of the ellipse, expressed in radians.
	FillEllipse(x, y, radiusX, radiusY, rotation float64)

	// StrokeRoundedRect draws a ellipse that is stroked (outlined) according
	// to the current strokeStyle and other context settings
	StrokeEllipse(x, y, radiusX, radiusY, rotation float64)

	// FillAndStrokeEllipse draws a ellipse that is filled according to the current FillStyle
	// and is stroked (outlined) according to the current strokeStyle and other context settings
	FillAndStrokeEllipse(x, y, radiusX, radiusY, rotation float64)

	// NewPath creates a new Path object
	NewPath() Path

	// NewPathFromSvg creates a new Path and initialize it by a string consisting of SVG path data
	NewPathFromSvg(data string) Path

	// FillPath draws a path that is filled according to the current FillStyle.
	FillPath(path Path)

	// StrokePath draws a path that is stroked (outlined) according to the current strokeStyle
	// and other context settings
	StrokePath(path Path)

	// FillAndStrokeRect draws a path that is filled according to the current FillStyle and
	// is stroked (outlined) according to the current strokeStyle and other context settings
	FillAndStrokePath(path Path)

	// DrawLine draws a line according to the current strokeStyle and other context settings
	DrawLine(x0, y0, x1, y1 float64)

	// FillText draws a text string at the specified coordinates, filling the string's characters
	// with the current FillStyle
	FillText(x, y float64, text string)

	// StrokeText strokes — that is, draws the outlines of — the characters of a text string
	// at the specified coordinates
	StrokeText(x, y float64, text string)

	// DrawImage draws the image at the (x, y) position
	DrawImage(x, y float64, image Image)

	// DrawImageInRect draws the image in the rectangle (x, y, width, height), scaling in height and width if necessary
	DrawImageInRect(x, y, width, height float64, image Image)

	// DrawImageFragment draws the fragment (described by srcX, srcY, srcWidth, srcHeight) of image
	// in the rectangle (dstX, dstY, dstWidth, dstHeight), scaling in height and width if necessary
	DrawImageFragment(srcX, srcY, srcWidth, srcHeight, dstX, dstY, dstWidth, dstHeight float64, image Image)
	// contains filtered or unexported methods
}

Canvas is a drawing interface used by the CanvasView

type CanvasView

type CanvasView interface {
	View

	// Redraw forces CanvasView to redraw its content
	Redraw()
}

CanvasView interface of a custom draw view

func CanvasViewByID

func CanvasViewByID(rootView View, id string, ids ...string) CanvasView

CanvasViewByID return the CanvasView path to which is specified using the arguments id, ids. Example

view := CanvasViewByID(rootView, "id1", "id2", "id3")
view := CanvasViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not CanvasView, the function will return nil

func NewCanvasView

func NewCanvasView(session Session, params Params) CanvasView

NewCanvasView creates the new custom draw view

type CellIndex added in v0.5.0

type CellIndex struct {
	Row, Column int
}

CellIndex defines coordinates of the TableView cell

func GetTableCurrent added in v0.5.0

func GetTableCurrent(view View, subviewID ...string) CellIndex

GetTableCurrent returns the row and column index of the TableView selected cell/row. If there is no selected cell/row or the selection mode is NoneSelection (0), then a value of the row and column index less than 0 is returned. If the selection mode is RowSelection (2) then the returned column index is less than 0. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

type Checkbox

type Checkbox interface {
	ViewsContainer
}

Checkbox represent a Checkbox view

func CheckboxByID

func CheckboxByID(rootView View, id string, ids ...string) Checkbox

CheckboxByID return the Checkbox path to which is specified using the arguments id, ids. Example

view := CheckboxByID(rootView, "id1", "id2", "id3")
view := CheckboxByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not Checkbox, the function will return nil

func NewCheckbox

func NewCheckbox(session Session, params Params) Checkbox

NewCheckbox create new Checkbox object and return it

type ClipShape

type ClipShape string
const (
	InsetClip   ClipShape = "inset"
	CircleClip  ClipShape = "circle"
	EllipseClip ClipShape = "ellipse"
	PolygonClip ClipShape = "polygon"
)

type ClipShapeProperty added in v0.18.0

type ClipShapeProperty interface {
	Properties
	fmt.Stringer

	// Shape returns the clip shape type
	Shape() ClipShape
	// contains filtered or unexported methods
}

ClipShapeProperty defines a View clipping area

func GetClip

func GetClip(view View, subviewID ...string) ClipShapeProperty

GetClip returns a View clipping area. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetShapeOutside

func GetShapeOutside(view View, subviewID ...string) ClipShapeProperty

GetShapeOutside returns a shape around which adjacent inline content. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func NewCircleClip added in v0.18.0

func NewCircleClip(x, y, radius SizeUnit) ClipShapeProperty

NewCircleClip creates a circle View clipping area.

  • x - x-axis position of the circle clip center;
  • y - y-axis position of the circle clip center;
  • radius - radius of the circle clip center.

func NewClipShapeProperty added in v0.18.0

func NewClipShapeProperty(shape ClipShape, params Params) ClipShapeProperty

NewClipShapeProperty creates ClipShapeProperty.

The following properties can be used for shapes:

InsetClip:

  • "top" (Top) - offset (SizeUnit) from the top border of a View;
  • "right" (Right) - offset (SizeUnit) from the right border of a View;
  • "bottom" (Bottom) - offset (SizeUnit) from the bottom border of a View;
  • "left" (Left) - offset (SizeUnit) from the left border of a View;
  • "radius" (Radius) - corner radius (RadiusProperty).

CircleClip:

  • "x" (X) - x-axis position (SizeUnit) of the circle clip center;
  • "y" (Y) - y-axis position (SizeUnit) of the circle clip center;
  • "radius" (Radius) - radius (SizeUnit) of the circle clip center.

EllipseClip:

  • "x" (X) - x-axis position (SizeUnit) of the ellipse clip center;
  • "y" (Y) - y-axis position (SizeUnit) of the ellipse clip center;
  • "radius-x" (RadiusX) - x-axis radius (SizeUnit) of the ellipse clip center;
  • "radius-y" (RadiusY) - y-axis radius (SizeUnit) of the ellipse clip center.

PolygonClip:

  • "points" (Points) - an array ([]SizeUnit) of corner points of the polygon in the following order: x1, y1, x2, y2, ….

The function will return nil if no properties are specified, unsupported properties are specified, or at least one property has an invalid value.

func NewEllipseClip added in v0.18.0

func NewEllipseClip(x, y, rx, ry SizeUnit) ClipShapeProperty

NewEllipseClip creates a ellipse View clipping area.

  • x - x-axis position of the ellipse clip center;
  • y - y-axis position of the ellipse clip center;
  • rx - x-axis radius of the ellipse clip center;
  • ry - y-axis radius of the ellipse clip center.

func NewInsetClip added in v0.18.0

func NewInsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShapeProperty

NewInsetClip creates a rectangle View clipping area.

  • top - offset from the top border of a View;
  • right - offset from the right border of a View;
  • bottom - offset from the bottom border of a View;
  • left - offset from the left border of a View;
  • radius - corner radius, pass nil if you don't need to round corners

func NewPolygonClip added in v0.18.0

func NewPolygonClip(points []any) ClipShapeProperty

NewPolygonClip creates a polygon View clipping area.

  • points - an array of corner points of the polygon in the following order: x1, y1, x2, y2, …

The elements of the function argument can be or text constants, or the text representation of SizeUnit, or elements of SizeUnit type.

func NewPolygonPointsClip added in v0.18.0

func NewPolygonPointsClip(points []SizeUnit) ClipShapeProperty

NewPolygonPointsClip creates a polygon View clipping area.

  • points - an array of corner points of the polygon in the following order: x1, y1, x2, y2, …

type Color

type Color uint32

Color - represent color in argb format

const (
	// Black color constant
	Black Color = 0xff000000
	// Silver color constant
	Silver Color = 0xffc0c0c0
	// Gray color constant
	Gray Color = 0xff808080
	// White color constant
	White Color = 0xffffffff
	// Maroon color constant
	Maroon Color = 0xff800000
	// Red color constant
	Red Color = 0xffff0000
	// Purple color constant
	Purple Color = 0xff800080
	// Fuchsia color constant
	Fuchsia Color = 0xffff00ff
	// Green color constant
	Green Color = 0xff008000
	// Lime color constant
	Lime Color = 0xff00ff00
	// Olive color constant
	Olive Color = 0xff808000
	// Yellow color constant
	Yellow Color = 0xffffff00
	// Navy color constant
	Navy Color = 0xff000080
	// Blue color constant
	Blue Color = 0xff0000ff
	// Teal color constant
	Teal Color = 0xff008080
	// Aqua color constant
	Aqua Color = 0xff00ffff
	// Orange color constant
	Orange Color = 0xffffa500
	// AliceBlue color constant
	AliceBlue Color = 0xfff0f8ff
	// AntiqueWhite color constant
	AntiqueWhite Color = 0xfffaebd7
	// Aquamarine color constant
	Aquamarine Color = 0xff7fffd4
	// Azure color constant
	Azure Color = 0xfff0ffff
	// Beige color constant
	Beige Color = 0xfff5f5dc
	// Bisque color constant
	Bisque Color = 0xffffe4c4
	// BlanchedAlmond color constant
	BlanchedAlmond Color = 0xffffebcd
	// BlueViolet color constant
	BlueViolet Color = 0xff8a2be2
	// Brown color constant
	Brown Color = 0xffa52a2a
	// BurlyWood color constant
	BurlyWood Color = 0xffdeb887
	// CadetBlue color constant
	CadetBlue Color = 0xff5f9ea0
	// Chartreuse color constant
	Chartreuse Color = 0xff7fff00
	// Chocolate color constant
	Chocolate Color = 0xffd2691e
	// Coral color constant
	Coral Color = 0xffff7f50
	// CornflowerBlue color constant
	CornflowerBlue Color = 0xff6495ed
	// CornSilk color constant
	CornSilk Color = 0xfffff8dc
	// Crimson color constant
	Crimson Color = 0xffdc143c
	// Cyan color constant
	Cyan Color = 0xff00ffff
	// DarkBlue color constant
	DarkBlue Color = 0xff00008b
	// DarkCyan color constant
	DarkCyan Color = 0xff008b8b
	// DarkGoldenRod color constant
	DarkGoldenRod Color = 0xffb8860b
	// DarkGray color constant
	DarkGray Color = 0xffa9a9a9
	// DarkGreen color constant
	DarkGreen Color = 0xff006400
	// DarkGrey color constant
	DarkGrey Color = 0xffa9a9a9
	// DarkKhaki color constant
	DarkKhaki Color = 0xffbdb76b
	// DarkMagenta color constant
	DarkMagenta Color = 0xff8b008b
	// DarkOliveGreen color constant
	DarkOliveGreen Color = 0xff556b2f
	// DarkOrange color constant
	DarkOrange Color = 0xffff8c00
	// DarkOrchid color constant
	DarkOrchid Color = 0xff9932cc
	// DarkRed color constant
	DarkRed Color = 0xff8b0000
	// DarkSalmon color constant
	DarkSalmon Color = 0xffe9967a
	// DarkSeaGreen color constant
	DarkSeaGreen Color = 0xff8fbc8f
	// DarkSlateBlue color constant
	DarkSlateBlue Color = 0xff483d8b
	// DarkSlateGray color constant
	DarkSlateGray Color = 0xff2f4f4f
	// DarkSlateGrey color constant
	DarkSlateGrey Color = 0xff2f4f4f
	// DarkTurquoise color constant
	DarkTurquoise Color = 0xff00ced1
	// DarkViolet color constant
	DarkViolet Color = 0xff9400d3
	// DeepPink color constant
	DeepPink Color = 0xffff1493
	// DeepSkyBlue color constant
	DeepSkyBlue Color = 0xff00bfff
	// DimGray color constant
	DimGray Color = 0xff696969
	// DimGrey color constant
	DimGrey Color = 0xff696969
	// DodgerBlue color constant
	DodgerBlue Color = 0xff1e90ff
	// FireBrick color constant
	FireBrick Color = 0xffb22222
	// FloralWhite color constant
	FloralWhite Color = 0xfffffaf0
	// ForestGreen color constant
	ForestGreen Color = 0xff228b22
	// Gainsboro color constant
	Gainsboro Color = 0xffdcdcdc
	// GhostWhite color constant
	GhostWhite Color = 0xfff8f8ff
	// Gold color constant
	Gold Color = 0xffffd700
	// GoldenRod color constant
	GoldenRod Color = 0xffdaa520
	// GreenYellow color constant
	GreenYellow Color = 0xffadff2f
	// Grey color constant
	Grey Color = 0xff808080
	// Honeydew color constant
	Honeydew Color = 0xfff0fff0
	// HotPink color constant
	HotPink Color = 0xffff69b4
	// IndianRed color constant
	IndianRed Color = 0xffcd5c5c
	// Indigo color constant
	Indigo Color = 0xff4b0082
	// Ivory color constant
	Ivory Color = 0xfffffff0
	// Khaki color constant
	Khaki Color = 0xfff0e68c
	// Lavender color constant
	Lavender Color = 0xffe6e6fa
	// LavenderBlush color constant
	LavenderBlush Color = 0xfffff0f5
	// LawnGreen color constant
	LawnGreen Color = 0xff7cfc00
	// LemonChiffon color constant
	LemonChiffon Color = 0xfffffacd
	// LightBlue color constant
	LightBlue Color = 0xffadd8e6
	// LightCoral color constant
	LightCoral Color = 0xfff08080
	// LightCyan color constant
	LightCyan Color = 0xffe0ffff
	// LightGoldenrodYellow color constant
	LightGoldenRodYellow Color = 0xfffafad2
	// LightGray color constant
	LightGray Color = 0xffd3d3d3
	// LightGreen color constant
	LightGreen Color = 0xff90ee90
	// LightGrey color constant
	LightGrey Color = 0xffd3d3d3
	// LightPink color constant
	LightPink Color = 0xffffb6c1
	// LightSalmon color constant
	LightSalmon Color = 0xffffa07a
	// LightSeaGreen color constant
	LightSeaGreen Color = 0xff20b2aa
	// LightSkyBlue color constant
	LightSkyBlue Color = 0xff87cefa
	// LightSlateGray color constant
	LightSlateGray Color = 0xff778899
	// LightSlateGrey color constant
	LightSlateGrey Color = 0xff778899
	// LightSteelBlue color constant
	LightSteelBlue Color = 0xffb0c4de
	// LightYellow color constant
	LightYellow Color = 0xffffffe0
	// LimeGreen color constant
	LimeGreen Color = 0xff32cd32
	// Linen color constant
	Linen Color = 0xfffaf0e6
	// Magenta color constant
	Magenta Color = 0xffff00ff
	// MediumAquamarine color constant
	MediumAquamarine Color = 0xff66cdaa
	// MediumBlue color constant
	MediumBlue Color = 0xff0000cd
	// MediumOrchid color constant
	MediumOrchid Color = 0xffba55d3
	// MediumPurple color constant
	MediumPurple Color = 0xff9370db
	// MediumSeaGreen color constant
	MediumSeaGreen Color = 0xff3cb371
	// MediumSlateBlue color constant
	MediumSlateBlue Color = 0xff7b68ee
	// MediumSpringGreen color constant
	MediumSpringGreen Color = 0xff00fa9a
	// MediumTurquoise color constant
	MediumTurquoise Color = 0xff48d1cc
	// MediumVioletRed color constant
	MediumVioletRed Color = 0xffc71585
	// MidnightBlue color constant
	MidnightBlue Color = 0xff191970
	// MintCream color constant
	MintCream Color = 0xfff5fffa
	// MistyRose color constant
	MistyRose Color = 0xffffe4e1
	// Moccasin color constant
	Moccasin Color = 0xffffe4b5
	// NavajoWhite color constant
	NavajoWhite Color = 0xffffdead
	// OldLace color constant
	OldLace Color = 0xfffdf5e6
	// OliveDrab color constant
	OliveDrab Color = 0xff6b8e23
	// OrangeRed color constant
	OrangeRed Color = 0xffff4500
	// Orchid color constant
	Orchid Color = 0xffda70d6
	// PaleGoldenrod color constant
	PaleGoldenrod Color = 0xffeee8aa
	// PaleGreen color constant
	PaleGreen Color = 0xff98fb98
	// PaleTurquoise color constant
	PaleTurquoise Color = 0xffafeeee
	// PaleVioletRed color constant
	PaleVioletRed Color = 0xffdb7093
	// PapayaWhip color constant
	PapayaWhip Color = 0xffffefd5
	// PeachPuff color constant
	PeachPuff Color = 0xffffdab9
	// Peru color constant
	Peru Color = 0xffcd853f
	// Pink color constant
	Pink Color = 0xffffc0cb
	// Plum color constant
	Plum Color = 0xffdda0dd
	// PowderBlue color constant
	PowderBlue Color = 0xffb0e0e6
	// RosyBrown color constant
	RosyBrown Color = 0xffbc8f8f
	// RoyalBlue color constant
	RoyalBlue Color = 0xff4169e1
	// SaddleBrown color constant
	SaddleBrown Color = 0xff8b4513
	// Salmon color constant
	Salmon Color = 0xfffa8072
	// SandyBrown color constant
	SandyBrown Color = 0xfff4a460
	// SeaGreen color constant
	SeaGreen Color = 0xff2e8b57
	// SeaShell color constant
	SeaShell Color = 0xfffff5ee
	// Sienna color constant
	Sienna Color = 0xffa0522d
	// SkyBlue color constant
	SkyBlue Color = 0xff87ceeb
	// SlateBlue color constant
	SlateBlue Color = 0xff6a5acd
	// SlateGray color constant
	SlateGray Color = 0xff708090
	// SlateGrey color constant
	SlateGrey Color = 0xff708090
	// Snow color constant
	Snow Color = 0xfffffafa
	// SpringGreen color constant
	SpringGreen Color = 0xff00ff7f
	// SteelBlue color constant
	SteelBlue Color = 0xff4682b4
	// Tan color constant
	Tan Color = 0xffd2b48c
	// Thistle color constant
	Thistle Color = 0xffd8bfd8
	// Tomato color constant
	Tomato Color = 0xffff6347
	// Turquoise color constant
	Turquoise Color = 0xff40e0d0
	// Violet color constant
	Violet Color = 0xffee82ee
	// Wheat color constant
	Wheat Color = 0xfff5deb3
	// WhiteSmoke color constant
	WhiteSmoke Color = 0xfff5f5f5
	// YellowGreen color constant
	YellowGreen Color = 0xff9acd32
)

A set of predefined colors used in the library

func ARGB added in v0.18.0

func ARGB[T int | uint | int8 | uint8](alpha, red, green, blue T) Color

ARGB creates Color using alpha, red, green and blue components

func GetAccentColor added in v0.9.0

func GetAccentColor(view View, subviewID ...string) Color

GetAccentColor returns the accent color for UI controls generated by some elements. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetBackgroundColor

func GetBackgroundColor(view View, subviewID ...string) Color

GetBackgroundColor returns a background color of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCaretColor added in v0.7.0

func GetCaretColor(view View, subviewID ...string) Color

GetCaretColor returns the color of the text input caret. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColorPickerValue

func GetColorPickerValue(view View, subviewID ...string) Color

GetColorPickerValue returns the value of ColorPicker subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColumnSeparatorColor

func GetColumnSeparatorColor(view View, subviewID ...string) Color

ColumnSeparatorColor returns Color value which specifies the color of the line drawn between columns in a multi-column layout. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetTextColor

func GetTextColor(view View, subviewID ...string) Color

GetTextColor returns a text color of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextLineColor

func GetTextLineColor(view View, subviewID ...string) Color

GetTextLineColor returns the stroke color of the decoration line that is used on text in an element, such as a line-through, underline, or overline. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func RGB added in v0.18.0

func RGB[T int | uint | int8 | uint8](red, green, blue T) Color

RGB creates Color using red, green and blue components

func StringToColor

func StringToColor(text string) (Color, bool)

StringToColor converts the string argument to Color value

func (Color) ARGB

func (color Color) ARGB() (uint8, uint8, uint8, uint8)

ARGB - return alpha, red, green and blue components of the color

func (Color) Alpha

func (color Color) Alpha() int

Alpha - return the alpha component of the color

func (Color) Blue

func (color Color) Blue() int

Blue - return the blue component of the color

func (Color) Green

func (color Color) Green() int

Green - return the green component of the color

func (Color) Red

func (color Color) Red() int

Red - return the red component of the color

func (Color) String

func (color Color) String() string

String get a text representation of the color

type ColorPicker

type ColorPicker interface {
	View
}

ColorPicker represent a ColorPicker view

func ColorPickerByID added in v0.3.0

func ColorPickerByID(rootView View, id string, ids ...string) ColorPicker

ColorPickerByID return the ColorPicker path to which is specified using the arguments id, ids. Example

view := ColorPickerByID(rootView, "id1", "id2", "id3")
view := ColorPickerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ColorPicker, the function will return nil

func NewColorPicker

func NewColorPicker(session Session, params Params) ColorPicker

NewColorPicker create new ColorPicker object and return it

type ColumnLayout

type ColumnLayout interface {
	ViewsContainer
}

ColumnLayout represent a ColumnLayout view

func ColumnLayoutByID

func ColumnLayoutByID(rootView View, id string, ids ...string) ColumnLayout

ColumnLayoutByID return the ColumnLayout path to which is specified using the arguments id, ids. Example

view := ColumnLayoutByID(rootView, "id1", "id2", "id3")
view := ColumnLayoutByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ColumnLayout, the function will return nil

func NewColumnLayout

func NewColumnLayout(session Session, params Params) ColumnLayout

NewColumnLayout create new ColumnLayout object and return it

type ColumnSeparatorProperty

type ColumnSeparatorProperty interface {
	Properties
	fmt.Stringer

	// ViewBorder returns column separator description in a form of ViewBorder
	ViewBorder(session Session) ViewBorder
	// contains filtered or unexported methods
}

ColumnSeparatorProperty is the interface of a view separator data

func NewColumnSeparator

func NewColumnSeparator(style int, color Color, width SizeUnit) ColumnSeparatorProperty

NewColumnSeparator creates the new ColumnSeparatorProperty.

Arguments:

func NewColumnSeparatorProperty added in v0.18.0

func NewColumnSeparatorProperty(params Params) ColumnSeparatorProperty

NewColumnSeparatorProperty creates the new ColumnSeparatorProperty.

The following properties can be used:

  • "style" (Style) - Determines the line style (type is int). Valid values: 0 (NoneLine), 1 (SolidLine), 2 (DashedLine), 3 (DottedLine), or 4 (DoubleLine);
  • "color" (ColorTag) - Determines the line color (type is Color);
  • "width" (Width) - Determines the line thickness (type is SizeUnit).

type ControlKeyMask added in v0.13.0

type ControlKeyMask int

ControlKeyMask represent ORed state of keyboard's control keys like AltKey, CtrlKey, ShiftKey and MetaKey

type CustomView

type CustomView interface {
	ViewsContainer

	// CreateSuperView must be implemented to create a base view from which custom control has been built
	CreateSuperView(session Session) View

	// SuperView must be implemented to return a base view from which custom control has been built
	SuperView() View
	// contains filtered or unexported methods
}

CustomView defines a custom view interface

type CustomViewData

type CustomViewData struct {
	// contains filtered or unexported fields
}

CustomViewData defines a data of a basic custom view

func (*CustomViewData) AllTags

func (customView *CustomViewData) AllTags() []PropertyName

AllTags returns an array of the set properties

func (*CustomViewData) Append

func (customView *CustomViewData) Append(view View)

Append appends a view to the end of the list of a view children

func (*CustomViewData) Clear

func (customView *CustomViewData) Clear()

Clear removes all properties

func (*CustomViewData) Focusable

func (customView *CustomViewData) Focusable() bool

Focusable returns true if the view receives the focus

func (*CustomViewData) Frame

func (customView *CustomViewData) Frame() Frame

Frame returns a location and size of the view in pixels

func (*CustomViewData) Get

func (customView *CustomViewData) Get(tag PropertyName) any

Get returns a value of the property with name defined by the argument. The type of return value depends on the property. If the property is not set then nil is returned.

func (*CustomViewData) HasFocus added in v0.5.0

func (customView *CustomViewData) HasFocus() bool

HasFocus returns "true" if the view has focus

func (*CustomViewData) ID

func (customView *CustomViewData) ID() string

ID returns a id of the view

func (*CustomViewData) Insert

func (customView *CustomViewData) Insert(view View, index int)

Insert inserts a view to the "index" position in the list of a view children

func (*CustomViewData) Parent

func (customView *CustomViewData) Parent() View

Parent returns a parent view

func (*CustomViewData) Remove

func (customView *CustomViewData) Remove(tag PropertyName)

Remove removes the property with name defined by the argument

func (*CustomViewData) RemoveView

func (customView *CustomViewData) RemoveView(index int) View

Remove removes a view from the list of a view children and return it

func (*CustomViewData) Scroll

func (customView *CustomViewData) Scroll() Frame

Scroll returns a location and size of a scrollable view in pixels

func (*CustomViewData) Session

func (customView *CustomViewData) Session() Session

Session returns a current Session interface

func (*CustomViewData) Set

func (customView *CustomViewData) Set(tag PropertyName, value any) bool

Set sets the value (second argument) of the property with name defined by the first argument. Return "true" if the value has been set, in the opposite case "false" are returned and a description of the error is written to the log

func (*CustomViewData) SetAnimated

func (customView *CustomViewData) SetAnimated(tag PropertyName, value any, animation AnimationProperty) bool

SetAnimated sets the value (second argument) of the property with name defined by the first argument. Return "true" if the value has been set, in the opposite case "false" are returned and a description of the error is written to the log

func (*CustomViewData) SetChangeListener added in v0.4.0

func (customView *CustomViewData) SetChangeListener(tag PropertyName, listener func(View, PropertyName))

SetChangeListener set the function to track the change of the View property

func (*CustomViewData) SetParams added in v0.17.3

func (customView *CustomViewData) SetParams(params Params) bool

func (*CustomViewData) SetTransition added in v0.9.0

func (customView *CustomViewData) SetTransition(tag PropertyName, animation AnimationProperty)

SetTransition sets the transition animation for the property if "animation" argument is not nil, and removes the transition animation of the property if "animation" argument is nil. The "tag" argument is the property name.

func (*CustomViewData) String

func (customView *CustomViewData) String() string

String convert internal representation of a CustomViewData into a string.

func (*CustomViewData) SuperView

func (customView *CustomViewData) SuperView() View

SuperView returns a super view

func (*CustomViewData) Tag

func (customView *CustomViewData) Tag() string

Tag returns a tag of View interface

func (*CustomViewData) Transition added in v0.9.0

func (customView *CustomViewData) Transition(tag PropertyName) AnimationProperty

Transition returns the transition animation of the property(tag). Returns nil is there is no transition animation.

func (*CustomViewData) Transitions added in v0.9.0

func (customView *CustomViewData) Transitions() map[PropertyName]AnimationProperty

Transitions returns a map of transition animations. The result is always non-nil.

func (*CustomViewData) ViewIndex added in v0.13.0

func (customView *CustomViewData) ViewIndex(view View) int

Remove removes a view from the list of a view children and return it

func (*CustomViewData) Views

func (customView *CustomViewData) Views() []View

Views return a list of child views

type DataNode

type DataNode interface {
	// Tag returns a tag name
	Tag() string

	// Type returns a node type. Possible values are TextNode, ObjectNode and ArrayNode
	Type() int

	// Text returns node text
	Text() string

	// Object returns node as object if that node type is an object
	Object() DataObject

	// ArraySize returns array size if that node type is an array
	ArraySize() int

	// ArrayElement returns a value of an array if that node type is an array
	ArrayElement(index int) DataValue

	// ArrayElements returns an array of objects if that node is an array
	ArrayElements() []DataValue

	// ArrayAsParams returns an array of a params(map) if that node is an array
	ArrayAsParams() []Params
}

DataNode interface of a data node

type DataObject

type DataObject interface {
	DataValue

	// Tag returns data object tag
	Tag() string

	// PropertyCount returns properties count
	PropertyCount() int

	// Property returns a data node corresponding to a property with specific index
	Property(index int) DataNode

	// PropertyByTag returns a data node corresponding to a property tag
	PropertyByTag(tag string) DataNode

	// PropertyValue returns a string value of a property with a specific tag
	PropertyValue(tag string) (string, bool)

	// PropertyObject returns an object value of a property with a specific tag
	PropertyObject(tag string) DataObject

	// SetPropertyValue sets a string value of a property with a specific tag
	SetPropertyValue(tag, value string)

	// SetPropertyObject sets an object value of a property with a specific tag
	SetPropertyObject(tag string, object DataObject)

	// ToParams create a params(map) representation of a data object
	ToParams() Params
}

DataObject interface of a data object

func NewDataObject

func NewDataObject(tag string) DataObject

NewDataObject create new DataObject with the tag and empty property list

func ParseDataText

func ParseDataText(text string) DataObject

ParseDataText - parse text and return DataNode

type DataValue

type DataValue interface {
	// IsObject returns "true" if data value is an object
	IsObject() bool

	// Object returns data value as a data object
	Object() DataObject

	// Value returns value as a string
	Value() string
}

DataValue interface of a data node value

type DatePicker

type DatePicker interface {
	View
}

DatePicker represent a DatePicker view

func DatePickerByID added in v0.3.0

func DatePickerByID(rootView View, id string, ids ...string) DatePicker

DatePickerByID return the DatePicker path to which is specified using the arguments id, ids. Example

view := DatePickerByID(rootView, "id1", "id2", "id3")
view := DatePickerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not DatePicker, the function will return nil

func NewDatePicker

func NewDatePicker(session Session, params Params) DatePicker

NewDatePicker create new DatePicker object and return it

type DetailsView

type DetailsView interface {
	ViewsContainer
}

DetailsView represent a DetailsView view, which is a collapsible container of views

func DetailsViewByID

func DetailsViewByID(rootView View, id string, ids ...string) DetailsView

DetailsViewByID return the ColumnLayout path to which is specified using the arguments id, ids. Example

view := DetailsViewByID(rootView, "id1", "id2", "id3")
view := DetailsViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not DetailsView, the function will return nil

func NewDetailsView

func NewDetailsView(session Session, params Params) DetailsView

NewDetailsView create new DetailsView object and return it

type DropDownList interface {
	View
}

DropDownList represent a DropDownList view

func DropDownListByID(rootView View, id string, ids ...string) DropDownList

DropDownListByID return the DropDownListView path to which is specified using the arguments id, ids. Example

view := DropDownListByID(rootView, "id1", "id2", "id3")
view := DropDownListByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not DropDownList, the function will return nil

func NewDropDownList

func NewDropDownList(session Session, params Params) DropDownList

NewDropDownList create new DropDownList object and return it

type EditView

type EditView interface {
	View

	// AppendText appends text to the current text of an EditView view
	AppendText(text string)
	// contains filtered or unexported methods
}

EditView represent an EditView view

func EditViewByID

func EditViewByID(rootView View, id string, ids ...string) EditView

EditViewByID return the EditView path to which is specified using the arguments id, ids. Example

view := EditViewByID(rootView, "id1", "id2", "id3")
view := EditViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not EditView, the function will return nil

func NewEditView

func NewEditView(session Session, params Params) EditView

NewEditView create new EditView object and return it

type FileInfo added in v0.3.0

type FileInfo struct {
	// Name - the file's name.
	Name string

	// LastModified specifying the date and time at which the file was last modified
	LastModified time.Time

	// Size - the size of the file in bytes.
	Size int64

	// MimeType - the file's MIME type.
	MimeType string
}

FileInfo describes a file which selected in the FilePicker view

func GetFilePickerFiles added in v0.3.0

func GetFilePickerFiles(view View, subviewID ...string) []FileInfo

GetFilePickerFiles returns the list of FilePicker selected files If there are no files selected then an empty slice is returned (the result is always not nil) If the second argument (subviewID) is not specified or it is "" then selected files of the first argument (view) is returned

type FilePicker added in v0.3.0

type FilePicker interface {
	View
	// Files returns the list of selected files.
	// If there are no files selected then an empty slice is returned (the result is always not nil)
	Files() []FileInfo
	// LoadFile loads the content of the selected file. This function is asynchronous.
	// The "result" function will be called after loading the data.
	LoadFile(file FileInfo, result func(FileInfo, []byte))
}

FilePicker represents the FilePicker view

func FilePickerByID added in v0.3.0

func FilePickerByID(rootView View, id string, ids ...string) FilePicker

FilePickerByID return the FilePicker path to which is specified using the arguments id, ids. Example

view := FilePickerByID(rootView, "id1", "id2", "id3")
view := FilePickerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not FilePicker, the function will return nil

func NewFilePicker added in v0.3.0

func NewFilePicker(session Session, params Params) FilePicker

NewFilePicker create new FilePicker object and return it

type FilterProperty added in v0.18.0

type FilterProperty interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

FilterProperty defines an applied to a View a graphical effects like blur or color shift. Allowable properties are Blur, Brightness, Contrast, DropShadow, Grayscale, HueRotate, Invert, Opacity, Saturate, and Sepia

func GetBackdropFilter added in v0.7.0

func GetBackdropFilter(view View, subviewID ...string) FilterProperty

GetBackdropFilter returns the area behind a View graphical effects like blur or color shift. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetFilter

func GetFilter(view View, subviewID ...string) FilterProperty

GetFilter returns a View graphical effects like blur or color shift. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func NewFilterProperty added in v0.18.0

func NewFilterProperty(params Params) FilterProperty

NewFilterProperty creates the new FilterProperty

type FontParams

type FontParams struct {
	// Italic - if true then a font is italic
	Italic bool
	// SmallCaps - if true then a font uses small-caps glyphs
	SmallCaps bool
	// Weight - a font weight. Valid values: 0...9, there
	//   0 - a weight does not specify;
	//   1 - a minimal weight;
	//   4 - a normal weight;
	//   7 - a bold weight;
	//   9 - a maximal weight.
	Weight int
	// LineHeight - the height (relative to the font size of the element itself) of a line box.
	LineHeight SizeUnit
}

FontParams defined optionally font properties

type Frame

type Frame struct {
	// Left - the left border
	Left float64
	// Top - the top border
	Top float64
	// Width - the width of a rectangle area
	Width float64
	// Height - the height of a rectangle area
	Height float64
}

Frame - the location and size of a rectangle area

func GetListItemFrame

func GetListItemFrame(view View, subviewID string, index int) Frame

GetListItemFrame - returns the location and size of the ListView item in pixels. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetViewFrame

func GetViewFrame(view View, subviewID ...string) Frame

GetViewFrame returns the size and location of view's viewport. If the second argument (subviewID) is not specified or it is "" then the value of the first argument (view) is returned

func GetViewScroll

func GetViewScroll(view View, subviewID ...string) Frame

GetViewScroll returns ... If the second argument (subviewID) is not specified or it is "" then a value of the first argument (view) is returned

func (Frame) Bottom

func (frame Frame) Bottom() float64

Bottom returns the bottom border

func (Frame) Right

func (frame Frame) Right() float64

Right returns the right border

type GradientPoint

type GradientPoint struct {
	// Offset - a number between 0 and 1, inclusive, representing the position of the color stop
	Offset float64
	// Color - the color of the stop
	Color Color
}

GradientPoint defined by an offset and a color, to a linear or radial gradient

type GridAdapter added in v0.16.0

type GridAdapter interface {
	// GridColumnCount returns the number of columns in the grid
	GridColumnCount() int

	// GridRowCount returns the number of rows in the grid
	GridRowCount() int

	// GridCellContent creates a View at the given cell
	GridCellContent(row, column int, session Session) View
}

GridAdapter is an interface to define GridLayout content. GridLayout will query interface functions to populate its content

type GridCellColumnSpanAdapter added in v0.16.0

type GridCellColumnSpanAdapter interface {
	// GridCellColumnSpan returns the number of columns that a cell spans.
	// Values ​​less than 1 are ignored.
	GridCellColumnSpan(row, column int) int
}

GridCellColumnSpanAdapter implements the optional method of the GridAdapter interface

type GridCellRowSpanAdapter added in v0.16.0

type GridCellRowSpanAdapter interface {
	// GridCellRowSpan returns the number of rows that a cell spans
	// Values ​​less than 1 are ignored.
	GridCellRowSpan(row, column int) int
}

GridCellColumnSpanAdapter implements the optional method of the GridAdapter interface

type GridLayout

type GridLayout interface {
	ViewsContainer

	// UpdateContent updates child Views if the "content" property value is set to GridAdapter,
	// otherwise does nothing
	UpdateGridContent()
}

GridLayout represents a GridLayout view

func GridLayoutByID

func GridLayoutByID(rootView View, id string, ids ...string) GridLayout

GridLayoutByID return the GridLayout path to which is specified using the arguments id, ids. Example

view := GridLayoutByID(rootView, "id1", "id2", "id3")
view := GridLayoutByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not GridLayout, the function will return nil

func NewGridLayout

func NewGridLayout(session Session, params Params) GridLayout

NewGridLayout create new GridLayout object and return it

type HorizontalTableJoin

type HorizontalTableJoin struct {
}

HorizontalTableJoin is an auxiliary structure. It used as cell content and specifies that the cell should be merged with the one before it

type Image

type Image interface {
	// URL returns the url of the image
	URL() string
	// LoadingStatus returns the status of the image loading: ImageLoading (0), ImageReady (1), ImageLoadingError (2)
	LoadingStatus() int
	// LoadingError: if LoadingStatus() == ImageLoadingError then returns the error text, "" otherwise
	LoadingError() string

	// Width returns the width of the image in pixels. While LoadingStatus() != ImageReady returns 0
	Width() float64
	// Height returns the height of the image in pixels. While LoadingStatus() != ImageReady returns 0
	Height() float64
	// contains filtered or unexported methods
}

Image defines the image that is used for drawing operations on the Canvas.

func LoadImage

func LoadImage(url string, onLoaded func(Image), session Session) Image

LoadImage starts the async image loading by url

type ImageView

type ImageView interface {
	View
	// NaturalSize returns the intrinsic, density-corrected size (width, height) of the image in pixels.
	// If the image hasn't been loaded yet or an load error has occurred, then (0, 0) is returned.
	NaturalSize() (float64, float64)
	// CurrentSource() return the full URL of the image currently visible in the ImageView.
	// If the image hasn't been loaded yet or an load error has occurred, then "" is returned.
	CurrentSource() string
}

ImageView represents an ImageView view

func ImageViewByID added in v0.3.0

func ImageViewByID(rootView View, id string, ids ...string) ImageView

ImageViewByID return the ImageView path to which is specified using the arguments id, ids. Example

view := ImageViewByID(rootView, "id1", "id2", "id3")
view := ImageViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ImageView, the function will return nil

func NewImageView

func NewImageView(session Session, params Params) ImageView

NewImageView create new ImageView object and return it

type KeyCode added in v0.13.0

type KeyCode string

KeyCode is a string representation the a physical key being pressed. The value is not affected by the current keyboard layout or modifier state, so a particular key will always have the same value.

type KeyEvent

type KeyEvent struct {
	// TimeStamp is the time at which the event was created (in milliseconds).
	// This value is time since epoch—but in reality, browsers' definitions vary.
	TimeStamp uint64

	// Key is the key value of the key represented by the event. If the value has a printed representation,
	// this attribute's value is the same as the char property. Otherwise, it's one of the key value strings
	// specified in Key values. If the key can't be identified, its value is the string "Unidentified".
	Key string

	// Code holds a string that identifies the physical key being pressed. The value is not affected
	// by the current keyboard layout or modifier state, so a particular key will always return the same value.
	Code KeyCode

	// Repeat == true if a key has been depressed long enough to trigger key repetition, otherwise false.
	Repeat bool

	// CtrlKey == true if the control key was down when the event was fired. false otherwise.
	CtrlKey bool

	// ShiftKey == true if the shift key was down when the event was fired. false otherwise.
	ShiftKey bool

	// AltKey == true if the alt key was down when the event was fired. false otherwise.
	AltKey bool

	// MetaKey == true if the meta key was down when the event was fired. false otherwise.
	MetaKey bool
}

KeyEvent represent a keyboard event

type LineCap added in v0.18.0

type LineCap int

LineCap is the type for setting the shape used to draw the end points of lines.

type LineJoin added in v0.18.0

type LineJoin int

LineJoin is the type for setting the shape used to join two line segments where they meet.

type LinearGradientDirectionType added in v0.18.0

type LinearGradientDirectionType int
const (
	// ToTopGradient is value of the Direction property of a linear gradient. The value is equivalent to the 0deg angle
	ToTopGradient LinearGradientDirectionType = 0

	// ToRightTopGradient is value of the Direction property of a linear gradient.
	ToRightTopGradient LinearGradientDirectionType = 1

	// ToRightGradient is value of the Direction property of a linear gradient. The value is equivalent to the 90deg angle
	ToRightGradient LinearGradientDirectionType = 2

	// ToRightBottomGradient is value of the Direction property of a linear gradient.
	ToRightBottomGradient LinearGradientDirectionType = 3

	// ToBottomGradient is value of the Direction property of a linear gradient. The value is equivalent to the 180deg angle
	ToBottomGradient LinearGradientDirectionType = 4

	// ToLeftBottomGradient is value of the Direction property of a linear gradient.
	ToLeftBottomGradient LinearGradientDirectionType = 5

	// ToLeftGradient is value of the Direction property of a linear gradient. The value is equivalent to the 270deg angle
	ToLeftGradient LinearGradientDirectionType = 6

	// ToLeftTopGradient is value of the Direction property of a linear gradient.
	ToLeftTopGradient LinearGradientDirectionType = 7
)

Constants related to view's background gradient description

type ListAdapter

type ListAdapter interface {
	// ListSize returns the number of elements in the list
	ListSize() int

	// ListItem creates a View of a list item at the given index
	ListItem(index int, session Session) View
}

ListAdapter - the list data source

func GetListViewAdapter

func GetListViewAdapter(view View, subviewID ...string) ListAdapter

GetListViewAdapter - returns the ListView adapter. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func NewTextListAdapter

func NewTextListAdapter(items []string, params Params) ListAdapter

NewTextListAdapter create the new ListAdapter for a string list displaying. The second argument is parameters of a TextView item

func NewViewListAdapter

func NewViewListAdapter(items []View) ListAdapter

NewTextListAdapter create the new ListAdapter for a view list displaying

type ListItemEnabled added in v0.16.0

type ListItemEnabled interface {
	// IsListItemEnabled returns the status (enabled/disabled) of a list item at the given index
	IsListItemEnabled(index int) bool
}

ListItemEnabled implements the optional method of ListAdapter interface

type ListLayout

type ListLayout interface {
	ViewsContainer
	// UpdateContent updates child Views if the "content" property value is set to ListAdapter,
	// otherwise does nothing
	UpdateContent()
}

ListLayout represents a ListLayout view

func ListLayoutByID

func ListLayoutByID(rootView View, id string, ids ...string) ListLayout

ListLayoutByID return the ListLayout path to which is specified using the arguments id, ids. Example

view := ListLayoutByID(rootView, "id1", "id2", "id3")
view := ListLayoutByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ListLayout, the function will return nil

func NewListLayout

func NewListLayout(session Session, params Params) ListLayout

NewListLayout create new ListLayout object and return it

type ListView

type ListView interface {
	View
	ParentView
	// ReloadListViewData updates ListView content
	ReloadListViewData()
	// contains filtered or unexported methods
}

ListView represents a ListView view

func ListViewByID

func ListViewByID(rootView View, id string, ids ...string) ListView

ListViewByID return the ListView path to which is specified using the arguments id, ids. Example

view := ListViewByID(rootView, "id1", "id2", "id3")
view := ListViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ListView, the function will return nil

func NewListView

func NewListView(session Session, params Params) ListView

NewListView creates the new list view

type MediaPlayer

type MediaPlayer interface {
	View

	// Play attempts to begin playback of the media.
	Play()

	// Pause will pause playback of the media, if the media is already in a paused state this method will have no effect.
	Pause()

	// SetCurrentTime sets the current playback time in seconds.
	SetCurrentTime(seconds float64)

	// CurrentTime returns the current playback time in seconds.
	CurrentTime() float64

	// Duration returns the value indicating the total duration of the media in seconds.
	// If no media data is available, the returned value is NaN.
	Duration() float64

	// SetPlaybackRate sets the rate at which the media is being played back. This is used to implement user controls
	// for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain
	// the current rate, so a value of 1.0 indicates normal speed.
	SetPlaybackRate(rate float64)

	// PlaybackRate returns the rate at which the media is being played back.
	PlaybackRate() float64

	// SetVolume sets the audio volume, from 0.0 (silent) to 1.0 (loudest).
	SetVolume(volume float64)

	// Volume returns the audio volume, from 0.0 (silent) to 1.0 (loudest).
	Volume() float64

	// IsEnded function tells whether the media element is ended.
	IsEnded() bool

	// IsPaused function tells whether the media element is paused.
	IsPaused() bool
}

MediaPlayer is a common interface for media player views like AudioPlayer and VideoPlayer.

type MediaSource

type MediaSource struct {
	// Url of the source
	Url string

	// MimeType of the source
	MimeType string
}

MediaSource represent one media file source

type MediaStyleParams added in v0.13.0

type MediaStyleParams struct {
	// Orientation for which particular style will be applied
	Orientation int

	// MinWidth for which particular style will be applied
	MinWidth int

	// MaxWidth for which particular style will be applied
	MaxWidth int

	// MinHeight for which particular style will be applied
	MinHeight int

	// MaxHeight for which particular style will be applied
	MaxHeight int
}

MediaStyleParams define rules when particular style will be applied

type MouseEvent

type MouseEvent struct {
	// TimeStamp is the time at which the event was created (in milliseconds).
	// This value is time since epoch—but in reality, browsers' definitions vary.
	TimeStamp uint64

	// Button indicates which button was pressed on the mouse to trigger the event:
	// PrimaryMouseButton (0), AuxiliaryMouseButton (1), SecondaryMouseButton (2),
	// MouseButton4 (3), and MouseButton5 (4)
	Button int

	// Buttons indicates which buttons are pressed on the mouse (or other input device)
	// when a mouse event is triggered. Each button that can be pressed is represented by a given mask:
	// PrimaryMouseMask (1), SecondaryMouseMask (2), AuxiliaryMouseMask (4), MouseMask4 (8), and MouseMask5 (16)
	Buttons int

	// X provides the horizontal coordinate within the view's viewport.
	X float64
	// Y provides the vertical coordinate within the view's viewport.
	Y float64

	// ClientX provides the horizontal coordinate within the application's viewport at which the event occurred.
	ClientX float64
	// ClientY provides the vertical coordinate within the application's viewport at which the event occurred.
	ClientY float64

	// ScreenX provides the horizontal coordinate (offset) of the mouse pointer in global (screen) coordinates.
	ScreenX float64
	// ScreenY provides the vertical coordinate (offset) of the mouse pointer in global (screen) coordinates.
	ScreenY float64

	// CtrlKey == true if the control key was down when the event was fired. false otherwise.
	CtrlKey bool
	// ShiftKey == true if the shift key was down when the event was fired. false otherwise.
	ShiftKey bool
	// AltKey == true if the alt key was down when the event was fired. false otherwise.
	AltKey bool
	// MetaKey == true if the meta key was down when the event was fired. false otherwise.
	MetaKey bool
}

MouseEvent represent a mouse event

type NamedColor added in v0.6.0

type NamedColor struct {
	// Name of a color
	Name string

	// Color value
	Color Color
}

NamedColor make a relation between color and its name

func NamedColors added in v0.6.0

func NamedColors() []NamedColor

NamedColors returns the list of named colors

type NumberPicker

type NumberPicker interface {
	View
}

NumberPicker represents a NumberPicker view

func NewNumberPicker

func NewNumberPicker(session Session, params Params) NumberPicker

NewNumberPicker create new NumberPicker object and return it

func NumberPickerByID

func NumberPickerByID(rootView View, id string, ids ...string) NumberPicker

NumberPickerByID return the NumberPicker path to which is specified using the arguments id, ids. Example

view := NumberPickerByID(rootView, "id1", "id2", "id3")
view := NumberPickerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not NumberPicker, the function will return nil

type OutlineProperty

type OutlineProperty interface {
	Properties

	fmt.Stringer

	// ViewOutline returns style color and line width of an outline
	ViewOutline(session Session) ViewOutline
	// contains filtered or unexported methods
}

OutlineProperty defines a view's outside border

func NewOutlineProperty

func NewOutlineProperty(params Params) OutlineProperty

NewOutlineProperty creates the new OutlineProperty.

The following properties can be used:

  • "color" (ColorTag) - Determines the line color (Color);
  • "width" (Width) - Determines the line thickness (SizeUnit).

type Params

type Params map[PropertyName]any

Params defines a type of a parameters list

func (Params) AllTags

func (params Params) AllTags() []PropertyName

AllTags returns a sorted slice of all properties.

func (Params) Clear added in v0.4.0

func (params Params) Clear()

Clear removes all properties from a map.

func (Params) Get added in v0.4.0

func (params Params) Get(tag PropertyName) any

Get returns a value of the property with name defined by the argument. The type of return value depends on the property. If the property is not set then nil is returned.

func (Params) Remove added in v0.4.0

func (params Params) Remove(tag PropertyName)

Remove removes the property with name defined by the argument from a map.

func (Params) Set added in v0.4.0

func (params Params) Set(tag PropertyName, value any) bool

Set sets the value (second argument) of the property with name defined by the first argument. Return "true" if the value has been set, in the opposite case "false" is returned and a description of an error is written to the log

type ParentView added in v0.10.1

type ParentView interface {
	// Views return a list of child views
	Views() []View
}

ParentView describe a view which can have a child views

type Path

type Path interface {
	// MoveTo begins a new sub-path at the point specified by the given (x, y) coordinates
	MoveTo(x, y float64)

	// LineTo adds a straight line to the current sub-path by connecting
	// the sub-path's last point to the specified (x, y) coordinates
	LineTo(x, y float64)

	// ArcTo adds a circular arc to the current sub-path, using the given control points and radius.
	// The arc is automatically connected to the path's latest point with a straight line, if necessary.
	//  - x0, y0 - coordinates of the first control point;
	//  - x1, y1 - coordinates of the second control point;
	//  - radius - the arc's radius. Must be non-negative.
	ArcTo(x0, y0, x1, y1, radius float64)

	// Arc adds a circular arc to the current sub-path.
	//   - x, y - coordinates of the arc's center;
	//   - radius - the arc's radius. Must be non-negative;
	//   - startAngle - the angle at which the arc starts, measured clockwise from the positive
	//                x-axis and expressed in radians.
	//   - endAngle - the angle at which the arc ends, measured clockwise from the positive
	//                x-axis and expressed in radians.
	//   - clockwise - if true, causes the arc to be drawn clockwise between the start and end angles,
	//               otherwise - counter-clockwise
	Arc(x, y, radius, startAngle, endAngle float64, clockwise bool)

	// BezierCurveTo adds a cubic Bézier curve to the current sub-path. The starting point is
	// the latest point in the current path.
	//   - cp0x, cp0y - coordinates of the first control point;
	//   - cp1x, cp1y - coordinates of the second control point;
	//   - x, y - coordinates of the end point.
	BezierCurveTo(cp0x, cp0y, cp1x, cp1y, x, y float64)

	// QuadraticCurveTo  adds a quadratic Bézier curve to the current sub-path.
	//   - cpx, cpy - coordinates of the control point;
	//   - x, y - coordinates of the end point.
	QuadraticCurveTo(cpx, cpy, x, y float64)

	// Ellipse adds an elliptical arc to the current sub-path
	//   - x, y - coordinates of the ellipse's center;
	//   - radiusX - the ellipse's major-axis radius. Must be non-negative;
	//   - radiusY - the ellipse's minor-axis radius. Must be non-negative;
	//   - rotation - the rotation of the ellipse, expressed in radians;
	//   - startAngle - the angle at which the ellipse starts, measured clockwise
	//                from the positive x-axis and expressed in radians;
	//   - endAngle - the angle at which the ellipse ends, measured clockwise
	//	            from the positive x-axis and expressed in radians.
	//   - clockwise - if true, draws the ellipse clockwise, otherwise draws counter-clockwise
	Ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle float64, clockwise bool)

	// Close adds a straight line from the current point to the start of the current sub-path.
	// If the shape has already been closed or has only one point, this function does nothing.
	Close()
	// contains filtered or unexported methods
}

Path is a path interface

type PointerEvent

type PointerEvent struct {
	MouseEvent

	// PointerID is a unique identifier for the pointer causing the event.
	PointerID int

	// Width is the width (magnitude on the X axis), in pixels, of the contact geometry of the pointer.
	Width float64
	// Height is the height (magnitude on the Y axis), in pixels, of the contact geometry of the pointer.
	Height float64

	// Pressure is the normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent
	// the minimum and maximum pressure the hardware is capable of detecting, respectively.
	Pressure float64

	// TangentialPressure is the normalized tangential pressure of the pointer input (also known
	// as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.
	TangentialPressure float64

	// TiltX is the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane
	// and the plane containing both the pointer (e.g. pen stylus) axis and the Y axis.
	TiltX float64

	// TiltY is the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane
	// and the plane containing both the pointer (e.g. pen stylus) axis and the X axis.
	TiltY float64

	// Twist is the clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees,
	// with a value in the range 0 to 359.
	Twist float64

	// PointerType indicates the device type that caused the event ("mouse", "pen", "touch", etc.)
	PointerType string

	// IsPrimary indicates if the pointer represents the primary pointer of this pointer type.
	IsPrimary bool
}

PointerEvent represent a stylus events. Also inherit MouseEvent attributes

type Popup interface {
	// View returns a content view of the popup
	View() View

	// Session returns current client session
	Session() Session

	// Show displays a popup
	Show()

	// Dismiss closes a popup
	Dismiss()
	// contains filtered or unexported methods
}

Popup represents a Popup view

func NewPopup

func NewPopup(view View, param Params) Popup

NewPopup creates a new Popup

func ShowMenu

func ShowMenu(session Session, params Params) Popup

ShowMenu displays the menu. Menu items are set using the Items property. The "popup-menu-result" property sets the function (format: func(int)) to be called when a menu item is selected.

func ShowPopup added in v0.8.0

func ShowPopup(view View, param Params) Popup

ShowPopup creates a new Popup and shows it

type PopupButton

type PopupButton struct {
	// Title of the button
	Title string

	// Type of the button
	Type PopupButtonType

	// OnClick is the handler function that gets called when the button is pressed
	OnClick func(Popup)
}

PopupButton describes a button that will be placed at the bottom of the window.

type PopupButtonType added in v0.13.0

type PopupButtonType int

PopupButtonType represent popup button type

const (
	// NormalButton is the constant of the popup button type: the normal button
	NormalButton PopupButtonType = 0

	// DefaultButton is the constant of the popup button type: button that fires when the "Enter" key is pressed
	DefaultButton PopupButtonType = 1

	// CancelButton is the constant of the popup button type: button that fires when the "Escape" key is pressed
	CancelButton PopupButtonType = 2
)

Constants which are used as a values of PopupButtonType variables

type ProgressBar

type ProgressBar interface {
	View
}

ProgressBar represents a ProgressBar view

func NewProgressBar

func NewProgressBar(session Session, params Params) ProgressBar

NewProgressBar create new ProgressBar object and return it

func ProgressBarByID

func ProgressBarByID(rootView View, id string, ids ...string) ProgressBar

ProgressBarByID return the ProgressBar path to which is specified using the arguments id, ids. Example

view := ProgressBarByID(rootView, "id1", "id2", "id3")
view := ProgressBarByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ProgressBar, the function will return nil

type Properties

type Properties interface {
	// Get returns a value of the property with name defined by the argument.
	// The type of return value depends on the property. If the property is not set then nil is returned.
	Get(tag PropertyName) any

	// Set sets the value (second argument) of the property with name defined by the first argument.
	// Return "true" if the value has been set, in the opposite case "false" are returned and
	// a description of the error is written to the log
	Set(tag PropertyName, value any) bool

	// Remove removes the property with name defined by the argument
	Remove(tag PropertyName)

	// Clear removes all properties
	Clear()

	// AllTags returns an array of the set properties
	AllTags() []PropertyName
	// contains filtered or unexported methods
}

Properties interface of properties map

type PropertyName added in v0.18.0

type PropertyName string
const (
	// TransitionRunEvent is the constant for "transition-run-event" property tag.
	//
	// Used by View:
	// Is fired when a transition is first created, i.e. before any transition delay has begun.
	//
	// General listener format:
	//  func(view rui.View, propertyName rui.PropertyName).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - propertyName - Name of the property.
	//
	// Allowed listener formats:
	//  func(view rui.View),
	//  func(propertyName rui.PropertyName)
	//  func().
	TransitionRunEvent PropertyName = "transition-run-event"

	// TransitionStartEvent is the constant for "transition-start-event" property tag.
	//
	// Used by View:
	// Is fired when a transition has actually started, i.e., after "delay" has ended.
	//
	// General listener format:
	//  func(view rui.View, propertyName rui.PropertyName).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - propertyName - Name of the property.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(propertyName rui.PropertyName)
	//  func()
	TransitionStartEvent PropertyName = "transition-start-event"

	// TransitionEndEvent is the constant for "transition-end-event" property tag.
	//
	// Used by View:
	// Is fired when a transition has completed.
	//
	// General listener format:
	//  func(view rui.View, propertyName rui.PropertyName).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - propertyName - Name of the property.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(propertyName rui.PropertyName)
	//  func()
	TransitionEndEvent PropertyName = "transition-end-event"

	// TransitionCancelEvent is the constant for "transition-cancel-event" property tag.
	//
	// Used by View:
	// Is fired when a transition is cancelled. The transition is cancelled when:
	//   - A new property transition has begun.
	//   - The "visibility" property is set to "gone".
	//   - The transition is stopped before it has run to completion, e.g. by moving the mouse off a hover-transitioning view.
	//
	// General listener format:
	//  func(view rui.View, propertyName rui.PropertyName).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - propertyName - Name of the property.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(propertyName rui.PropertyName)
	//  func()
	TransitionCancelEvent PropertyName = "transition-cancel-event"

	// AnimationStartEvent is the constant for "animation-start-event" property tag.
	//
	// Used by View:
	// Fired when an animation has started. If there is an "animation-delay", this event will fire once the delay period has
	// expired.
	//
	// General listener format:
	//  func(view rui.View, animationId string).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - animationId - Id of the animation.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(animationId string)
	//  func()
	AnimationStartEvent PropertyName = "animation-start-event"

	// AnimationEndEvent is the constant for "animation-end-event" property tag.
	//
	// Used by View:
	// Fired when an animation has completed. If the animation aborts before reaching completion, such as if the element is
	// removed or the animation is removed from the element, the "animation-end-event" is not fired.
	//
	// General listener format:
	//  func(view rui.View, animationId string).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - animationId - Id of the animation.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(animationId string)
	//  func()
	AnimationEndEvent PropertyName = "animation-end-event"

	// AnimationCancelEvent is the constant for "animation-cancel-event" property tag.
	//
	// Used by View:
	// Fired when an animation unexpectedly aborts. In other words, any time it stops running without sending the
	// "animation-end-event". This might happen when the animation-name is changed such that the animation is removed, or when
	// the animating view is hidden. Therefore, either directly or because any of its containing views are hidden. The event
	// is not supported by all browsers.
	//
	// General listener format:
	//  func(view rui.View, animationId string).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - animationId - Id of the animation.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(animationId string)
	//  func()
	AnimationCancelEvent PropertyName = "animation-cancel-event"

	// AnimationIterationEvent is the constant for "animation-iteration-event" property tag.
	//
	// Used by View:
	// Fired when an iteration of an animation ends, and another one begins. This event does not occur at the same time as the
	// animation end event, and therefore does not occur for animations with an "iteration-count" of one.
	//
	// General listener format:
	//  func(view rui.View, animationId string).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - animationId - Id of the animation.
	//
	// Allowed listener formats:
	//  func(view rui.View)
	//  func(animationId string)
	//  func()
	AnimationIterationEvent PropertyName = "animation-iteration-event"
)

Constants which describe values for view's animation events properties

const (
	// ColorChangedEvent is the constant for "color-changed" property tag.
	//
	// Used by `ColorPicker`.
	// Event generated when color picker value has been changed.
	//
	// General listener format:
	//  func(picker rui.ColorPicker, newColor, oldColor rui.Color)
	//
	// where:
	//   - picker - Interface of a color picker which generated this event,
	//   - newColor - New color value,
	//   - oldColor - Old color value.
	//
	// Allowed listener formats:
	//  func(picker rui.ColorPicker, newColor rui.Color)
	//  func(newColor, oldColor rui.Color)
	//  func(newColor rui.Color)
	//  func(picker rui.ColorPicker)
	//  func()
	ColorChangedEvent PropertyName = "color-changed"

	// ColorPickerValue is the constant for "color-picker-value" property tag.
	//
	// Used by `ColorPicker`.
	// Define current color picker value.
	//
	// Supported types: `Color`, `string`.
	//
	// Internal type is `Color`, other types converted to it during assignment.
	// See `Color` description for more details.
	ColorPickerValue PropertyName = "color-picker-value"
)

Constants for ColorPicker specific properties and events.

const (
	// ColumnCount is the constant for "column-count" property tag.
	//
	// Used by ColumnLayout.
	// Specifies number of columns into which the content is break. Values less than zero are not valid. If this property
	// value is 0 then the number of columns is calculated based on the "column-width" property.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "0" - Use "column-width" to control how many columns will be created.
	//   - positive value - Тhe number of columns into which the content is divided.
	ColumnCount PropertyName = "column-count"

	// ColumnWidth is the constant for "column-width" property tag.
	//
	// Used by ColumnLayout.
	// Specifies the width of each column.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ColumnWidth PropertyName = "column-width"

	// ColumnGap is the constant for "column-gap" property tag.
	//
	// Used by ColumnLayout.
	// Set the size of the gap (gutter) between columns.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ColumnGap PropertyName = "column-gap"

	// ColumnSeparator is the constant for "column-separator" property tag.
	//
	// Used by ColumnLayout.
	// Specifies the line drawn between columns in a multi-column layout.
	//
	// Supported types: ColumnSeparatorProperty, ViewBorder.
	//
	// Internal type is ColumnSeparatorProperty, other types converted to it during assignment.
	// See [ColumnSeparatorProperty] and [ViewBorder] description for more details.
	ColumnSeparator PropertyName = "column-separator"

	// ColumnSeparatorStyle is the constant for "column-separator-style" property tag.
	//
	// Used by ColumnLayout.
	// Controls the style of the line drawn between columns in a multi-column layout.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The separator will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a separator.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a separator.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a separator.
	//   - 4 (DoubleLine) or "double" - Double line as a separator.
	ColumnSeparatorStyle PropertyName = "column-separator-style"

	// ColumnSeparatorWidth is the constant for "column-separator-width" property tag.
	//
	// Used by ColumnLayout.
	// Set the width of the line drawn between columns in a multi-column layout.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	ColumnSeparatorWidth PropertyName = "column-separator-width"

	// ColumnSeparatorColor is the constant for "column-separator-color" property tag.
	//
	// Used by ColumnLayout.
	// Set the color of the line drawn between columns in a multi-column layout.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	ColumnSeparatorColor PropertyName = "column-separator-color"

	// ColumnFill is the constant for "column-fill" property tag.
	//
	// Used by ColumnLayout.
	// Controls how a ColumnLayout's content is balanced when broken into columns. Default value is "balance".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (ColumnFillBalance) or "balance" - Content is equally divided between columns.
	//   - 1 (ColumnFillAuto) or "auto" - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
	ColumnFill PropertyName = "column-fill"

	// ColumnSpanAll is the constant for "column-span-all" property tag.
	//
	// Used by ColumnLayout.
	// Property used in views placed inside the column layout container. Makes it possible for a view to span across all
	// columns. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or  "1" - View will span across all columns.
	//   - false, 0, "false", "no", "off", or "0" - View will be a part of a column.
	ColumnSpanAll PropertyName = "column-span-all"
)

Constants for ColumnLayout specific properties and events

const (
	// DateChangedEvent is the constant for "date-changed" property tag.
	//
	// Used by DatePicker.
	// Occur when date picker value has been changed.
	//
	// General listener format:
	//  func(picker rui.DatePicker, newDate time.Time, oldDate time.Time)
	//
	// where:
	//   - picker - Interface of a date picker which generated this event,
	//   - newDate - New date value,
	//   - oldDate - Old date value.
	//
	// Allowed listener formats:
	//  func(picker rui.DatePicker, newDate time.Time)
	//  func(newDate time.Time, oldDate time.Time)
	//  func(newDate time.Time)
	//  func(picker rui.DatePicker)
	//  func()
	DateChangedEvent PropertyName = "date-changed"

	// DatePickerMin is the constant for "date-picker-min" property tag.
	//
	// Used by DatePicker.
	// Minimum date value.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "YYYYMMDD" - "20240102".
	//   - "Mon-DD-YYYY" - "Jan-02-24".
	//   - "Mon-DD-YY" - "Jan-02-2024".
	//   - "DD-Mon-YYYY" - "02-Jan-2024".
	//   - "YYYY-MM-DD" - "2024-01-02".
	//   - "Month DD, YYYY" - "January 02, 2024".
	//   - "DD Month YYYY" - "02 January 2024".
	//   - "MM/DD/YYYY" - "01/02/2024".
	//   - "MM/DD/YY" - "01/02/24".
	//   - "MMDDYY" - "010224".
	DatePickerMin PropertyName = "date-picker-min"

	// DatePickerMax is the constant for "date-picker-max" property tag.
	//
	// Used by DatePicker.
	// Maximum date value.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "YYYYMMDD" - "20240102".
	//   - "Mon-DD-YYYY" - "Jan-02-24".
	//   - "Mon-DD-YY" - "Jan-02-2024".
	//   - "DD-Mon-YYYY" - "02-Jan-2024".
	//   - "YYYY-MM-DD" - "2024-01-02".
	//   - "Month DD, YYYY" - "January 02, 2024".
	//   - "DD Month YYYY" - "02 January 2024".
	//   - "MM/DD/YYYY" - "01/02/2024".
	//   - "MM/DD/YY" - "01/02/24".
	//   - "MMDDYY" - "010224".
	DatePickerMax PropertyName = "date-picker-max"

	// DatePickerStep is the constant for "date-picker-step" property tag.
	//
	// Used by DatePicker.
	// Date change step in days.
	//
	// Supported types: int, string.
	//
	// Values:
	// positive value - Step value in days used to increment or decrement date.
	DatePickerStep PropertyName = "date-picker-step"

	// DatePickerValue is the constant for "date-picker-value" property tag.
	//
	// Used by DatePicker.
	// Current value.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "YYYYMMDD" - "20240102".
	//   - "Mon-DD-YYYY" - "Jan-02-24".
	//   - "Mon-DD-YY" - "Jan-02-2024".
	//   - "DD-Mon-YYYY" - "02-Jan-2024".
	//   - "YYYY-MM-DD" - "2024-01-02".
	//   - "Month DD, YYYY" - "January 02, 2024".
	//   - "DD Month YYYY" - "02 January 2024".
	//   - "MM/DD/YYYY" - "01/02/2024".
	//   - "MM/DD/YY" - "01/02/24".
	//   - "MMDDYY" - "010224".
	DatePickerValue PropertyName = "date-picker-value"
)

Constants for DatePicker specific properties and events.

const (
	// Summary is the constant for "summary" property tag.
	//
	// Used by DetailsView.
	// The content of this property is used as the label for the disclosure widget.
	//
	// Supported types:
	//   - string - Summary as a text.
	//   - View - Summary as a view, in this case it can be quite complex if needed.
	Summary PropertyName = "summary"

	// Expanded is the constant for "expanded" property tag.
	//
	// Used by DetailsView.
	// Controls the content expanded state of the details view. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Content is visible.
	//   - false, 0, "false", "no", "off", or "0" - Content is collapsed (hidden).
	Expanded PropertyName = "expanded"

	// HideSummaryMarker is the constant for "hide-summary-marker" property tag.
	//
	// Used by DetailsView.
	// Allows you to hide the summary marker (▶︎). Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - The summary marker is hidden.
	//   - false, 0, "false", "no", "off", or "0" - The summary marker is displayed (default value).
	HideSummaryMarker PropertyName = "hide-summary-marker"
)

Constants for DetailsView specific properties and events

const (
	// EditTextChangedEvent is the constant for "edit-text-changed" property tag.
	//
	// Used by EditView.
	// Occur when edit view text has been changed.
	//
	// General listener format:
	//  func(editView rui.EditView, newText string, oldText string).
	//
	// where:
	//   - editView - Interface of an edit view which generated this event,
	//   - newText - New edit view text,
	//   - oldText - Previous edit view text.
	//
	// Allowed listener formats:
	//   - func(editView rui.EditView, newText string)
	//   - func(newText string, oldText string)
	//   - func(newText string)
	//   - func(editView rui.EditView)
	//   - func()
	EditTextChangedEvent PropertyName = "edit-text-changed"

	// EditViewType is the constant for "edit-view-type" property tag.
	//
	// Used by EditView.
	// Type of the text input. Default value is "text".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (SingleLineText) or "text" - One-line text editor.
	//   - 1 (PasswordText) or "password" - Password editor. The text is hidden by asterisks.
	//   - 2 (EmailText) or "email" - Single e-mail editor.
	//   - 3 (EmailsText) or "emails" - Multiple e-mail editor.
	//   - 4 (URLText) or "url" - Internet address input editor.
	//   - 5 (PhoneText) or "phone" - Phone number editor.
	//   - 6 (MultiLineText) or "multiline" - Multi-line text editor.
	EditViewType PropertyName = "edit-view-type"

	// EditViewPattern is the constant for "edit-view-pattern" property tag.
	//
	// Used by EditView.
	// Regular expression to limit editing of a text.
	//
	// Supported types: string.
	EditViewPattern PropertyName = "edit-view-pattern"

	// Spellcheck is the constant for "spellcheck" property tag.
	//
	// Used by EditView.
	// Enable or disable spell checker. Available in SingleLineText and MultiLineText types of edit view. Default value is
	// false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Enable spell checker for text.
	//   - false, 0, "false", "no", "off", "0" - Disable spell checker for text.
	Spellcheck PropertyName = "spellcheck"
)

Constants for EditView specific properties and events

const (
	// FileSelectedEvent is the constant for "file-selected-event" property tag.
	//
	// Used by FilePicker.
	// Fired when user selects file(s).
	//
	// General listener format:
	//  func(picker rui.FilePicker, files []rui.FileInfo).
	//
	// where:
	// picker - Interface of a file picker which generated this event,
	// files - Array of description of selected files.
	//
	// Allowed listener formats:
	//  func(picker rui.FilePicker)
	//  func(files []rui.FileInfo)
	//  func()
	FileSelectedEvent PropertyName = "file-selected-event"

	// Accept is the constant for "accept" property tag.
	//
	// Used by FilePicker.
	// Set the list of allowed file extensions or MIME types.
	//
	// Supported types: string, []string.
	//
	// Internal type is string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - may contain single value of multiple separated by comma(,).
	//   - []string - an array of acceptable file extensions or MIME types.
	Accept PropertyName = "accept"

	// Multiple is the constant for "multiple" property tag.
	//
	// Used by FilePicker.
	// Controls whether multiple files can be selected.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Several files can be selected.
	//   - false, 0, "false", "no", "off", "0" - Only one file can be selected.
	Multiple PropertyName = "multiple"
)

Constants for FilePicker specific properties and events

const (
	// Blur is the constant for "blur" property tag.
	//
	// Used by FilterProperty.
	// Applies a Gaussian blur. The value of radius defines the value of the standard deviation to the Gaussian function, or
	// how many pixels on the screen blend into each other, so a larger value will create more blur. The lacuna value for
	// interpolation is 0. The parameter is specified as a length in pixels.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Blur PropertyName = "blur"

	// Brightness is the constant for "brightness" property tag.
	//
	// Used by FilterProperty.
	// Applies a linear multiplier to input image, making it appear more or less bright. A value of 0% will create an image
	// that is completely black. A value of 100% leaves the input unchanged. Other values are linear multipliers on the
	// effect. Values of an amount over 100% are allowed, providing brighter results.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Brightness PropertyName = "brightness"

	// Contrast is the constant for "contrast" property tag.
	//
	// Used by FilterProperty.
	// Adjusts the contrast of the input. A value of 0% will create an image that is completely black. A value of 100% leaves
	// the input unchanged. Values of amount over 100% are allowed, providing results with less contrast.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Contrast PropertyName = "contrast"

	// DropShadow is the constant for "drop-shadow" property tag.
	//
	// Used by FilterProperty.
	// Applies a drop shadow effect to the input image. A drop shadow is effectively a blurred, offset version of the input
	// image's alpha mask drawn in a particular color, composited below the image. Shadow parameters are set using the
	// ShadowProperty interface.
	//
	// Supported types: []ShadowProperty, ShadowProperty, string.
	//
	// Internal type is []ShadowProperty, other types converted to it during assignment.
	// See ShadowProperty description for more details.
	//
	// Conversion rules:
	//   - []ShadowProperty - stored as is, no conversion performed.
	//   - ShadowProperty - converted to []ShadowProperty.
	//   - string - string representation of ShadowProperty. Example: "_{blur = 1em, color = black, spread-radius = 0.5em}".
	DropShadow PropertyName = "drop-shadow"

	// Grayscale is the constant for "grayscale" property tag.
	//
	// Used by FilterProperty.
	// Converts the input image to grayscale. The value of ‘amount’ defines the proportion of the conversion. A value of 100%
	// is completely grayscale. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on
	// the effect.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Grayscale PropertyName = "grayscale"

	// HueRotate is the constant for "hue-rotate" property tag.
	//
	// Used by FilterProperty.
	// Applies a hue rotation on the input image. The value of ‘angle’ defines the number of degrees around the color circle
	// the input samples will be adjusted. A value of 0deg leaves the input unchanged. If the ‘angle’ parameter is missing, a
	// value of 0deg is used. Though there is no maximum value, the effect of values above 360deg wraps around.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	HueRotate PropertyName = "hue-rotate"

	// Invert is the constant for "invert" property tag.
	//
	// Used by FilterProperty.
	// Inverts the samples in the input image. The value of ‘amount’ defines the proportion of the conversion. A value of 100%
	// is completely inverted. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on
	// the effect.
	//
	// Supported types: float64, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Invert PropertyName = "invert"

	// Saturate is the constant for "saturate" property tag.
	//
	// Used by FilterProperty.
	// Saturates the input image. The value of ‘amount’ defines the proportion of the conversion. A value of 0% is completely
	// un-saturated. A value of 100% leaves the input unchanged. Other values are linear multipliers on the effect. Values of
	// amount over 100% are allowed, providing super-saturated results.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Saturate PropertyName = "saturate"

	// Sepia is the constant for "sepia" property tag.
	//
	// Used by FilterProperty.
	// Converts the input image to sepia. The value of ‘amount’ defines the proportion of the conversion. A value of 100% is
	// completely sepia. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on the
	// effect.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Sepia PropertyName = "sepia"
)

Constants for FilterProperty specific properties and events

const (
	// FocusEvent is the constant for "focus-event" property tag.
	//
	// Used by View.
	// Occur when the view takes input focus.
	//
	// General listener format:
	//  func(rui.View).
	//
	// where:
	// view - Interface of a view which generated this event.
	//
	// Allowed listener formats:
	//  func().
	FocusEvent PropertyName = "focus-event"

	// LostFocusEvent is the constant for "lost-focus-event" property tag.
	//
	// Used by View.
	// Occur when the View lost input focus.
	//
	// General listener format:
	//  func(view rui.View).
	//
	// where:
	// view - Interface of a view which generated this event.
	//
	// Allowed listener formats:
	//  func()
	LostFocusEvent PropertyName = "lost-focus-event"
)

Constants which represent View specific focus events properties

const (
	// CellVerticalAlign is the constant for "cell-vertical-align" property tag.
	//
	// Used by GridLayout, SvgImageView.
	//
	// Usage in GridLayout:
	// Sets the default vertical alignment of GridLayout children within the cell they are occupying.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Full height stretch.
	//
	// Usage in SvgImageView:
	// Same as "vertical-align".
	CellVerticalAlign PropertyName = "cell-vertical-align"

	// CellHorizontalAlign is the constant for "cell-horizontal-align" property tag.
	//
	// Used by GridLayout, SvgImageView.
	//
	// Usage in GridLayout:
	// Sets the default horizontal alignment of GridLayout children within the occupied cell.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Full width stretch.
	//
	// Usage in SvgImageView:
	// Same as "horizontal-align".
	CellHorizontalAlign PropertyName = "cell-horizontal-align"

	// CellVerticalSelfAlign is the constant for "cell-vertical-self-align" property tag.
	//
	// Used by GridLayout.
	// Sets the vertical alignment of GridLayout children within the cell they are occupying. The property is set for the
	// child view of GridLayout.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Full height stretch.
	CellVerticalSelfAlign PropertyName = "cell-vertical-self-align"

	// CellHorizontalSelfAlign is the constant for "cell-horizontal-self-align" property tag.
	//
	// Used by GridLayout.
	// Sets the horizontal alignment of GridLayout children within the occupied cell. The property is set for the child view
	// of GridLayout.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Full width stretch.
	CellHorizontalSelfAlign PropertyName = "cell-horizontal-self-align"
)

Constants related to GridLayout specific properties and events

const (
	// KeyDownEvent is the constant for "key-down-event" property tag.
	//
	// Used by View.
	// Is fired when a key is pressed.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.KeyEvent).
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Key event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.KeyEvent)
	//  func()
	KeyDownEvent PropertyName = "key-down-event"

	// KeyUpEvent is the constant for "key-up-event" property tag.
	//
	// Used by View.
	// Is fired when a key is released.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.KeyEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Key event.
	//
	// Allowed listener formats:
	//
	//  func(view rui.View)
	//  func(event rui.KeyEvent)
	//  func()
	KeyUpEvent PropertyName = "key-up-event"
)

Constants which represent View specific keyboard events properties

const (
	// ListItemClickedEvent is the constant for "list-item-clicked" property tag.
	//
	// Used by ListView.
	// Occur when the user clicks on an item in the list.
	//
	// General listener format:
	//
	//  func(list rui.ListView, item int)
	//
	// where:
	//   - list - Interface of a list which generated this event,
	//   - item - An index of an item clicked.
	//
	// Allowed listener formats:
	//
	//  func(item int)
	//  func(list rui.ListView)
	//  func()
	ListItemClickedEvent PropertyName = "list-item-clicked"

	// ListItemSelectedEvent is the constant for "list-item-selected" property tag.
	//
	// Used by ListView.
	// Occur when a list item becomes selected.
	//
	// General listener format:
	//
	//  func(list rui.ListView, item int)
	//
	// where:
	//   - list - Interface of a list which generated this event,
	//   - item - An index of an item selected.
	//
	// Allowed listener formats:
	//
	//  func(item int)
	//  func(list rui.ListView)
	//  func()
	ListItemSelectedEvent PropertyName = "list-item-selected"

	// ListItemCheckedEvent is the constant for "list-item-checked" property tag.
	//
	// Used by ListView.
	// Occur when a list item checkbox becomes checked or unchecked.
	//
	// General listener format:
	//
	//  func(list rui.ListView, checkedItems []int).
	//
	// where:
	//   - list - Interface of a list which generated this event,
	//   - checkedItems - Array of indices of marked elements.
	//
	// Allowed listener formats:
	//
	//  func(checkedItems []int)
	//  func(list rui.ListView)
	//  func()
	ListItemCheckedEvent PropertyName = "list-item-checked"

	// ListItemStyle is the constant for "list-item-style" property tag.
	//
	// Used by ListView.
	// Defines the style of an unselected item.
	//
	// Supported types: string.
	ListItemStyle PropertyName = "list-item-style"

	// CurrentStyle is the constant for "current-style" property tag.
	//
	// Used by ListView.
	// Defines the style of the selected item when the ListView is focused.
	//
	// Supported types: string.
	CurrentStyle PropertyName = "current-style"

	// CurrentInactiveStyle is the constant for "current-inactive-style" property tag.
	//
	// Used by ListView.
	// Defines the style of the selected item when the ListView is unfocused.
	//
	// Supported types: string.
	CurrentInactiveStyle PropertyName = "current-inactive-style"
)

Constants which represent ListView specific properties and events

const (
	// Controls is the constant for "controls" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Controls whether the browser need to provide controls to allow user to control audio playback, volume, seeking and
	// pause/resume playback. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - The browser will offer controls to allow the user to control audio playback, volume, seeking and pause/resume playback.
	//   - false, 0, "false", "no", "off", "0" - No controls will be visible to the end user.
	Controls PropertyName = "controls"

	// Loop is the constant for "loop" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Controls whether the audio player will play media in a loop. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - The audio player will automatically seek back to the start upon reaching the end of the audio.
	//   - false, 0, "false", "no", "off", "0" - Audio player will stop playing when the end of the media file has been reached.
	Loop PropertyName = "loop"

	// Muted is the constant for "muted" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Controls whether the audio will be initially silenced. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Audio will be muted.
	//   - false, 0, "false", "no", "off", "0" - Audio playing normally.
	Muted PropertyName = "muted"

	// Preload is the constant for "preload" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Property is intended to provide a hint to the browser about what the author thinks will lead to the best user
	// experience. Default value is different for each browser.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (PreloadNone) or "none" - Media file must not be pre-loaded.
	//   - 1 (PreloadMetadata) or "metadata" - Only metadata is preloaded.
	//   - 2 (PreloadAuto) or "auto" - The entire media file can be downloaded even if the user doesn't have to use it.
	Preload PropertyName = "preload"

	// AbortEvent is the constant for "abort-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Fired when the resource was not fully loaded, but not as the result of an error.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	AbortEvent PropertyName = "abort-event"

	// CanPlayEvent is the constant for "can-play-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the browser can play the media, but estimates that not enough data has been loaded to play the media up to
	// its end without having to stop for further buffering of content.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	CanPlayEvent PropertyName = "can-play-event"

	// CanPlayThroughEvent is the constant for "can-play-through-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the browser estimates it can play the media up to its end without stopping for content buffering.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	CanPlayThroughEvent PropertyName = "can-play-through-event"

	// CompleteEvent is the constant for "complete-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the rendering of an OfflineAudioContext has been terminated.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	CompleteEvent PropertyName = "complete-event"

	// DurationChangedEvent is the constant for "duration-changed-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the duration attribute has been updated.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer, duration float64).
	//
	// where:
	//   - player - Interface of a player which generated this event,
	//   - duration - Current duration.
	//
	// Allowed listener formats:
	//
	//  func(player rui.MediaPlayer),
	//  func(duration float64),
	//  func()
	DurationChangedEvent PropertyName = "duration-changed-event"

	// EmptiedEvent is the constant for "emptied-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the media has become empty; for example, this event is sent if the media has already been loaded(or
	// partially loaded), and the HTMLMediaElement.load method is called to reload it.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	EmptiedEvent PropertyName = "emptied-event"

	// EndedEvent is the constant for "ended-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback has stopped because the end of the media was reached.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	EndedEvent PropertyName = "ended-event"

	// LoadedDataEvent is the constant for "loaded-data-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the first frame of the media has finished loading.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	LoadedDataEvent PropertyName = "loaded-data-event"

	// LoadedMetadataEvent is the constant for "loaded-metadata-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the metadata has been loaded.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	LoadedMetadataEvent PropertyName = "loaded-metadata-event"

	// LoadStartEvent is the constant for "load-start-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Fired when the browser has started to load a resource.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	LoadStartEvent PropertyName = "load-start-event"

	// PauseEvent is the constant for "pause-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback has been paused.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	PauseEvent PropertyName = "pause-event"

	// PlayEvent is the constant for "play-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback has begun.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	PlayEvent PropertyName = "play-event"

	// PlayingEvent is the constant for "playing-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback is ready to start after having been paused or delayed due to lack of data.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	PlayingEvent PropertyName = "playing-event"

	// ProgressEvent is the constant for "progress-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Fired periodically as the browser loads a resource.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	ProgressEvent PropertyName = "progress-event"

	// RateChangedEvent is the constant for "rate-changed-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback rate has changed.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer, rate float64).
	//
	// where:
	//   - player - Interface of a player which generated this event,
	//   - rate - Playback rate.
	//
	// Allowed listener formats:
	//
	//  func(player rui.MediaPlayer),
	//  func(rate float64),
	//  func()
	RateChangedEvent PropertyName = "rate-changed-event"

	// SeekedEvent is the constant for "seeked-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when a seek operation completed.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	SeekedEvent PropertyName = "seeked-event"

	// SeekingEvent is the constant for "seeking-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when a seek operation has began.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	SeekingEvent PropertyName = "seeking-event"

	// StalledEvent is the constant for "stalled-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	StalledEvent PropertyName = "stalled-event"

	// SuspendEvent is the constant for "suspend-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the media data loading has been suspended.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	SuspendEvent PropertyName = "suspend-event"

	// TimeUpdateEvent is the constant for "time-update-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the time indicated by the currentTime attribute has been updated.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer, time float64).
	//
	// where:
	//   - player - Interface of a player which generated this event,
	//   - time - Current time.
	//
	// Allowed listener formats:
	//
	//  func(player rui.MediaPlayer),
	//  func(time float64),
	//  func()
	TimeUpdateEvent PropertyName = "time-update-event"

	// VolumeChangedEvent is the constant for "volume-changed-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the volume has changed.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer, volume float64).
	//
	// where:
	//   - player - Interface of a player which generated this event,
	//   - volume - New volume level.
	//
	// Allowed listener formats:
	//
	//  func(player rui.MediaPlayer),
	//  func(volume float64),
	//  func()
	VolumeChangedEvent PropertyName = "volume-changed-event"

	// WaitingEvent is the constant for "waiting-event" property tag.
	//
	// Used by AudioPlayer, VideoPlayer.
	//
	// Occur when the playback has stopped because of a temporary lack of data.
	//
	// General listener format:
	//
	//  func(player rui.MediaPlayer)
	//
	// where:
	// player - Interface of a player which generated this event.
	//
	// Allowed listener formats:
	//
	//  func()
	WaitingEvent PropertyName = "waiting-event"

	// Error codes:
	//   - 0 (PlayerErrorUnknown) - Unknown error,
	//   - 1 (PlayerErrorAborted) - Fetching the associated resource was interrupted by a user request,
	//   - 2 (PlayerErrorNetwork) - Some kind of network error has occurred that prevented the media from successfully ejecting, even though it was previously available,
	//   - 3 (PlayerErrorDecode) - Although the resource was previously identified as being used, an error occurred while trying to decode the media resource,
	//   - 4 (PlayerErrorSourceNotSupported) - The associated resource object or media provider was found to be invalid.
	//
	// Allowed listener formats:
	//
	//  func(code int, message string),
	//  func(player rui.MediaPlayer),
	//  func()
	PlayerErrorEvent PropertyName = "player-error-event"

	// PreloadNone - value of the view "preload" property: indicates that the audio/video should not be preloaded.
	PreloadNone = 0

	// PreloadMetadata - value of the view "preload" property: indicates that only audio/video metadata (e.g. length) is fetched.
	PreloadMetadata = 1

	// PreloadAuto - value of the view "preload" property: indicates that the whole audio file can be downloaded,
	// even if the user is not expected to use it.
	PreloadAuto = 2

	// PlayerErrorUnknown - MediaPlayer error code: An unknown error.
	PlayerErrorUnknown = 0

	// PlayerErrorAborted - MediaPlayer error code: The fetching of the associated resource was aborted by the user's request.
	PlayerErrorAborted = 1

	// PlayerErrorNetwork - MediaPlayer error code: Some kind of network error occurred which prevented the media
	// from being successfully fetched, despite having previously been available.
	PlayerErrorNetwork = 2

	// PlayerErrorDecode - MediaPlayer error code: Despite having previously been determined to be usable,
	// an error occurred while trying to decode the media resource, resulting in an error.
	PlayerErrorDecode = 3

	// PlayerErrorSourceNotSupported - MediaPlayer error code: The associated resource or media provider object has been found to be unsuitable.
	PlayerErrorSourceNotSupported = 4
)

Constants which related to media player properties and events

const (
	// NumberChangedEvent is the constant for "number-changed" property tag.
	//
	// Used by NumberPicker.
	// Set listener(s) that track the change in the entered value.
	//
	// General listener format:
	//
	//  func(picker rui.NumberPicker, newValue float64, oldValue float64)
	//
	// where:
	//   - picker - Interface of a number picker which generated this event,
	//   - newValue - New value,
	//   - oldValue - Old Value.
	//
	// Allowed listener formats:
	//
	//  func(picker rui.NumberPicker, newValue float64)
	//  func(newValue float64, oldValue float64)
	//  func(newValue float64)
	//  func()
	NumberChangedEvent PropertyName = "number-changed"

	// NumberPickerType is the constant for "number-picker-type" property tag.
	//
	// Used by NumberPicker.
	// Sets the visual representation.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NumberEditor) or "editor" - Displayed as an editor.
	//   - 1 (NumberSlider) or "slider" - Displayed as a slider.
	NumberPickerType PropertyName = "number-picker-type"

	// NumberPickerMin is the constant for "number-picker-min" property tag.
	//
	// Used by NumberPicker.
	// Set the minimum value. The default value is 0.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	NumberPickerMin PropertyName = "number-picker-min"

	// NumberPickerMax is the constant for "number-picker-max" property tag.
	//
	// Used by NumberPicker.
	// Set the maximum value. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	NumberPickerMax PropertyName = "number-picker-max"

	// NumberPickerStep is the constant for "number-picker-step" property tag.
	//
	// Used by NumberPicker.
	// Set the value change step.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	NumberPickerStep PropertyName = "number-picker-step"

	// NumberPickerValue is the constant for "number-picker-value" property tag.
	//
	// Used by NumberPicker.
	// Current value. The default value is 0.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	NumberPickerValue PropertyName = "number-picker-value"

	// NumberPickerValue is the constant for "number-picker-value" property tag.
	//
	// Used by NumberPicker.
	// Precision of displaying fractional part in editor. The default value is 0 (not used).
	//
	// Supported types: int, int8...int64, uint, uint8...uint64, string.
	//
	// Internal type is float, other types converted to it during assignment.
	NumberPickerPrecision PropertyName = "number-picker-precision"
)

Constants related to NumberPicker specific properties and events

const (
	// PointerDown is the constant for "pointer-down" property tag.
	//
	// Used by View.
	// Fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at
	// least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is
	// fired when the stylus makes physical contact with the digitizer.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerDown PropertyName = "pointer-down"

	// PointerUp is the constant for "pointer-up" property tag.
	//
	// Used by View.
	// Is fired when a pointer is no longer active.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerUp PropertyName = "pointer-up"

	// PointerMove is the constant for "pointer-move" property tag.
	//
	// Used by View.
	// Is fired when a pointer changes coordinates.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerMove PropertyName = "pointer-move"

	// PointerCancel is the constant for "pointer-cancel" property tag.
	//
	// Used by View.
	// Is fired if the pointer will no longer be able to generate events (for example the related device is deactivated).
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerCancel PropertyName = "pointer-cancel"

	// PointerOut is the constant for "pointer-out" property tag.
	//
	// Used by View.
	// Is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing
	// the "pointer-up" event for a device that does not support hover (see "pointer-up"); after firing the "pointer-cancel"
	// event (see "pointer-cancel"); when a pen stylus leaves the hover range detectable by the digitizer.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerOut PropertyName = "pointer-out"

	// PointerOver is the constant for "pointer-over" property tag.
	//
	// Used by View.
	// Is fired when a pointing device is moved into an view's hit test boundaries.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.PointerEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Pointer event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.PointerEvent)
	//  func(view rui.View)
	//  func()
	PointerOver PropertyName = "pointer-over"
)

Constants for View specific pointer events properties

const (
	// ProgressBarMax is the constant for "progress-max" property tag.
	//
	// Used by ProgressBar.
	// Maximum value, default is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ProgressBarMax PropertyName = "progress-max"

	// ProgressBarValue is the constant for "progress-value" property tag.
	//
	// Used by ProgressBar.
	// Current value, default is 0.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ProgressBarValue PropertyName = "progress-value"
)

Constants for ProgressBar specific properties and events

const (
	// ID is the constant for "id" property tag.
	//
	// # Used by View, AnimationProperty.
	//
	// Usage in View:
	// Optional textual identifier for the view. Used to reference view from source code if needed.
	//
	// Supported types: string.
	//
	// # Usage in AnimationProperty:
	//
	// Specifies the animation identifier. Used only for animation script.
	//
	// Supported types: string.
	ID PropertyName = "id"

	// Style is the constant for "style" property tag.
	//
	// Used by ColumnSeparatorProperty, View, BorderProperty, OutlineProperty.
	//
	// # Usage in ColumnSeparatorProperty:
	//
	// Line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The separator will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a separator.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a separator.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a separator.
	//   - 4 (DoubleLine) or "double" - Double line as a separator.
	//
	// # Usage in View:
	//
	// Sets the name of the style that is applied to the view when the "disabled" property is set to false or "style-disabled"
	// property is not defined.
	//
	// Supported types: string.
	//
	// # Usage in BorderProperty:
	//
	// Border line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	//
	// # Usage in OutlineProperty:
	//
	// Outline line style.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The outline will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as an outline.
	//   - 2 (DashedLine) or "dashed" - Dashed line as an outline.
	//   - 3 (DottedLine) or "dotted" - Dotted line as an outline.
	//   - 4 (DoubleLine) or "double" - Double line as an outline.
	Style PropertyName = "style"

	// StyleDisabled is the constant for "style-disabled" property tag.
	//
	// Used by View.
	// Sets the name of the style that is applied to the view when the "disabled" property is set to true.
	//
	// Supported types: string.
	StyleDisabled PropertyName = "style-disabled"

	// Disabled is the constant for "disabled" property tag.
	//
	// Used by ViewsContainer.
	// Controls whether the view can receive focus and which style to use. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - View can't receive focus and "style-disabled" style will be used by the view.
	//   - false, 0, "false", "no", "off", or "0" - View can receive focus and "style" style will be used by the view.
	Disabled PropertyName = "disabled"

	// Focusable is the constant for "focusable" property tag.
	//
	// Used by View.
	// Controls whether view can receive focus.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - View can have a focus.
	//   - false, 0, "false", "no", "off", or "0" - View can't have a focus.
	Focusable PropertyName = "focusable"

	// Semantics is the constant for "semantics" property tag.
	//
	// Used by View.
	// Defines the semantic meaning of the view. This property may have no visible effect, but it allows search engines to
	// understand the structure of your application. It also helps to voice the interface to systems for people with
	// disabilities.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (DefaultSemantics) or "default" - Default semantics.
	//   - 1 (ArticleSemantics) or "article" - Article semantics.
	//   - 2 (SectionSemantics) or "section" - Section semantics.
	//   - 3 (AsideSemantics) or "aside" - Aside semantics.
	//   - 4 (HeaderSemantics) or "header" - Header semantics.
	//   - 5 (MainSemantics) or "main" - Main semantics.
	//   - 6 (FooterSemantics) or "footer" - Footer semantics.
	//   - 7 (NavigationSemantics) or "navigation" - Navigation semantics.
	//   - 8 (FigureSemantics) or "figure" - Figure semantics.
	//   - 9 (FigureCaptionSemantics) or "figure-caption" - Figure caption semantics.
	//   - 10 (ButtonSemantics) or "button" - Button semantics.
	//   - 11 (ParagraphSemantics) or "p" - Paragraph semantics.
	//   - 12 (H1Semantics) or "h1" - Heading level 1 semantics.
	//   - 13 (H2Semantics) or "h2" - Heading level 2 semantics.
	//   - 14 (H3Semantics) or "h3" - Heading level 3 semantics.
	//   - 15 (H4Semantics) or "h4" - Heading level 4 semantics.
	//   - 16 (H5Semantics) or "h5" - Heading level 5 semantics.
	//   - 17 (H6Semantics) or "h6" - Heading level 6 semantics.
	//   - 18 (BlockquoteSemantics) or "blockquote" - Blockquote semantics.
	//   - 19 (CodeSemantics) or "code" - Code semantics.
	Semantics PropertyName = "semantics"

	// Visibility is the constant for "visibility" property tag.
	//
	// Used by View.
	// Specifies the visibility of the view.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (Visible) or "visible" - The view is visible.
	//   - 1 (Invisible) or "invisible" - The view is invisible but takes up space.
	//   - 2 (Gone) or "gone" - The view is invisible and does not take up space.
	Visibility PropertyName = "visibility"

	// ZIndex is the constant for "z-index" property tag.
	//
	// Used by View.
	// Sets the z-order of a positioned view. Overlapping views with a larger z-index cover those with a smaller one.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - Views with lower value will be behind views with higher value.
	//   - not negative value - Views with higher value will be on top of views with lower value.
	ZIndex PropertyName = "z-index"

	// Opacity is the constant for "opacity" property tag.
	//
	// Used by View, FilterProperty.
	//
	// # Usage in View:
	//
	// In [1..0] range sets the opacity of view. Opacity is the degree to which content behind the view is hidden, and is the
	// opposite of transparency.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	//
	// # Usage in FilterProperty:
	//
	// Opacity is the degree to which content behind the view is hidden, and is the opposite of transparency. Value is in
	// range 0% to 100%, where 0% is fully transparent.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	Opacity PropertyName = "opacity"

	// Overflow is the constant for "overflow" property tag.
	//
	// Used by View.
	// Set the desired behavior for an element's overflow i.e. when an element's content is too big to fit in its block
	// formatting context in both directions.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (OverflowHidden) or "hidden" - The overflow is clipped, and the rest of the content will be invisible.
	//   - 1 (OverflowVisible) or "visible" - The overflow is not clipped. The content renders outside the element's box.
	//   - 2 (OverflowScroll) or "scroll" - The overflow is clipped, and a scrollbar is added to see the rest of the content.
	//   - 3 (OverflowAuto) or "auto" - Similar to OverflowScroll, but it adds scrollbars only when necessary.
	Overflow PropertyName = "overflow"

	// Row is the constant for "row" property tag.
	//
	// Used by View.
	// Row of the view inside the container like GridLayout.
	//
	// Supported types: Range, int, string.
	//
	// Internal type is Range, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - int - set single value(index).
	//   - string - can contain single integer value(index) or a range of integer values(indices), examples: "0", "0:3".
	Row PropertyName = "row"

	// Column is the constant for "column" property tag.
	//
	// Used by View.
	// Column of the view inside the container like GridLayout.
	//
	// Supported types: Range, int, string.
	//
	// Internal type is Range, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - int - set single value(index).
	//   - string - can contain single integer value(index) or a range of integer values(indices), examples: "0", "0:3".
	Column PropertyName = "column"

	// Left is the constant for "left" property tag.
	//
	// Used by View, BoundsProperty, ClipShapeProperty.
	//
	// # Usage in View:
	//
	// Offset from left border of the container. Used only for views placed in an AbsoluteLayout.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in BoundsProperty:
	//
	// Left bound value.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in ClipShapeProperty:
	//
	// Specifies the left border position of inset clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Left PropertyName = "left"

	// Right is the constant for "right" property tag.
	//
	// Used by View, BoundsProperty, ClipShapeProperty.
	//
	// # Usage in View:
	//
	// Offset from right border of the container. Used only for views placed in an AbsoluteLayout.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in BoundsProperty:
	//
	// Right bound value.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in ClipShapeProperty:
	//
	// Specifies the right border position of inset clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Right PropertyName = "right"

	// Top is the constant for "top" property tag.
	//
	// Used by View, BoundsProperty, ClipShapeProperty.
	//
	// # Usage in View:
	//
	// Offset from top border of the container. Used only for views placed in an AbsoluteLayout.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in BoundsProperty:
	//
	// Top bound value.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in ClipShapeProperty:
	//
	// Specifies the top border position of inset clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Top PropertyName = "top"

	// Bottom is the constant for "bottom" property tag.
	//
	// Used by View, BoundsProperty, ClipShapeProperty.
	//
	// # Usage in View:
	//
	// Offset from bottom border of the container. Used only for views placed in an AbsoluteLayout.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in BoundsProperty:
	//
	// Bottom bound value.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in ClipShapeProperty:
	//
	// Specifies the bottom border position of inset clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Bottom PropertyName = "bottom"

	// Width is the constant for "width" property tag.
	//
	// Used by ColumnSeparatorProperty, View, BorderProperty, OutlineProperty.
	//
	// # Usage in ColumnSeparatorProperty:
	//
	// Line width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in View:
	//
	// Set a view's width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in BorderProperty:
	//
	// Border line width.
	//
	// Supported types: SizeUnit, string.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in OutlineProperty:
	//
	// Outline line width.
	//
	// Supported types: SizeUnit, string.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Width PropertyName = "width"

	// Height is the constant for "height" property tag.
	//
	// Used by View.
	// Set a view's height.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Height PropertyName = "height"

	// MinWidth is the constant for "min-width" property tag.
	//
	// Used by View.
	// Set a view's minimal width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MinWidth PropertyName = "min-width"

	// MinHeight is the constant for "min-height" property tag.
	//
	// Used by View.
	// Set a view's minimal height.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MinHeight PropertyName = "min-height"

	// MaxWidth is the constant for "max-width" property tag.
	//
	// Used by View.
	// Set a view's maximal width.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MaxWidth PropertyName = "max-width"

	// MaxHeight is the constant for "max-height" property tag.
	//
	// Used by View.
	// Set a view's maximal height.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MaxHeight PropertyName = "max-height"

	// Margin is the constant for "margin" property tag.
	//
	// Used by View.
	// Set the margin area on all four sides of an element.
	//
	// Supported types: BoundsProperty, Bounds, SizeUnit, float32, float64, int, string.
	//
	// Internal type could be BoundsProperty or SizeUnit depending on whether single value or multiple values has been set, other types converted to them during assignment.
	// See BoundsProperty, Bounds, SizeUnit for more information.
	//
	// Conversion rules:
	//   - BoundsProperty - stored as is, no conversion performed.
	//   - Bounds - new BoundsProperty will be created and corresponding values for top, right, bottom and left border will be set.
	//   - SizeUnit - stored as is and the same value will be used for all borders.
	//   - float - new SizeUnit will be created and the same value(in pixels) will be used for all borders.
	//   - int - new SizeUnit will be created and the same value(in pixels) will be used for all borders.
	//   - string - can contain one or four SizeUnit separated with comma(,). In case one value will be provided a new SizeUnit will be created and the same value will be used for all borders. If four values will be provided then they will be set respectively for top, right, bottom and left border.
	Margin PropertyName = "margin"

	// MarginLeft is the constant for "margin-left" property tag.
	//
	// Used by View.
	// Set the margin area on the left of a view. A positive value places it farther from its neighbors, while a negative
	// value places it closer.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MarginLeft PropertyName = "margin-left"

	// MarginRight is the constant for "margin-right" property tag.
	//
	// Used by View.
	// Set the margin area on the right of a view. A positive value places it farther from its neighbors, while a negative
	// value places it closer.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MarginRight PropertyName = "margin-right"

	// MarginTop is the constant for "margin-top" property tag.
	//
	// Used by View.
	// Set the margin area on the top of a view. A positive value places it farther from its neighbors, while a negative value
	// places it closer.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MarginTop PropertyName = "margin-top"

	// MarginBottom is the constant for "margin-bottom" property tag.
	//
	// Used by View.
	// Set the margin area on the bottom of a view. A positive value places it farther from its neighbors, while a negative
	// value places it closer.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	MarginBottom PropertyName = "margin-bottom"

	// Padding is the constant for "padding" property tag.
	//
	// Used by View.
	// Sets the padding area on all four sides of a view at once. An element's padding area is the space between its content
	// and its border.
	//
	// Supported types: BoundsProperty, Bounds, SizeUnit, float32, float64, int, string.
	//
	// Internal type could be BoundsProperty or SizeUnit depending on whether single value or multiple values has been set, other types converted to them during assignment.
	// See BoundsProperty, Bounds, SizeUnit for more information.
	//
	// Conversion rules:
	//   - BoundsProperty - stored as is, no conversion performed.
	//   - Bounds - new BoundsProperty will be created and corresponding values for top, right, bottom and left border will be set.
	//   - SizeUnit - stored as is and the same value will be used for all borders.
	//   - float - new SizeUnit will be created and the same value(in pixels) will be used for all borders.
	//   - int - new SizeUnit will be created and the same value(in pixels) will be used for all borders.
	//   - string - can contain one or four SizeUnit separated with comma(,). In case one value will be provided a new SizeUnit will be created and the same value will be used for all borders. If four values will be provided then they will be set respectively for top, right, bottom and left border.
	Padding PropertyName = "padding"

	// PaddingLeft is the constant for "padding-left" property tag.
	//
	// Used by View.
	// Set the width of the padding area to the left of a view.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	PaddingLeft PropertyName = "padding-left"

	// PaddingRight is the constant for "padding-right" property tag.
	//
	// Used by View.
	// Set the width of the padding area to the right of a view.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	PaddingRight PropertyName = "padding-right"

	// PaddingTop is the constant for "padding-top" property tag.
	//
	// Used by View.
	// Set the height of the padding area to the top of a view.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	PaddingTop PropertyName = "padding-top"

	// PaddingBottom is the constant for "padding-bottom" property tag.
	//
	// Used by View.
	// Set the height of the padding area to the bottom of a view.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	PaddingBottom PropertyName = "padding-bottom"

	// AccentColor is the constant for "accent-color" property tag.
	//
	// Used by View.
	// Sets the accent color for UI controls generated by some elements.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	AccentColor PropertyName = "accent-color"

	// BackgroundColor is the constant for "background-color" property tag.
	//
	// Used by View.
	// Set the background color of a view.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BackgroundColor PropertyName = "background-color"

	// Background is the constant for "background" property tag.
	//
	// Used by View.
	// Set one or more background images and/or gradients for the view.
	//
	// Supported types: BackgroundElement, []BackgroundElement, string.
	//
	// Internal type is []BackgroundElement, other types converted to it during assignment.
	// See BackgroundElement description for more details.
	//
	// Conversion rules:
	//   - string - must contain text representation of background element(s) like in resource files.
	Background PropertyName = "background"

	// Mask is the constant for "mask" property tag.
	//
	// Used by View.
	// Set one or more images and/or gradients as the view mask.
	// As mask is used only alpha channel of images and/or gradients.
	//
	// Supported types: BackgroundElement, []BackgroundElement, string.
	//
	// Internal type is []BackgroundElement, other types converted to it during assignment.
	// See BackgroundElement description for more details.
	//
	// Conversion rules:
	//   - string - must contain text representation of background element(s) like in resource files.
	Mask PropertyName = "mask"

	// Cursor is the constant for "cursor" property tag.
	//
	// Used by View.
	// Sets the type of mouse cursor, if any, to show when the mouse pointer is over the view.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "auto" - Auto cursor.
	//   - 1 or "default" - Default cursor.
	//   - 2 or "none" - None cursor.
	//   - 3 or "context-menu" - Context menu cursor.
	//   - 4 or "help" - Help cursor.
	//   - 5 or "pointer" - Pointer cursor.
	//   - 6 or "progress" - Progress cursor.
	//   - 7 or "wait" - Wait cursor.
	//   - 8 or "cell" - Cell cursor.
	//   - 9 or "crosshair" - Crosshair cursor.
	//   - 10 or "text" - Text cursor.
	//   - 11 or "vertical-text" - Vertical text cursor.
	//   - 12 or "alias" - Alias cursor.
	//   - 13 or "copy" - Copy cursor.
	//   - 14 or "move" - Move cursor.
	//   - 15 or "no-drop" - No drop cursor.
	//   - 16 or "not-allowed" - Not allowed cursor.
	//   - 17 or "e-resize" - Resize cursor.
	//   - 18 or "n-resize" - Resize cursor.
	//   - 19 or "ne-resize" - Resize cursor.
	//   - 20 or "nw-resize" - Resize cursor.
	//   - 21 or "s-resize" - Resize cursor.
	//   - 22 or "se-resize" - Resize cursor.
	//   - 23 or "sw-resize" - Resize cursor.
	//   - 24 or "w-resize" - Resize cursor.
	//   - 25 or "ew-resize" - Resize cursor.
	//   - 26 or "ns-resize" - Resize cursor.
	//   - 27 or "nesw-resize" - Resize cursor.
	//   - 28 or "nwse-resize" - Resize cursor.
	//   - 29 or "col-resize" - Col resize cursor.
	//   - 30 or "row-resize" - Row resize cursor.
	//   - 31 or "all-scroll" - All scroll cursor.
	//   - 32 or "zoom-in" - Zoom in cursor.
	//   - 33 or "zoom-out" - Zoom out cursor.
	//   - 34 or "grab" - Grab cursor.
	//   - 35 or "grabbing" - Grabbing cursor.
	Cursor PropertyName = "cursor"

	// Border is the constant for "border" property tag.
	//
	// Used by View.
	// Set a view's border. It sets the values of a border width, style, and color.
	//
	// Supported types: BorderProperty, ViewBorder, ViewBorders.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See BorderProperty, ViewBorder, ViewBorders description for more details.
	//
	// Conversion rules:
	//   - ViewBorder - style, width and color applied to all borders and stored in internal implementation of BorderProperty.
	//   - ViewBorders - style, width and color of each border like top, right, bottom and left applied to related borders, stored in internal implementation of BorderProperty.
	Border PropertyName = "border"

	// BorderLeft is the constant for "border-left" property tag.
	//
	// Used by View.
	// Set a view's left border. It sets the values of a border width, style, and color.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder, BorderProperty description for more details.
	BorderLeft PropertyName = "border-left"

	// BorderRight is the constant for "border-right" property tag.
	//
	// Used by View.
	// Set a view's right border. It sets the values of a border width, style, and color.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder, BorderProperty description for more details.
	BorderRight PropertyName = "border-right"

	// BorderTop is the constant for "border-top" property tag.
	//
	// Used by View.
	// Set a view's top border. It sets the values of a border width, style, and color.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder, BorderProperty description for more details.
	BorderTop PropertyName = "border-top"

	// BorderBottom is the constant for "border-bottom" property tag.
	//
	// Used by View.
	// Set a view's bottom border. It sets the values of a border width, style, and color.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder, BorderProperty description for more details.
	BorderBottom PropertyName = "border-bottom"

	// BorderStyle is the constant for "border-style" property tag.
	//
	// Used by View.
	// Set the line style for all four sides of a view's border.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	BorderStyle PropertyName = "border-style"

	// BorderLeftStyle is the constant for "border-left-style" property tag.
	//
	// Used by View.
	// Set the line style of a view's left border.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	BorderLeftStyle PropertyName = "border-left-style"

	// BorderRightStyle is the constant for "border-right-style" property tag.
	//
	// Used by View.
	// Set the line style of a view's right border.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	BorderRightStyle PropertyName = "border-right-style"

	// BorderTopStyle is the constant for "border-top-style" property tag.
	//
	// Used by View.
	// Set the line style of a view's top border.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	BorderTopStyle PropertyName = "border-top-style"

	// BorderBottomStyle is the constant for "border-bottom-style" property tag.
	//
	// Used by View.
	// Sets the line style of a view's bottom border.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	BorderBottomStyle PropertyName = "border-bottom-style"

	// BorderWidth is the constant for "border-width" property tag.
	//
	// Used by View.
	// Set the line width for all four sides of a view's border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BorderWidth PropertyName = "border-width"

	// BorderLeftWidth is the constant for "border-left-width" property tag.
	//
	// Used by View.
	// Set the line width of a view's left border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BorderLeftWidth PropertyName = "border-left-width"

	// BorderRightWidth is the constant for "border-right-width" property tag.
	//
	// Used by View.
	// Set the line width of a view's right border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BorderRightWidth PropertyName = "border-right-width"

	// BorderTopWidth is the constant for "border-top-width" property tag.
	//
	// Used by View.
	// Set the line width of a view's top border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BorderTopWidth PropertyName = "border-top-width"

	// BorderBottomWidth is the constant for "border-bottom-width" property tag.
	//
	// Used by View.
	// Set the line width of a view's bottom border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	BorderBottomWidth PropertyName = "border-bottom-width"

	// BorderColor is the constant for "border-color" property tag.
	//
	// Used by View.
	// Set the line color for all four sides of a view's border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BorderColor PropertyName = "border-color"

	// BorderLeftColor is the constant for "border-left-color" property tag.
	//
	// Used by View.
	// Set the line color of a view's left border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BorderLeftColor PropertyName = "border-left-color"

	// BorderRightColor is the constant for "border-right-color" property tag.
	//
	// Used by View.
	// Set the line color of a view's right border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BorderRightColor PropertyName = "border-right-color"

	// BorderTopColor is the constant for "border-top-color" property tag.
	//
	// Used by View.
	// Set the line color of a view's top border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BorderTopColor PropertyName = "border-top-color"

	// BorderBottomColor is the constant for "border-bottom-color" property tag.
	//
	// Used by View.
	// Set the line color of a view's bottom border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	BorderBottomColor PropertyName = "border-bottom-color"

	// Outline is the constant for "outline" property tag.
	//
	// Used by View.
	// Set a view's outline. It sets the values of an outline width, style, and color.
	//
	// Supported types: OutlineProperty, ViewOutline, ViewBorder.
	//
	// Internal type is OutlineProperty, other types converted to it during assignment.
	// See OutlineProperty, ViewOutline and ViewBorder description for more details.
	Outline PropertyName = "outline"

	// OutlineStyle is the constant for "outline-style" property tag.
	//
	// Used by View.
	// Set the style of an view's outline.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The outline will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as an outline.
	//   - 2 (DashedLine) or "dashed" - Dashed line as an outline.
	//   - 3 (DottedLine) or "dotted" - Dotted line as an outline.
	//   - 4 (DoubleLine) or "double" - Double line as an outline.
	OutlineStyle PropertyName = "outline-style"

	// OutlineColor is the constant for "outline-color" property tag.
	//
	// Used by View.
	// Set the color of an view's outline.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	OutlineColor PropertyName = "outline-color"

	// OutlineWidth is the constant for "outline-width" property tag.
	//
	// Used by View.
	// Set the width of an view's outline.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	OutlineWidth PropertyName = "outline-width"

	// OutlineOffset is the constant for "outline-offset" property tag.
	//
	// Used by View.
	// Set the amount of space between an outline and the edge or border of a view.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	OutlineOffset PropertyName = "outline-offset"

	// Shadow is the constant for "shadow" property tag.
	//
	// Used by View.
	// Adds shadow effects around a view's frame. A shadow is described by X and Y offsets relative to the element, blur,
	// spread radius and color.
	//
	// Supported types: ShadowProperty, []ShadowProperty, string.
	//
	// Internal type is []ShadowProperty, other types converted to it during assignment.
	// See ShadowProperty description for more details.
	//
	// Conversion rules:
	//   - []ShadowProperty - stored as is. no conversion performed.
	//   - ShadowProperty - converted to []ShadowProperty during assignment.
	//   - string - must contain a string representation of ShadowProperty
	Shadow PropertyName = "shadow"

	// FontName is the constant for "font-name" property tag.
	//
	// Used by View.
	// Specifies a prioritized list of one or more font family names and/or generic family names for the view. Values are
	// separated by commas to indicate that they are alternatives. This is an inherited property, i.e. if it is not defined,
	// then the value of the parent view is used.
	//
	// Supported types: string.
	FontName PropertyName = "font-name"

	// TextColor is the constant for "text-color" property tag.
	//
	// Used by View.
	// Set the foreground color value of a view's text and text decorations. This is an inherited property, i.e. if it is not
	// defined, then the value of the parent view is used.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	TextColor PropertyName = "text-color"

	// TextSize is the constant for "text-size" property tag.
	//
	// Used by View.
	// Set the size of the font. This is an inherited property, i.e. if it is not defined, then the value of the parent view
	// is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	TextSize PropertyName = "text-size"

	// Italic is the constant for "italic" property tag.
	//
	// Used by View.
	// Controls whether the text is displayed in italics. This is an inherited property, i.e. if it is not defined, then the
	// value of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Text is displayed in italics.
	//   - false, 0, "false", "no", "off", or "0" - Normal text.
	Italic PropertyName = "italic"

	// SmallCaps is the constant for "small-caps" property tag.
	//
	// Used by View.
	// Controls whether to use small caps characters while displaying the text. This is an inherited property, i.e. if it is
	// not defined, then the value of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Text displayed using small caps.
	//   - false, 0, "false", "no", "off", or "0" - Normal text display.
	SmallCaps PropertyName = "small-caps"

	// Strikethrough is the constant for "strikethrough" property tag.
	//
	// Used by View.
	// Controls whether to draw line over the text. This is an inherited property, i.e. if it is not defined, then the value
	// of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Draw line over the text.
	//   - false, 0, "false", "no", "off", or "0" - Normal text display.
	Strikethrough PropertyName = "strikethrough"

	// Overline is the constant for "overline" property tag.
	//
	// Used by View.
	// Controls whether the line needs to be displayed on top of the text. This is an inherited property, i.e. if it is not
	// defined, then the value of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Overline text.
	//   - false, 0, "false", "no", "off", or "0" - No overline.
	Overline PropertyName = "overline"

	// Underline is the constant for "underline" property tag.
	//
	// Used by View.
	// Controls whether to draw line below the text, This is an inherited property, i.e. if it is not defined, then the value
	// of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Draw line below the text.
	//   - false, 0, "false", "no", "off", or "0" - Normal text display.
	Underline PropertyName = "underline"

	// TextLineThickness is the constant for "text-line-thickness" property tag.
	//
	// Used by View.
	// Set the stroke thickness of the decoration line that is used on text in an element, such as a strikethrough, underline,
	// or overline. This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	TextLineThickness PropertyName = "text-line-thickness"

	// TextLineStyle is the constant for "text-line-style" property tag.
	//
	// Used by View.
	// Set the style of the lines specified by "strikethrough", "overline" and "underline" properties. This is an inherited
	// property, i.e. if it is not defined, then the value of the parent view is used.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 1 (SolidLine) or "solid" - Solid line as a text line.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a text line.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a text line.
	//   - 4 (DoubleLine) or "double" - Double line as a text line.
	//   - 5 (WavyLine) or "wavy" - Wavy line as a text line.
	TextLineStyle PropertyName = "text-line-style"

	// TextLineColor is the constant for "text-line-color" property tag.
	//
	// Used by View.
	// Sets the color of the lines specified by "strikethrough", "overline" and "underline" properties. This is an inherited
	// property, i.e. if it is not defined, then the value of the parent view is used.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	TextLineColor PropertyName = "text-line-color"

	// TextWeight is the constant for "text-weight" property tag.
	//
	// Used by View.
	// Sets weight of the text.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 1 (ThinFont) or "thin" - Thin font.
	//   - 2 (ExtraLightFont) or "extra-light" - Extra light font.
	//   - 3 (LightFont) or "light" - Light font.
	//   - 4 (NormalFont) or "normal" - Normal font.
	//   - 5 (MediumFont) or "medium" - Medium font.
	//   - 6 (SemiBoldFont) or "semi-bold" - Semi-bold font.
	//   - 7 (BoldFont) or "bold" - Bold font.
	//   - 8 (ExtraBoldFont) or "extra-bold" - Extra bold font.
	//   - 9 (BlackFont) or "black" - Black font.
	TextWeight PropertyName = "text-weight"

	// TextAlign is the constant for "text-align" property tag.
	//
	// Used by TableView, View.
	//
	// Usage in TableView:
	// Sets the horizontal alignment of the content inside a table cell.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (JustifyAlign) or "justify" - Justify alignment.
	//
	// Usage in View:
	// Alignment of the text in view. This is an inherited property, i.e. if it is not defined, then the value of the parent
	// view is used.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (JustifyAlign) or "justify" - Justify alignment.
	TextAlign PropertyName = "text-align"

	// TextIndent is the constant for "text-indent" property tag.
	//
	// Used by View.
	// Determines the size of the indent(empty space) before the first line of text. This is an inherited property, i.e. if it
	// is not defined, then the value of the parent view is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	TextIndent PropertyName = "text-indent"

	// TextShadow is the constant for "text-shadow" property tag.
	//
	// Used by View.
	// Specify shadow for the text.
	//
	// Supported types: ShadowProperty, []ShadowProperty, string.
	//
	// Internal type is []ShadowProperty, other types converted to it during assignment.
	// See ShadowProperty description for more details.
	//
	// Conversion rules:
	//   - []ShadowProperty - stored as is. no conversion performed.
	//   - ShadowProperty - converted to []ShadowProperty during assignment.
	//   - string - must contain a string representation of ShadowProperty
	TextShadow PropertyName = "text-shadow"

	// TextWrap is the constant for "text-wrap" property tag.
	//
	// Used by View.
	// Controls how text inside the view is wrapped. Default value is "wrap".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TextWrapOn) or "wrap" - Text is wrapped across lines at appropriate characters (for example spaces, in languages like English that use space separators) to minimize overflow.
	//   - 1 (TextWrapOff) or "nowrap" - Text does not wrap across lines. It will overflow its containing element rather than breaking onto a new line.
	//   - 2 (TextWrapBalance) or "balance" - Text is wrapped in a way that best balances the number of characters on each line, enhancing layout quality and legibility. Because counting characters and balancing them across multiple lines is computationally expensive, this value is only supported for blocks of text spanning a limited number of lines (six or less for Chromium and ten or less for Firefox).
	TextWrap PropertyName = "text-wrap"

	// TabSize is the constant for "tab-size" property tag.
	//
	// Used by View.
	// Set the width of tab characters (U+0009) in spaces. This is an inherited property, i.e. if it is not defined, then the
	// value of the parent view is used. Default value is 8.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - greater than 0 - Number of spaces in tab character.
	//   - 0 or negative - ignored.
	TabSize PropertyName = "tab-size"

	// LetterSpacing is the constant for "letter-spacing" property tag.
	//
	// Used by View.
	// Set the horizontal spacing behavior between text characters. This value is added to the natural spacing between
	// characters while rendering the text. Positive values of letter-spacing causes characters to spread farther apart, while
	// negative values of letter-spacing bring characters closer together. This is an inherited property, i.e. if it is not
	// defined, then the value of the parent view is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	LetterSpacing PropertyName = "letter-spacing"

	// WordSpacing is the constant for "word-spacing" property tag.
	//
	// Used by View.
	// Set the length of space between words and between tags. This is an inherited property, i.e. if it is not defined, then
	// the value of the parent view is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	WordSpacing PropertyName = "word-spacing"

	// LineHeight is the constant for "line-height" property tag.
	//
	// Used by View.
	// Set the height of a line box. It's commonly used to set the distance between lines of text. This is an inherited
	// property, i.e. if it is not defined, then the value of the parent view is used.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	LineHeight PropertyName = "line-height"

	// WhiteSpace is the constant for "white-space" property tag.
	//
	// Used by View.
	// Sets how white space inside an element is handled. This is an inherited property, i.e. if it is not defined, then the
	// value of the parent view is used.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (WhiteSpaceNormal) or "normal" - Sequences of spaces are concatenated into one space.
	//    Newlines in the source are treated as a single space. Applying this value optionally splits lines to fill inline boxes.
	//   - 1 (WhiteSpaceNowrap) or "nowrap" - Concatenates sequences of spaces into one space, like a normal value, but does not wrap lines(text wrapping) within the text.
	//   - 2 (WhiteSpacePre) or "pre" - Sequences of spaces are saved as they are specified in the source.
	//    Lines are wrapped only where newlines are specified in the source and where "br" elements are specified in the source.
	//   - 3 (WhiteSpacePreWrap) or "pre-wrap" - Sequences of spaces are saved as they are indicated in the source.
	//    Lines are wrapped only where newlines are specified in the source and there, where "br" elements are specified in the source, and optionally to fill inline boxes.
	//   - 4 (WhiteSpacePreLine) or "pre-line" - Sequences of spaces are concatenated into one space. Lines are split on newlines, on "br" elements, and optionally to fill inline boxes.
	//   - 5 (WhiteSpaceBreakSpaces) or "break-spaces" - The behavior is identical to WhiteSpacePreWrap with the some differences.
	//
	// Differences WhiteSpaceBreakSpaces (5) from WhiteSpacePreWrap(3):
	//  1. Sequences of spaces are preserved as specified in the source, including spaces at the end of lines.
	//  2. Lines are wrapped on any spaces, including in the middle of a sequence of spaces.
	//  3. Spaces take up space and do not hang at the ends of lines, which means they affect the internal dimensions (min-content and max-content).
	WhiteSpace PropertyName = "white-space"

	// WordBreak is the constant for "word-break" property tag.
	//
	// Used by View.
	// Set whether line breaks appear wherever the text would otherwise overflow its content box. This is an inherited
	// property, i.e. if it is not defined, then the value of the parent view is used. Default value is "normal".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (WordBreakNormal) or "normal" - Default behavior for linefeed placement.
	//   - 1 (WordBreakAll) or "break-all" - If the block boundaries are exceeded, a line break will be inserted between any two characters(except for Chinese/Japanese/Korean text).
	//   - 2 (WordBreakKeepAll) or "keep-all" - Line break will not be used in Chinese/Japanese/ Korean text. For text in other languages, the default behavior(normal) will be applied.
	//   - 3 (WordBreakWord) or "break-word" - When the block boundaries are exceeded, the remaining whole words can be broken in an arbitrary place, if a more suitable place for line break is not found.
	WordBreak PropertyName = "word-break"

	// TextTransform is the constant for "text-transform" property tag.
	//
	// Used by View.
	// Specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or
	// with each word capitalized. This is an inherited property, i.e. if it is not defined, then the value of the parent view
	// is used.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneTextTransform) or "none" - Original case of characters.
	//   - 1 (CapitalizeTextTransform) or "capitalize" - Every word starts with a capital letter.
	//   - 2 (LowerCaseTextTransform) or "lowercase" - All characters are lowercase.
	//   - 3 (UpperCaseTextTransform) or "uppercase" - All characters are uppercase.
	TextTransform PropertyName = "text-transform"

	// TextDirection is the constant for "text-direction" property tag.
	//
	// Used by View.
	// Sets the direction of text, table columns, and horizontal overflow. This is an inherited property, i.e. if it is not
	// defined, then the value of the parent view is used. Default value is "system".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (SystemTextDirection) or "system" - Use the system text direction.
	//   - 1 (LeftToRightDirection) or "left-to-right" - For languages written from left to right (like English and most other languages).
	//   - 2 (RightToLeftDirection) or "right-to-left" - For languages written from right to left (like Hebrew or Arabic).
	TextDirection PropertyName = "text-direction"

	// WritingMode is the constant for "writing-mode" property tag.
	//
	// Used by View.
	// Set whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used. Default value is
	// "horizontal-top-to-bottom".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (HorizontalTopToBottom) or "horizontal-top-to-bottom" - Horizontal lines are displayed from top to bottom.
	//   - 1 (HorizontalBottomToTop) or "horizontal-bottom-to-top" - Horizontal lines are displayed from bottom to top.
	//   - 2 (VerticalRightToLeft) or "vertical-right-to-left" - Vertical lines are output from right to left.
	//   - 3 (VerticalLeftToRight) or "vertical-left-to-right" - Vertical lines are output from left to right.
	WritingMode PropertyName = "writing-mode"

	// VerticalTextOrientation is the constant for "vertical-text-orientation" property tag.
	//
	// Used by View.
	// Set the orientation of the text characters in a line. It only affects text in vertical mode ("writing-mode" property).
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (MixedTextOrientation) or "mixed" - Symbols rotated 90° clockwise.
	//   - 1 (UprightTextOrientation) or "upright" - Symbols are arranged normally(vertically).
	VerticalTextOrientation PropertyName = "vertical-text-orientation"

	// TextOverflow is the constant for "text-overflow" property tag.
	//
	// Used by TextView.
	// Sets how hidden overflow content is signaled to users. Default value is "clip".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TextOverflowClip) or "clip" - Text is clipped at the border.
	//   - 1 (TextOverflowEllipsis) or "ellipsis" - At the end of the visible part of the text "…" is displayed.
	TextOverflow PropertyName = "text-overflow"

	// Hint is the constant for "hint" property tag.
	//
	// Used by EditView.
	// Sets a hint to the user of what can be entered in the control.
	//
	// Supported types: string.
	Hint PropertyName = "hint"

	// MaxLength is the constant for "max-length" property tag.
	//
	// Used by EditView.
	// Sets the maximum number of characters that the user can enter.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - positive value - Maximum number of characters.
	//   - 0 or negative value - The maximum number of characters is not limited.
	MaxLength PropertyName = "max-length"

	// ReadOnly is the constant for "readonly" property tag.
	//
	// Used by EditView.
	// Controls whether the user can modify value or not. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - User not able to modify the value.
	//   - false, 0, "false", "no", "off", or "0" - Value can be modified.
	ReadOnly PropertyName = "readonly"

	// Content is the constant for "content" property tag.
	//
	// Used by ViewsContainer, GridLayout, ListLayout, Resizable, StackLayout, SvgImageView, TableView.
	//
	// # Usage in ViewsContainer:
	//
	// An array of child views.
	//
	// Supported types: View, []View, string, []string, []any containing elements of View, string.
	//
	// Internal type is []View, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - View - converted to []View containing one element.
	//   - []View - nil-elements are prohibited, if the array contains nil, then the property will not be set, and the Set function will return false and an error message will be written to the log.
	//   - string - if the string is a text representation of the View, then the corresponding view is created, otherwise a TextView is created, to which the given string is passed as a text. Then a []View is created containing the resulting view.
	//   - []string - each element of an array is converted to View as described above.
	//   - []any - this array must contain only View and a string. Each string element is converted to a view as described above. If array contains invalid values, the "content" property will not be set, and the Set function will return false and an error message will be written to the log.
	//
	// # Usage in GridLayout:
	//
	// Defines an array of child views or can be an implementation of GridAdapter interface.
	//
	// Supported types: []View, GridAdapter, View, string, []string.
	//
	// Internal type is either []View or GridAdapter, other types converted to []View during assignment.
	//
	// Conversion rules:
	//   - View - view which describe one cell, converted to []View.
	//   - []View - describe several cells, stored as is.
	//   - string - text representation of the view which describe one cell, converted to []View.
	//   - []string - an array of text representation of the views which describe several cells, converted to []View.
	//   - GridAdapter - interface which describe several cells, see GridAdapter description for more details.
	//
	// # Usage in ListLayout:
	//
	// Defines an array of child views or can be an implementation of ListAdapter interface.
	//
	// Supported types: []View, ListAdapter, View, string, []string.
	//
	// Internal type is either []View or ListAdapter, other types converted to []View during assignment.
	//
	// Conversion rules:
	//   - View - view which describe one item, converted to []View.
	//   - []View - describe several items, stored as is.
	//   - string - text representation of the view which describe one item, converted to []View.
	//   - []string - an array of text representation of the views which describe several items, converted to []View.
	//   - ListAdapter - interface which describe several items, see ListAdapter description for more details.
	//
	// # Usage in Resizable:
	//
	// Content view to make it resizable or text in this case TextView will be created.
	//
	// Supported types: View, string.
	//
	// Internal type is View, other types converted to it during assignment.
	//
	// Usage in StackLayout:
	// An array of child views.
	//
	// Supported types: View, []View, string, []string, []any containing elements of View, string.
	//
	// Internal type is []View, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - View - converted to []View containing one element.
	//   - []View - nil-elements are prohibited, if the array contains nil, then the property will not be set, and the Set function will return false and an error message will be written to the log.
	//   - string - if the string is a text representation of the View, then the corresponding view is created, otherwise a TextView is created, to which the given string is passed as a text. Then a []View is created containing the resulting view.
	//   - []string - each element of an array is converted to View as described above.
	//   - []any - this array must contain only View and a string. Each string element is converted to a view as described above. If array contains invalid values, the "content" property will not be set, and the Set function will return false and an error message will be written to the log.
	//
	// # Usage in SvgImageView:
	//
	// Image to display. Could be the image file name in the images folder of the resources, image URL or content of the svg image.
	//
	// Supported types: string.
	//
	// # Usage in TableView:
	//
	// Defines the content of the table.
	//
	// Supported types: TableAdapter, [][]string, [][]any.
	//
	// Internal type is TableAdapter, other types converted to it during assignment.
	// See TableAdapter description for more details.
	Content PropertyName = "content"

	// Items is the constant for "items" property tag.
	//
	// Used by DropDownList, ListView, Popup.
	//
	// # Usage in DropDownList:
	//
	// Array of data elements.
	//
	// Supported types: []string, string, []fmt.Stringer, []Color, []SizeUnit, []AngleUnit, []any containing
	// elements of string, fmt.Stringer, bool, rune, float32, float64, int, int8…int64, uint, uint8…uint64.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - contain single item.
	//   - []string - an array of items.
	//   - []fmt.Stringer - an array of objects convertible to string.
	//   - []Color - An array of color values which will be converted to a string array.
	//   - []SizeUnit - an array of size unit values which will be converted to a string array.
	//   - []any - this array must contain only types which were listed in Types section.
	//
	// # Usage in ListView:
	//
	// List content. Main value is an implementation of ListAdapter interface.
	//
	// Supported types: ListAdapter, []View, []string, []any containing elements of View, string, fmt.Stringer, float and int.
	//
	// Internal type is either []View or ListAdapter, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - ListAdapter - interface which provides an access to list items and other information, stored as is.
	//   - []View - an array of list items, each in a form of some view-based element. Stored as is.
	//   - []string - an array of text. Converted into an internal implementation of ListAdapter, each list item will be an instance of TextView.
	//   - []any - an array of items of arbitrary type, where types like string, fmt.Stringer, float and int will be converted to TextView. View type will remain unchanged. All values after conversion will be wrapped by internal implementation of ListAdapter.
	//
	// # Usage in Popup:
	//
	// Array of menu items.
	//
	// Supported types: ListAdapter, []string.
	//
	// Internal type is ListAdapter internal implementation, other types converted to it during assignment.
	Items PropertyName = "items"

	// DisabledItems is the constant for "disabled-items" property tag.
	//
	// Used by DropDownList.
	// An array of disabled(non selectable) items indices.
	//
	// Supported types: []int, string, []string, []any containing  elements of string or int.
	//
	// Internal type is []int, other types converted to it during assignment.
	// Rules of conversion.
	//   - []int - Array of indices.
	//   - string - Single index value or multiple index values separated by comma(,).
	//   - []string - Array of indices in text format.
	//   - []any - Array of strings or integer values.
	DisabledItems PropertyName = "disabled-items"

	// ItemSeparators is the constant for "item-separators" property tag.
	//
	// Used by DropDownList.
	// An array of indices of DropDownList items after which a separator should be added.
	//
	// Supported types: []int, string, []string, []any containing  elements of string or int.
	//
	// Internal type is []int, other types converted to it during assignment.
	// Rules of conversion.
	//   - []int - Array of indices.
	//   - string - Single index value or multiple index values separated by comma(,).
	//   - []string - Array of indices in text format.
	//   - []any - Array of strings or integer values.
	ItemSeparators PropertyName = "item-separators"

	// Current is the constant for "current" property tag.
	//
	// Used by DropDownList, ListView, TableView, TabsLayout.
	//
	// # Usage in DropDownList:
	//
	// Current selected item.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - No item has been selected.
	//   - not negative value - Index of selected item.
	//
	// # Usage in ListView:
	//
	// Set or get index of selected item.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - No item has been selected.
	//   - not negative value - Index of selected item.
	//
	// # Usage in TableView:
	//
	// Sets the coordinates of the selected cell/row.
	//
	// Supported types: CellIndex, int, string.
	//
	// Internal type is CellIndex, other types converted to it during assignment.
	// See CellIndex description for more details.
	//
	// Conversion rules:
	//   - int - specify index of current table row, current column index will be set to -1.
	//   - string - can be one integer value which specify current row or pair of integer values separated by comma(,). When two values provided then first value specify current row index and second one specify column index.
	//
	// # Usage in TabsLayout:
	//
	// Defines index of the current active child view.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - No visible tab.
	//   - not negative value - Index of visible tab.
	Current PropertyName = "current"

	// Type is the constant for "type" property tag.
	//
	// Used by EditView, NumberPicker.
	//
	// Usage in EditView:
	// Same as "edit-view-type" [EditViewType].
	//
	// Usage in NumberPicker:
	// Same as "number-picker-type" [NumberPickerType].
	Type PropertyName = "type"

	// Pattern is the constant for "pattern" property tag.
	//
	// Used by EditView.
	// Same as "edit-view-pattern" [EditViewPattern].
	Pattern PropertyName = "pattern"

	// GridAutoFlow is the constant for "grid-auto-flow" property tag.
	//
	// Used by GridLayout.
	// Controls how to place child controls if Row and Column properties were not set for children views.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (RowAutoFlow) or "row" - Views are placed by filling each row in turn, adding new rows as necessary.
	//   - 1 (ColumnAutoFlow) or "column" - Views are placed by filling each column in turn, adding new columns as necessary.
	//   - 2 (RowDenseAutoFlow) or "row-dense" - Views are placed by filling each row, adding new rows as necessary. "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.
	//   - 3 (ColumnDenseAutoFlow) or "column-dense" - Views are placed by filling each column, adding new columns as necessary. "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause views to appear out-of-order, when doing so would fill in holes left by larger views.
	GridAutoFlow PropertyName = "grid-auto-flow"

	// CellWidth is the constant for "cell-width" property tag.
	//
	// Used by GridLayout:
	// Set a fixed width of GridLayout cells regardless of the size of the child elements. Each element in the array
	// determines the size of the corresponding column. By default, the sizes of the cells are calculated based on the sizes
	// of the child views placed in them.
	//
	// Supported types: SizeUnit, []SizeUnit, SizeFunc, string, []string, []any containing elements of string or
	// SizeUnit.
	//
	// Internal type is either SizeUnit or []SizeUnit, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - SizeUnit, SizeFunc - stored as is and all cells are set to have the same width.
	//   - []SizeUnit - stored as is and each column of the grid layout has width which is specified in an array.
	//   - string - containing textual representations of SizeUnit (or SizeUnit constants), may contain several values separated by comma(,). Each column of the grid layout has width which is specified in an array.
	//   - []string - each element must be a textual representation of a SizeUnit (or a SizeUnit constant). Each column of the grid layout has width which is specified in an array.
	// If the number of elements in an array is less than the number of columns used, then the missing elements are set to have Auto size.
	//
	// The values can use SizeUnit type SizeInFraction. This type means 1 part. The part is calculated as follows: the size of all cells that are not of type SizeInFraction is subtracted from the size of the container, and then the remaining size is divided by the number of parts. The SizeUnit value of type SizeInFraction can be either integer or fractional.
	CellWidth PropertyName = "cell-width"

	// CellHeight is the constant for "cell-height" property tag.
	//
	// Used by GridLayout:
	// Set a fixed height of GridLayout cells regardless of the size of the child elements. Each element in the array
	// determines the size of the corresponding row. By default, the sizes of the cells are calculated based on the sizes of
	// the child views placed in them.
	//
	// Supported types: SizeUnit, []SizeUnit, SizeFunc, string, []string, []any containing elements of string or
	// SizeUnit.
	//
	// Internal type is either SizeUnit or []SizeUnit, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - SizeUnit, SizeFunc - stored as is and all cells are set to have the same height.
	//   - []SizeUnit - stored as is and each row of the grid layout has height which is specified in an array.
	//   - string - containing textual representations of SizeUnit (or SizeUnit constants), may contain several values separated by comma(,). Each row of the grid layout has height which is specified in an array.
	//   - []string - each element must be a textual representation of a SizeUnit (or a SizeUnit constant). Each row of the grid layout has height which is specified in an array.
	// If the number of elements in an array is less than the number of rows used, then the missing elements are set to have Auto size.
	//
	// The values can use SizeUnit type SizeInFraction. This type means 1 part. The part is calculated as follows: the size of all cells that are not of type SizeInFraction is subtracted from the size of the container, and then the remaining size is divided by the number of parts. The SizeUnit value of type SizeInFraction can be either integer or fractional.
	CellHeight PropertyName = "cell-height"

	// GridRowGap is the constant for "grid-row-gap" property tag.
	//
	// Used by GridLayout.
	// Space between rows.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	GridRowGap PropertyName = "grid-row-gap"

	// GridColumnGap is the constant for "grid-column-gap" property tag.
	//
	// Used by GridLayout.
	// Space between columns.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	GridColumnGap PropertyName = "grid-column-gap"

	// Source is the constant for "src" property tag.
	//
	// Used by AudioPlayer, ImageView, VideoPlayer.
	//
	// # Usage in AudioPlayer
	//
	// Specifies the location of the media file(s). Since different browsers support different file formats and codecs, it is
	// recommended to specify multiple sources in different formats. The player chooses the most suitable one from the list of
	// sources. Setting mime types makes this process easier for the browser.
	//
	// Supported types: string, MediaSource, []MediaSource.
	//
	// Internal type is []MediaSource, other types converted to it during assignment.
	//
	// # Usage in ImageView
	//
	// Set either the name of the image in the "images" folder of the resources, or the URL of the image or inline-image. An
	// inline-image is the content of an image file encoded in base64 format.
	//
	// Supported types: string.
	//
	// # Usage in VideoPlayer
	//
	// Specifies the location of the media file(s). Since different browsers support different file formats and codecs, it is
	// recommended to specify multiple sources in different formats. The player chooses the most suitable one from the list of
	// sources. Setting mime types makes this process easier for the browser.
	//
	// Supported types: string, MediaSource, []MediaSource.
	//
	// Internal type is []MediaSource, other types converted to it during assignment.
	Source PropertyName = "src"

	// SrcSet is the constant for "srcset" property tag.
	//
	// Used by ImageView.
	// String which identifies one or more image candidate strings, separated using comma(,) each specifying image resources
	// to use under given screen density. This property is only used if building an application for js/wasm platform.
	//
	// Supported types: string.
	SrcSet PropertyName = "srcset"

	// Fit is the constant for "fit" property tag.
	//
	// Used by ImageView, BackgroundElement.
	//
	// # Usage in ImageView
	//
	// Defines the image scaling parameters.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneFit) or "none" - The image is not resized.
	//   - 1 (ContainFit) or "contain" - The image is scaled to maintain its aspect ratio while fitting within the element’s content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
	//   - 2 (CoverFit) or "cover" - The image is sized to maintain its aspect ratio while filling the element’s entire content box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
	//   - 3 (FillFit) or "fill" - The image to fill the element’s content box. The entire object will completely fill the box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit.
	//   - 4 (ScaleDownFit) or "scale-down" - The image is sized as if NoneFit or ContainFit were specified, whichever would result in a smaller concrete object size.
	//
	// # Usage in BackgroundElement
	//
	// Used for image background only. Defines the image scaling parameters.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneFit) or "none" - The image is not resized.
	//   - 1 (ContainFit) or "contain" - The image is scaled to maintain its aspect ratio while fitting within the element’s content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
	//   - 2 (CoverFit) or "cover" - The image is sized to maintain its aspect ratio while filling the element’s entire content box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
	Fit PropertyName = "fit"

	// Repeat is the constant for "repeat" property tag.
	//
	// Used by BackgroundElement.
	// Used for image background only. Specifying the repetition of the image. Default value is "no-repeat".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoRepeat) or "no-repeat" - Image does not repeat.
	//   - 1 (RepeatXY) or "repeat" - Image repeat horizontally and vertically.
	//   - 2 (RepeatX) or "repeat-x" - Image repeat only horizontally.
	//   - 3 (RepeatY) or "repeat-y" - Image repeat only vertically.
	//   - 4 (RepeatRound) or "round" - Image is repeated so that an integer number of images fit into the background area. If this fails, then the background images are scaled.
	//   - 5 (RepeatSpace) or "space" - Image is repeated as many times as necessary to fill the background area. If this fails, an empty space is added between the pictures.
	Repeat PropertyName = "repeat"

	// Attachment is the constant for "attachment" property tag.
	//
	// Used by BackgroundElement.
	// Used for image background only. Sets whether a background image's position is fixed within the viewport or scrolls with
	// its containing block.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (ScrollAttachment) or "scroll" - The background image will scroll with the page.
	//   - 1 (FixedAttachment) or "fixed" - The background image will not scroll with the page.
	//   - 2 (LocalAttachment) or "local" - The background image will scroll with the element's contents.
	Attachment PropertyName = "attachment"

	// BackgroundClip is the constant for "background-clip" property tag.
	//
	// Used by View.
	// Determines how the background color and/or background image will be displayed below the box borders.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BorderBoxClip) or "border-box" - The background extends to the outer edge of the border(but below the border in z-order).
	//   - 1 (PaddingBoxClip) or "padding-box" - The background extends to the outer edge of the padding. No background is drawn below the border.
	//   - 2 (ContentBoxClip) or "content-box" - The background is painted inside(clipped) of the content box.
	BackgroundClip PropertyName = "background-clip"

	// BackgroundOrigin is the constant for "background-origin" property tag.
	//
	// Used by View.
	// Determines the background's origin: from the border start, inside the border, or inside the padding.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BorderBox) or "border-box" - The background is positioned relative to the border box.
	//   - 1 (PaddingBox) or "padding-box" - The background is positioned relative to the padding box.
	//   - 2 (ContentBox) or "content-box" - The background is positioned relative to the content box.
	BackgroundOrigin PropertyName = "background-origin"

	// MaskClip is the constant for "mask-clip" property tag.
	//
	// Used by View.
	// Determines how image/gradient masks will be used below the box borders.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BorderBox) or "border-box" - The mask extends to the outer edge of the border.
	//   - 1 (PaddingBox) or "padding-box" - The mask extends to the outer edge of the padding.
	//   - 2 (ContentBox) or "content-box" - The mask is used inside(clipped) of the content box.
	MaskClip PropertyName = "mask-clip"

	// MaskOrigin is the constant for "mask-origin" property tag.
	//
	// Used by View.
	// Determines the mask's origin: from the border start, inside the border, or inside the padding.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BorderBox) or "border-box" - The mask is positioned relative to the border box.
	//   - 1 (PaddingBox) or "padding-box" - The mask is positioned relative to the padding box.
	//   - 2 (ContentBox) or "content-box" - The mask is positioned relative to the content box.
	MaskOrigin PropertyName = "mask-origin"

	// Gradient is the constant for "gradient" property tag.
	//
	// Used by BackgroundElement.
	// Describe gradient stop points. This is a mandatory property while describing background gradients.
	//
	// Supported types: []BackgroundGradientPoint, []BackgroundGradientAngle, []GradientPoint, []Color, string.
	//
	// Internal type is []BackgroundGradientPoint or []BackgroundGradientAngle, other types converted to it during assignment.
	// See BackgroundGradientPoint, []BackgroundGradientAngle, []GradientPoint description for more details.
	//
	// Conversion rules:
	//   - []BackgroundGradientPoint - stored as is, no conversion performed. Used to set gradient stop points for linear and radial gradients.
	//   - []BackgroundGradientAngle - stored as is, no conversion performed. Used to set gradient stop points for conic gradient.
	//   - []GradientPoint - converted to []BackgroundGradientPoint. Used to set gradient stop points for linear and radial gradients. Since GradientPoint contains values from 0 to 1.0 they will be converted to precent values.
	//   - []Color - converted to []BackgroundGradientPoint. Used for setting gradient stop points which are uniformly distributed across gradient diretion.
	//   - string - string representation of stop points or color values. Format: "color1 pos1,color2 pos2"... . Position of stop points can be described either in SizeUnit or AngleUnit string representations. Examples: "white 0deg, black 90deg, gray 360deg", "white 0%, black 100%".
	Gradient PropertyName = "gradient"

	// Direction is the constant for "direction" property tag.
	//
	// Used by BackgroundElement.
	// Used for linear gradient only. Defines the direction of the gradient line. Default is 4 (ToBottomGradient) or
	// "to-bottom".
	//
	// Supported types: AngleUnit, int, string.
	//
	// See AngleUnit description for more details.
	//
	// Values:
	//   - 0 (ToTopGradient) or "to-top" - Line goes from bottom to top.
	//   - 1 (ToRightTopGradient) or "to-right-top" - From bottom left to top right.
	//   - 2 (ToRightGradient) or "to-right" - From left to right.
	//   - 3 (ToRightBottomGradient) or "to-right-bottom" - From top left to bottom right.
	//   - 4 (ToBottomGradient) or "to-bottom" - From top to bottom.
	//   - 5 (ToLeftBottomGradient) or "to-left-bottom" - From the upper right corner to the lower left.
	//   - 6 (ToLeftGradient) or "to-left" - From right to left.
	//   - 7 (ToLeftTopGradient) or "to-left-top" - From the bottom right corner to the top left.
	Direction PropertyName = "direction"

	// Repeating is the constant for "repeating" property tag.
	//
	// Used by BackgroundElement.
	// Define whether stop points needs to be repeated after the last one.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Gradient will repeat after the last key point.
	//   - false, 0, "false", "no", "off", or "0" - No repetition of gradient stop points. Value of the last point used will be extrapolated.
	Repeating PropertyName = "repeating"

	// From is the constant for "from" property tag.
	//
	// Used by BackgroundElement.
	// Used for conic gradient only. Start angle position of the gradient.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types converted to it during assignment.
	// See AngleUnit description for more details.
	From PropertyName = "from"

	// RadialGradientRadius is the constant for "radial-gradient-radius" property tag.
	//
	// Used by BackgroundElement.
	// Define radius of the radial gradient.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	RadialGradientRadius PropertyName = "radial-gradient-radius"

	// RadialGradientShape is the constant for "radial-gradient-shape" property tag.
	//
	// Used by BackgroundElement.
	// Define shape of the radial gradient. The default is 0 (EllipseGradient or "ellipse".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - EllipseGradient (0) or "ellipse" - The shape is an axis-aligned ellipse.
	//   - CircleGradient (1) or "circle" - The shape is a circle with a constant radius.
	RadialGradientShape PropertyName = "radial-gradient-shape"

	// Shape is the constant for "shape" property tag.
	//
	// Used by BackgroundElement.
	// Same as "radial-gradient-shape".
	Shape PropertyName = "shape"

	// CenterX is the constant for "center-x" property tag.
	//
	// Used by BackgroundElement.
	// Used for conic and radial gradients only. Center X point of the gradient.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	CenterX PropertyName = "center-x"

	// CenterY is the constant for "center-y" property tag.
	//
	// Used by BackgroundElement.
	// Used for conic and radial gradients only. Center Y point of the gradient.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	CenterY PropertyName = "center-y"

	// AltText is the constant for "alt-text" property tag.
	//
	// Used by ImageView.
	// Set a description of the image.
	//
	// Supported types: string.
	AltText PropertyName = "alt-text"

	// AvoidBreak is the constant for "avoid-break" property tag.
	//
	// Used by ColumnLayout.
	// Controls how region breaks should behave inside a generated box.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Avoid any break from being inserted within the principal box.
	//   - false, 0, "false", "no", "off", or "0" - Allow, but does not force, any break to be inserted within the principal box.
	AvoidBreak PropertyName = "avoid-break"

	// ItemWidth is the constant for "item-width" property tag.
	//
	// Used by ListView.
	// Fixed width of list elements.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ItemWidth PropertyName = "item-width"

	// ItemHeight is the constant for "item-height" property tag.
	//
	// Used by ListView.
	// Fixed height of list elements.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ItemHeight PropertyName = "item-height"

	// ListWrap is the constant for "list-wrap" property tag.
	//
	// Used by ListLayout, ListView.
	//
	// Usage in ListLayout:
	// Defines the position of elements in case of reaching the border of the container.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (ListWrapOff) or "off" - The column or row of elements continues and goes beyond the bounds of the visible area.
	//   - 1 (ListWrapOn) or "on" - Starts a new column or row of elements as necessary. The new column is positioned towards the end.
	//   - 2 (ListWrapReverse) or "reverse" - Starts a new column or row of elements as necessary. The new column is positioned towards the beginning.
	//
	// Usage in ListView:
	// Defines the position of elements in case of reaching the border of the container.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (ListWrapOff) or "off" - The column or row of elements continues and goes beyond the bounds of the visible area.
	//   - 1 (ListWrapOn) or "on" - Starts a new column or row of elements as necessary. The new column is positioned towards the end.
	//   - 2 (ListWrapReverse) or "reverse" - Starts a new column or row of elements as necessary. The new column is positioned towards the beginning.
	ListWrap PropertyName = "list-wrap"

	// EditWrap is the constant for "edit-wrap" property tag.
	//
	// Used by EditView.
	// Controls whether the text will wrap around when edit view border has been reached. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Text wrapped to the next line.
	//   - false, 0, "false", "no", "off", or "0" - Do not wrap text. Horizontal scrolling will appear if necessary.
	EditWrap PropertyName = "edit-wrap"

	// CaretColor is the constant for "caret-color" property tag.
	//
	// Used by EditView.
	//
	// Sets the color of the insertion caret, the visible marker where the next character typed will be inserted. This is
	// sometimes referred to as the text input cursor.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See [Color] description for more details.
	CaretColor PropertyName = "caret-color"

	// Min is the constant for "min" property tag.
	//
	// Used by DatePicker, NumberPicker, TimePicker.
	//
	// Usage in DatePicker:
	// Same as "date-picker-min" [DatePickerMin].
	//
	// Usage in NumberPicker:
	// Same as "number-picker-min" [NumberPickerMin].
	//
	// Usage in TimePicker:
	// Same as "time-picker-min" [TimePickerMin].
	Min PropertyName = "min"

	// Max is the constant for "max" property tag.
	//
	// Used by DatePicker, NumberPicker, ProgressBar, TimePicker.
	//
	// Usage in DatePicker:
	// Same as "date-picker-max" [DatePickerMax].
	//
	// Usage in NumberPicker:
	// Same as "number-picker-max" [NumberPickerMax].
	//
	// Usage in ProgressBar:
	// Same as "progress-max" [ProgressBarMax].
	//
	// Usage in TimePicker:
	// Same as "time-picker-max" [TimePickerMax].
	Max PropertyName = "max"

	// Step is the constant for "step" property tag.
	//
	// Used by DatePicker, NumberPicker, TimePicker.
	//
	// Usage in DatePicker:
	// Same as "date-picker-step" [DatePickerStep].
	//
	// Usage in NumberPicker:
	// Same as "number-picker-step" [NumberPickerStep].
	//
	// Usage in TimePicker:
	// Same as "time-picker-step" [TimePickerStep].
	Step PropertyName = "step"

	// Value is the constant for "value" property tag.
	//
	// Used by DatePicker, NumberPicker, ProgressBar, TimePicker.
	//
	// Usage in DatePicker:
	// Same as "date-picker-value" [DatePickerValue].
	//
	// Usage in NumberPicker:
	// Same as "number-picker-value" [NumberPickerValue].
	//
	// Usage in ProgressBar:
	// Same as "progress-value" [ProgressBarValue].
	//
	// Usage in TimePicker:
	// Same as "time-picker-value" [TimePickerValue].
	Value PropertyName = "value"

	// Orientation is the constant for "orientation" property tag.
	//
	// Used by ListLayout, ListView.
	//
	// Specifies how the children will be positioned relative to each other.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopDownOrientation) or "up-down" - Child elements are arranged in a column from top to bottom.
	//   - 1 (StartToEndOrientation) or "start-to-end" - Child elements are laid out in a row from beginning to end.
	//   - 2 (BottomUpOrientation) or "bottom-up" - Child elements are arranged in a column from bottom to top.
	//   - 3 (EndToStartOrientation) or "end-to-start" - Child elements are laid out in a line from end to beginning.
	Orientation PropertyName = "orientation"

	// Gap is the constant for "gap" property tag.
	//
	// Used by GridLayout, ListLayout, ListView, TableView.
	//
	// # Usage in GridLayout
	//
	// Specify both "grid-column-gap" and "grid-row-gap".
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in ListLayout and ListView
	//
	// Specify both "list-column-gap" and "list-row-gap".
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	//
	// # Usage in TableView
	//
	// Define the gap between rows and columns of a table.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	Gap PropertyName = "gap"

	// ListRowGap is the constant for "list-row-gap" property tag.
	//
	// Used by ListLayout, ListView.
	//
	// Set the distance between the rows of the ListLayout. Default value 0px.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ListRowGap PropertyName = "list-row-gap"

	// ListColumnGap is the constant for "list-column-gap" property tag.
	//
	// Used by ListLayout, ListView.
	//
	// Set the distance between the columns of the ListLayout. Default value 0px.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See [SizeUnit] description for more details.
	ListColumnGap PropertyName = "list-column-gap"

	// Text is the constant for "text" property tag.
	//
	// Used by EditView, TextView.
	//
	// Usage in EditView:
	// Edit view text.
	//
	// Supported types: string.
	//
	// Usage in TextView:
	// Text to display.
	//
	// Supported types: string.
	Text PropertyName = "text"

	// VerticalAlign is the constant for "vertical-align" property tag.
	//
	// Used by Checkbox, ListLayout, ListView, Popup, SvgImageView.
	//
	// # Usage in Checkbox
	//
	// Sets the vertical alignment of the content inside a block element.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Content aligned to top side of the content area.
	//   - 1 (BottomAlign) or "bottom" - Content aligned to bottom side of the content area.
	//   - 2 (CenterAlign) or "center" - Content aligned in the center of the content area.
	//   - 3 (StretchAlign) or "stretch" - Content relaxed to fill all content area.
	//
	// # Usage in ListLayout and ListView
	//
	// Sets the vertical alignment of the content inside a block element.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Height alignment.
	//
	// # Usage in Popup
	//
	// Vertical alignment of the popup on the screen.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Height alignment.
	//
	// # Usage in SvgImageView
	//
	// Sets the vertical alignment of the image relative to its bounds.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	VerticalAlign PropertyName = "vertical-align"

	// HorizontalAlign is the constant for "horizontal-align" property tag.
	//
	// Used by Checkbox, ListLayout, ListView, Popup, SvgImageView.
	//
	// # Usage in Checkbox
	//
	// Sets the horizontal alignment of the content inside a block element.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Content aligned to left side of the content area.
	//   - 1 (RightAlign) or "right" - Content aligned to right side of the content area.
	//   - 2 (CenterAlign) or "center" - Content aligned in the center of the content area.
	//   - 3 (StretchAlign) or "stretch" - Content relaxed to fill all content area.
	//
	// # Usage in ListLayout and ListView
	//
	// Sets the horizontal alignment of the content inside a block element.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Width alignment.
	//
	// # Usage in Popup
	//
	// Horizontal alignment of the popup on the screen.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Width alignment.
	//
	// # Usage in SvgImageView
	//
	// Sets the horizontal alignment of the image relative to its bounds.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	HorizontalAlign PropertyName = "horizontal-align"

	// ImageVerticalAlign is the constant for "image-vertical-align" property tag.
	//
	// Used by ImageView.
	// Sets the vertical alignment of the image relative to its bounds.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	ImageVerticalAlign PropertyName = "image-vertical-align"

	// ImageHorizontalAlign is the constant for "image-horizontal-align" property tag.
	//
	// Used by ImageView.
	// Sets the horizontal alignment of the image relative to its bounds.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	ImageHorizontalAlign PropertyName = "image-horizontal-align"

	// Checked is the constant for "checked" property tag.
	//
	// Used by Checkbox, ListView.
	//
	// # Usage in Checkbox
	//
	// Current state of the checkbox.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - Checkbox is checked.
	//   - false, 0, "false", "no", "off", or "0" - Checkbox is unchecked.
	//
	// # Usage in ListView
	//
	// Set or get the list of checked items. Stores array of indices of checked items.
	//
	// Supported types: []int, int, string.
	//
	// Internal type is []int, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - []int - contains indices of selected list items. Stored as is.
	//   - int - contains index of one selected list item, converted to []int.
	//   - string - contains one or several indices of selected list items separated by comma(,).
	Checked PropertyName = "checked"

	// ItemVerticalAlign is the constant for "item-vertical-align" property tag.
	//
	// Used by ListView.
	// Sets the vertical alignment of the contents of the list items.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Height alignment.
	ItemVerticalAlign PropertyName = "item-vertical-align"

	// ItemHorizontalAlign is the constant for "item-horizontal-align" property tag.
	//
	// Used by ListView.
	// Sets the horizontal alignment of the contents of the list items.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Left alignment.
	//   - 1 (RightAlign) or "right" - Right alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Height alignment.
	ItemHorizontalAlign PropertyName = "item-horizontal-align"

	// ItemCheckbox is the constant for "checkbox" property tag.
	//
	// Used by ListView.
	// Style of checkbox used to mark items in a list. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneCheckbox) or "none" - There is no checkbox.
	//   - 1 (SingleCheckbox) or "single" - A checkbox that allows you to mark only one item, example: ◉.
	//   - 2 (MultipleCheckbox) or "multiple" - A checkbox that allows you to mark several items, example: ☑.
	ItemCheckbox PropertyName = "checkbox"

	// CheckboxHorizontalAlign is the constant for "checkbox-horizontal-align" property tag.
	//
	// Used by Checkbox, ListView.
	//
	// # Usage in Checkbox
	//
	// Horizontal alignment of checkbox inside the checkbox container.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Checkbox on the left edge, content on the right.
	//   - 1 (RightAlign) or "right" - Checkbox on the right edge, content on the left.
	//   - 2 (CenterAlign) or "center" - Center horizontally. Content below or above.
	//
	// # Usage in ListView
	//
	// Checkbox horizontal alignment(if enabled by "checkbox" property).
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (LeftAlign) or "left" - Checkbox on the left edge, content on the right.
	//   - 1 (RightAlign) or "right" - Checkbox on the right edge, content on the left.
	//   - 2 (CenterAlign) or "center" - Center horizontally. Content below or above.
	CheckboxHorizontalAlign PropertyName = "checkbox-horizontal-align"

	// CheckboxVerticalAlign is the constant for "checkbox-vertical-align" property tag.
	//
	// Used by Checkbox, ListView.
	//
	// # Usage in Checkbox
	//
	// Vertical alignment of checkbox inside the checkbox container.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Checkbox on the top, content on the bottom.
	//   - 1 (BottomAlign) or "bottom" - Checkbox on the bottom, content on the top.
	//   - 2 (CenterAlign) or "center" - Checkbox on the top, content on the bottom.
	//
	// # Usage in ListView
	//
	// Checkbox vertical alignment(if enabled by "checkbox" property).
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	CheckboxVerticalAlign PropertyName = "checkbox-vertical-align"

	// NotTranslate is the constant for "not-translate" property tag.
	//
	// Used by TextView, View.
	//
	// Controls whether the text set for the text view require translation. This is an inherited property, i.e. if it is not
	// defined, then the value of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - No need to lookup for text translation in resources.
	//   - false, 0, "false", "no", "off", or "0" - Lookup for text translation.
	NotTranslate PropertyName = "not-translate"

	// Filter is the constant for "filter" property tag.
	//
	// Used by View.
	// Applies graphical effects to a view, such as blurring, color shifting, changing brightness/contrast, etc.
	//
	// Supported types: FilterProperty.
	//
	// See FilterProperty description for more details.
	Filter PropertyName = "filter"

	// BackdropFilter is the constant for "backdrop-filter" property tag.
	//
	// Used by View.
	// Applies graphical effects to the area behind a view, such as blurring, color shifting, changing brightness/contrast,
	// etc.
	//
	// Supported types: FilterProperty.
	//
	// See FilterProperty description for more details.
	BackdropFilter PropertyName = "backdrop-filter"

	// Clip is the constant for "clip" property tag.
	//
	// Used by View.
	// Creates a clipping region that sets what part of a view should be shown.
	//
	// Supported types: ClipShapeProperty, string.
	//
	// Internal type is ClipShapeProperty, other types converted to it during assignment.
	// See ClipShapeProperty description for more details.
	Clip PropertyName = "clip"

	// Points is the constant for "points" property tag.
	//
	// Used by ClipShapeProperty.
	// Points which describe polygon clip area. Values are in a sequence of pair like: x1, y1, x2, y2 ...
	//
	// Supported types: []SizeUnit, string.
	Points PropertyName = "points"

	// ShapeOutside is the constant for "shape-outside" property tag.
	//
	// Used by View.
	// __WARNING__ Currently not supported. Property defines a shape(which may be non-rectangular) around which adjacent
	// inline content should wrap. By default, inline content wraps around its margin box. Property provides a way to
	// customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes.
	//
	// Supported types: ClipShapeProperty, string.
	//
	// Internal type is ClipShapeProperty, other types converted to it during assignment.
	// See ClipShapeProperty description for more details.
	ShapeOutside PropertyName = "shape-outside"

	// Float is the constant for "float" property tag.
	//
	// Used by View.
	// Places a view on the left or right side of its container, allowing text and inline views to wrap around it.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneFloat) or "none" - Text and other views inside the container will not wrap around this view.
	//   - 1 (LeftFloat) or "left" - Text and other views inside the container will wrap around this view on the right side.
	//   - 2 (RightFloat) or "right" - Text and other views inside the container will wrap around this view on the left side.
	Float PropertyName = "float"

	// UserData is the constant for "user-data" property tag.
	//
	// Used by View.
	// Can contain any user data.
	//
	// Supported types: any.
	UserData PropertyName = "user-data"

	// Resize is the constant for "resize" property tag.
	//
	// Used by View.
	// Sets whether view is resizable, and if so, in which directions. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneResize) or "none" - View cannot be resized.
	//   - 1 (BothResize) or "both" - The View displays a mechanism for allowing the user to resize it, which may be resized both horizontally and vertically.
	//   - 2 (HorizontalResize) or "horizontal" - The View displays a mechanism for allowing the user to resize it in the horizontal direction.
	//   - 3 (VerticalResize) or "vertical" - The View displays a mechanism for allowing the user to resize it in the vertical direction.
	Resize PropertyName = "resize"

	// UserSelect is the constant for "user-select" property tag.
	//
	// Used by View.
	// Controls whether the user can select the text. This is an inherited property, i.e. if it is not defined, then the value
	// of the parent view is used. Default value is false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", or "1" - User can select the text.
	//   - false, 0, "false", "no", "off", or "0" - Text is not selectable.
	UserSelect PropertyName = "user-select"

	// Order is the constant for "Order" property tag.
	//
	// Used by View.
	//
	// Set the order to layout an item in a ViewsContainer container. Items in a container are sorted by
	// ascending order value and then by their addition to container order.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - Views with lower value will be at the beginning.
	//   - not negative value - Views with higher value will be at the end.
	Order PropertyName = "Order"

	// BackgroundBlendMode is the constant for "background-blend-mode" property tag.
	//
	// Used by View.
	// Sets how view's background images should blend with each other and with the view's background color.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BlendNormal) or "normal" - The final color is the top color, regardless of what the bottom color is.
	//    The effect is like two opaque pieces of paper overlapping.
	//   - 1 (BlendMultiply) or "multiply" - The final color is the result of multiplying the top and bottom colors.
	//    A black layer leads to a black final layer, and a white layer leads to no change.
	//    The effect is like two images printed on transparent film overlapping.
	//   - 2 (BlendScreen) or "screen" - The final color is the result of inverting the colors, multiplying them,
	//    and inverting that value. A black layer leads to no change, and a white layer leads to a white final layer.
	//    The effect is like two images shone onto a projection screen.
	//   - 3 (BlendOverlay) or "overlay" - The final color is the result of multiply if the bottom color is darker,
	//    or screen if the bottom color is lighter. This blend mode is equivalent to hard-light but with the layers swapped.
	//   - 4 (BlendDarken) or "darken" - The final color is composed of the darkest values of each color channel.
	//   - 5 (BlendLighten) or "lighten" - The final color is composed of the lightest values of each color channel.
	//   - 6 (BlendColorDodge) or "color-dodge" - The final color is the result of dividing the bottom color by the inverse of the top color.
	//    A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color.
	//    This blend mode is similar to screen, but the foreground need only be as light as the inverse of the backdrop to create a fully lit color.
	//   - 7 (BlendColorBurn) or "color-burn" - The final color is the result of inverting the bottom color, dividing the value by the top color,
	//    and inverting that value. A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image.
	//    This blend mode is similar to multiply, but the foreground need only be as dark as the inverse of the backdrop to make the final image black.
	//   - 8 (BlendHardLight) or "hard-light" - The final color is the result of multiply if the top color is darker, or screen if the top color is lighter.
	//    This blend mode is equivalent to overlay but with the layers swapped. The effect is similar to shining a harsh spotlight on the backdrop.
	//   - 9 (BlendSoftLight) or "soft-light" - The final color is similar to hard-light, but softer. This blend mode behaves similar to hard-light.
	//    The effect is similar to shining a diffused spotlight on the backdrop.
	//   - 10 (BlendDifference) or "difference" - The final color is the result of subtracting the darker of the two colors from the lighter one.
	//    A black layer has no effect, while a white layer inverts the other layer's color.
	//   - 11 (BlendExclusion) or "exclusion" - The final color is similar to difference, but with less contrast.
	//    As with difference, a black layer has no effect, while a white layer inverts the other layer's color.
	//   - 12 (BlendHue) or "hue" - The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
	//   - 13 (BlendSaturation) or "saturation" - The final color has the saturation of the top color, while using the hue and luminosity of the bottom color.
	//    A pure gray backdrop, having no saturation, will have no effect.
	//   - 14 (BlendColor) or "color" - The final color has the hue and saturation of the top color, while using the luminosity of the bottom color.
	//    The effect preserves gray levels and can be used to colorize the foreground.
	//   - 15 (BlendLuminosity) or "luminosity" - The final color has the luminosity of the top color, while using the hue and saturation of the bottom color.
	//    This blend mode is equivalent to BlendColor, but with the layers swapped.
	BackgroundBlendMode PropertyName = "background-blend-mode"

	// MixBlendMode is the constant for "mix-blend-mode" property tag.
	//
	// Used by View.
	// Sets how view's content should blend with the content of the view's parent and the view's background.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (BlendNormal) or "normal" - The final color is the top color, regardless of what the bottom color is.
	//    The effect is like two opaque pieces of paper overlapping.
	//   - 1 (BlendMultiply) or "multiply" - The final color is the result of multiplying the top and bottom colors.
	//    A black layer leads to a black final layer, and a white layer leads to no change.
	//    The effect is like two images printed on transparent film overlapping.
	//   - 2 (BlendScreen) or "screen" - The final color is the result of inverting the colors, multiplying them,
	//    and inverting that value. A black layer leads to no change, and a white layer leads to a white final layer.
	//    The effect is like two images shone onto a projection screen.
	//   - 3 (BlendOverlay) or "overlay" - The final color is the result of multiply if the bottom color is darker,
	//    or screen if the bottom color is lighter. This blend mode is equivalent to hard-light but with the layers swapped.
	//   - 4 (BlendDarken) or "darken" - The final color is composed of the darkest values of each color channel.
	//   - 5 (BlendLighten) or "lighten" - The final color is composed of the lightest values of each color channel.
	//   - 6 (BlendColorDodge) or "color-dodge" - The final color is the result of dividing the bottom color by the inverse of the top color.
	//    A black foreground leads to no change. A foreground with the inverse color of the backdrop leads to a fully lit color.
	//    This blend mode is similar to screen, but the foreground need only be as light as the inverse of the backdrop to create a fully lit color.
	//   - 7 (BlendColorBurn) or "color-burn" - The final color is the result of inverting the bottom color, dividing the value by the top color,
	//    and inverting that value. A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image.
	//    This blend mode is similar to multiply, but the foreground need only be as dark as the inverse of the backdrop to make the final image black.
	//   - 8 (BlendHardLight) or "hard-light" - The final color is the result of multiply if the top color is darker, or screen if the top color is lighter.
	//    This blend mode is equivalent to overlay but with the layers swapped. The effect is similar to shining a harsh spotlight on the backdrop.
	//   - 9 (BlendSoftLight) or "soft-light" - The final color is similar to hard-light, but softer. This blend mode behaves similar to hard-light.
	//    The effect is similar to shining a diffused spotlight on the backdrop.
	//   - 10 (BlendDifference) or "difference" - The final color is the result of subtracting the darker of the two colors from the lighter one.
	//    A black layer has no effect, while a white layer inverts the other layer's color.
	//   - 11 (BlendExclusion) or "exclusion" - The final color is similar to difference, but with less contrast.
	//    As with difference, a black layer has no effect, while a white layer inverts the other layer's color.
	//   - 12 (BlendHue) or "hue" - The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
	//   - 13 (BlendSaturation) or "saturation" - The final color has the saturation of the top color, while using the hue and luminosity of the bottom color.
	//    A pure gray backdrop, having no saturation, will have no effect.
	//   - 14 (BlendColor) or "color" - The final color has the hue and saturation of the top color, while using the luminosity of the bottom color.
	//    The effect preserves gray levels and can be used to colorize the foreground.
	//   - 15 (BlendLuminosity) or "luminosity" - The final color has the luminosity of the top color, while using the hue and saturation of the bottom color.
	//    This blend mode is equivalent to BlendColor, but with the layers swapped.
	MixBlendMode PropertyName = "mix-blend-mode"

	// TabIndex is the constant for "tabindex" property tag.
	//
	// Used by View.
	// Indicates that view can be focused, and where it participates in sequential keyboard navigation(usually with the Tab
	// key).
	//
	// Supported types: int, string.
	//
	// Values:
	//   - negative value - View can be selected with the mouse or touch, but does not participate in sequential navigation.
	//   - 0 - View can be selected and reached using sequential navigation, the order of navigation is determined by the browser(usually in order of addition).
	//   - positive value - View will be reached(and selected) using sequential navigation, and navigation is performed by ascending "tabindex" value.
	TabIndex PropertyName = "tabindex"

	// Tooltip is the constant for "tooltip" property tag.
	//
	// Used by View.
	// Specifies the tooltip text. Tooltip pops up when hovering the mouse cursor over the view. HTML tags are supported when
	// formatting tooltip text.
	//
	// Supported types: string.
	Tooltip PropertyName = "tooltip"
)

Constants for various properties and events of Views'.

const (
	// Radius is the constant for "radius" property tag.
	//
	// Used by View, BackgroundElement, ClipShapeProperty.
	//
	// Usage in View:
	// Specifies the corners rounding radius of an element's outer border edge.
	//
	// Supported types: RadiusProperty, SizeUnit, SizeFunc, BoxRadius, string, float, int.
	//
	// Internal type is either RadiusProperty or SizeUnit, other types converted to them during assignment.
	// See RadiusProperty, SizeUnit, SizeFunc and BoxRadius description for more details.
	//
	// Conversion rules:
	//   - RadiusProperty - stored as is, no conversion performed.
	//   - SizeUnit - stored as is and set all corners to have the same value.
	//   - BoxRadius - a new RadiusProperty will be created and all corresponding elliptical radius values will be set.
	//   - string - if one value will be provided then it will be set as a radius for all corners. If two values will be provided divided by (/) then x and y radius will be set for all corners. Examples: "1em", "1em/0.5em", "2/4". Values which doesn't have size prefix will use size in pixels by default.
	//   - float - values of this type will set radius for all corners in pixels.
	//   - int - values of this type will set radius for all corners in pixels.
	//
	// Usage in BackgroundElement:
	// Same as "radial-gradient-radius".
	//
	// Usage in ClipShapeProperty:
	// Specifies the radius of the corners or the radius of the cropping area.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	Radius PropertyName = "radius"

	// RadiusX is the constant for "radius-x" property tag.
	//
	// Used by View, ClipShapeProperty.
	//
	// Usage in View:
	// Specifies the x-axis corners elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	//
	// Usage in ClipShapeProperty:
	// Specifies the x-axis corners elliptic rounding radius of the elliptic clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusX PropertyName = "radius-x"

	// RadiusY is the constant for "radius-y" property tag.
	//
	// Used by View, ClipShapeProperty.
	//
	// Usage in View:
	// Specifies the y-axis corners elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	//
	// Usage in ClipShapeProperty:
	// Specifies the y-axis corners elliptic rounding radius of of the elliptic clip shape.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusY PropertyName = "radius-y"

	// RadiusTopLeft is the constant for "radius-top-left" property tag.
	//
	// Used by View.
	// Specifies the top-left corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopLeft PropertyName = "radius-top-left"

	// RadiusTopLeftX is the constant for "radius-top-left-x" property tag.
	//
	// Used by View.
	// Specifies the x-axis top-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopLeftX PropertyName = "radius-top-left-x"

	// RadiusTopLeftY is the constant for "radius-top-left-y" property tag.
	//
	// Used by View.
	// Specifies the y-axis top-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopLeftY PropertyName = "radius-top-left-y"

	// RadiusTopRight is the constant for "radius-top-right" property tag.
	//
	// Used by View.
	// Specifies the top-right corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopRight PropertyName = "radius-top-right"

	// RadiusTopRightX is the constant for "radius-top-right-x" property tag.
	//
	// Used by View.
	// Specifies the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopRightX PropertyName = "radius-top-right-x"

	// RadiusTopRightY is the constant for "radius-top-right-y" property tag.
	//
	// Used by View.
	// Specifies the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusTopRightY PropertyName = "radius-top-right-y"

	// RadiusBottomLeft is the constant for "radius-bottom-left" property tag.
	//
	// Used by View.
	// Specifies the bottom-left corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomLeft PropertyName = "radius-bottom-left"

	// RadiusBottomLeftX is the constant for "radius-bottom-left-x" property tag.
	//
	// Used by View.
	// Specifies the x-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomLeftX PropertyName = "radius-bottom-left-x"

	// RadiusBottomLeftY is the constant for "radius-bottom-left-y" property tag.
	//
	// Used by View.
	// Specifies the y-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomLeftY PropertyName = "radius-bottom-left-y"

	// RadiusBottomRight is the constant for "radius-bottom-right" property tag.
	//
	// Used by View.
	// Specifies the bottom-right corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomRight PropertyName = "radius-bottom-right"

	// RadiusBottomRightX is the constant for "radius-bottom-right-x" property tag.
	//
	// Used by View.
	// Specifies the x-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomRightX PropertyName = "radius-bottom-right-x"

	// RadiusBottomRightY is the constant for "radius-bottom-right-y" property tag.
	//
	// Used by View.
	// Specifies the y-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	RadiusBottomRightY PropertyName = "radius-bottom-right-y"

	// X is the constant for "x" property tag.
	//
	// Used by ClipShapeProperty, RadiusProperty.
	//
	// Usage in ClipShapeProperty:
	// Specifies x-axis position of the clip shape center.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	//
	// Usage in RadiusProperty:
	// Determines the x-axis elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	X PropertyName = "x"

	// Y is the constant for "y" property tag.
	//
	// Used by ClipShapeProperty, RadiusProperty.
	//
	// Usage in ClipShapeProperty:
	// Specifies y-axis position of the clip shape center.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	//
	// Usage in RadiusProperty:
	// Determines the y-axis elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	Y PropertyName = "y"

	// TopLeft is the constant for "top-left" property tag.
	//
	// Used by RadiusProperty.
	// Determines the top-left corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopLeft PropertyName = "top-left"

	// TopLeftX is the constant for "top-left-x" property tag.
	//
	// Used by RadiusProperty.
	// Determines the x-axis top-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopLeftX PropertyName = "top-left-x"

	// TopLeftY is the constant for "top-left-y" property tag.
	//
	// Used by RadiusProperty.
	// Determines the y-axis top-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopLeftY PropertyName = "top-left-y"

	// TopRight is the constant for "top-right" property tag.
	//
	// Used by RadiusProperty.
	// Determines the top-right corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopRight PropertyName = "top-right"

	// TopRightX is the constant for "top-right-x" property tag.
	//
	// Used by RadiusProperty.
	// Determines the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopRightX PropertyName = "top-right-x"

	// TopRightY is the constant for "top-right-y" property tag.
	//
	// Used by RadiusProperty.
	// Determines the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TopRightY PropertyName = "top-right-y"

	// BottomLeft is the constant for "bottom-left" property tag.
	//
	// Used by RadiusProperty.
	// Determines the bottom-left corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomLeft PropertyName = "bottom-left"

	// BottomLeftX is the constant for "bottom-left-x" property tag.
	//
	// Used by RadiusProperty.
	// Determines the x-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomLeftX PropertyName = "bottom-left-x"

	// BottomLeftY is the constant for "bottom-left-y" property tag.
	//
	// Used by RadiusProperty.
	// Determines the y-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomLeftY PropertyName = "bottom-left-y"

	// BottomRight is the constant for "bottom-right" property tag.
	//
	// Used by RadiusProperty.
	// Determines the bottom-right corner rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomRight PropertyName = "bottom-right"

	// BottomRightX is the constant for "bottom-right-x" property tag.
	//
	// Used by RadiusProperty.
	// Determines the x-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomRightX PropertyName = "bottom-right-x"

	// BottomRightY is the constant for "bottom-right-y" property tag.
	//
	// Used by RadiusProperty.
	// Determines the y-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BottomRightY PropertyName = "bottom-right-y"
)

Constants for RadiusProperty specific properties

const (
	// ColorTag is the constant for "color" property tag.
	//
	// Used by ColumnSeparatorProperty, BorderProperty, OutlineProperty, ShadowProperty.
	//
	// # Usage in ColumnSeparatorProperty
	//
	// Line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	//
	// # Usage in BorderProperty
	//
	// Border line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	//
	// # Usage in OutlineProperty
	//
	// Outline line color.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	//
	// # Usage in ShadowProperty
	//
	// Color property of the shadow.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	ColorTag PropertyName = "color"

	// Inset is the constant for "inset" property tag.
	//
	// Used by ShadowProperty.
	// Controls whether to draw shadow inside the frame or outside. Inset shadows are drawn inside the border(even transparent
	// ones), above the background, but below content.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Drop shadow inside the frame(as if the content was depressed inside the box).
	//   - false, 0, "false", "no", "off", "0" - Shadow is assumed to be a drop shadow(as if the box were raised above the content).
	Inset PropertyName = "inset"

	// XOffset is the constant for "x-offset" property tag.
	//
	// Used by ShadowProperty.
	// Determines the shadow horizontal offset. Negative values place the shadow to the left of the element.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	XOffset PropertyName = "x-offset"

	// YOffset is the constant for "y-offset" property tag.
	//
	// Used by ShadowProperty.
	// Determines the shadow vertical offset. Negative values place the shadow above the element.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	YOffset PropertyName = "y-offset"

	// BlurRadius is the constant for "blur" property tag.
	//
	// Used by ShadowProperty.
	// Determines the radius of the blur effect. The larger this value, the bigger the blur, so the shadow becomes bigger and
	// lighter. Negative values are not allowed.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	BlurRadius PropertyName = "blur"

	// SpreadRadius is the constant for "spread-radius" property tag.
	//
	// Used by ShadowProperty.
	// Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	SpreadRadius PropertyName = "spread-radius"
)

Constants for ShadowProperty specific properties

const (
	// PushTransform is the constant for "push-transform" property tag.
	//
	// Used by StackLayout.
	// Specify start translation, scale and rotation over x, y and z axes as well as a distortion
	// for an animated pushing of a child view.
	//
	// Supported types: TransformProperty, string.
	//
	// See TransformProperty description for more details.
	//
	// Conversion rules:
	//   - TransformProperty - stored as is, no conversion performed.
	//   - string - string representation of Transform interface. Example: "_{translate-x = 10px, scale-y = 1.1}".
	PushTransform = "push-transform"

	// PushDuration is the constant for "push-duration" property tag.
	//
	// Used by StackLayout.
	// Sets the length of time in seconds that an push/pop animation takes to complete.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushDuration = "push-duration"

	// PushTiming is the constant for "push-timing" property tag.
	//
	// Used by StackLayout.
	// Set how an push/pop animation progresses through the duration of each cycle.
	//
	// Supported types: string.
	//
	// Values:
	//   - "ease" (EaseTiming) - Speed increases towards the middle and slows down at the end.
	//   - "ease-in" (EaseInTiming) - Speed is slow at first, but increases in the end.
	//   - "ease-out" (EaseOutTiming) - Speed is fast at first, but decreases in the end.
	//   - "ease-in-out" (EaseInOutTiming) - Speed is slow at first, but quickly increases and at the end it decreases again.
	//   - "linear" (LinearTiming) - Constant speed.
	//   - "step(n)" (StepTiming(n int) function) - Timing function along stepCount stops along the transition, displaying each stop for equal lengths of time.
	//   - "cubic-bezier(x1, y1, x2, y2)" (CubicBezierTiming(x1, y1, x2, y2 float64) function) - Cubic-Bezier curve timing function. x1 and x2 must be in the range [0, 1].
	PushTiming = "push-timing"

	// MoveToFrontAnimation is the constant for "move-to-front-animation" property tag.
	//
	// Used by StackLayout.
	// Specifies whether animation is used when calling the MoveToFront/MoveToFrontByID method of StackLayout interface.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - animation is used (default value).
	//   - false, 0, "false", "no", "off", "0" - animation is not used.
	MoveToFrontAnimation = "move-to-front-animation"

	// PushPerspective is the constant for "push-perspective" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "perspective" property of StackLayout "push-transform" property:
	// Distance between the z-plane and the user in order to give a 3D-positioned element some perspective. Each 3D element
	// with z > 0 becomes larger, each 3D-element with z < 0 becomes smaller. The default value is 0 (no 3D effects).
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PushPerspective PropertyName = "push-perspective"

	// PushTranslateX is the constant for "push-translate-x" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "translate-x" property of StackLayout "push-transform" property:
	// x-axis translation value of a 2D/3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PushTranslateX PropertyName = "push-translate-x"

	// PushTranslateY is the constant for "push-translate-y" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "translate-y" property of StackLayout "push-transform" property:
	// y-axis translation value of a 2D/3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PushTranslateY PropertyName = "push-translate-y"

	// PushTranslateZ is the constant for "push-translate-z" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "translate-z" property of StackLayout "push-transform" property:
	// z-axis translation value of a 3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PushTranslateZ PropertyName = "push-translate-z"

	// PushScaleX is the constant for "push-scale-x" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "scale-x" property of StackLayout "push-transform" property:
	// x-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushScaleX PropertyName = "push-scale-x"

	// PushScaleY is the constant for "push-scale-y" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "scale-y" property of StackLayout "push-transform" property:
	// y-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushScaleY PropertyName = "push-scale-y"

	// PushScaleZ is the constant for "push-scale-z" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "scale-z" property of StackLayout "push-transform" property:
	// z-axis scaling value of a 3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushScaleZ PropertyName = "push-scale-z"

	// PushRotate is the constant for "push-rotate" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "rotate" property of StackLayout "push-transform" property:
	// Angle of the view rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	PushRotate PropertyName = "push-rotate"

	// PushRotateX is the constant for "push-rotate-x" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "rotate-x" property of StackLayout "push-transform" property:
	// x-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushRotateX PropertyName = "push-rotate-x"

	// PushRotateY is the constant for "push-rotate-y" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "rotate-y" property of StackLayout "push-transform" property:
	// y-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushRotateY PropertyName = "push-rotate-y"

	// PushRotateZ is the constant for "push-rotate-z" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "rotate-z" property of StackLayout "push-transform" property:
	// z-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	PushRotateZ PropertyName = "push-rotate-z"

	// PushSkewX is the constant for "push-skew-x" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "skew-x" property of StackLayout "push-transform" property:
	// Angle to use to distort the element along the abscissa. The default value is 0.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	PushSkewX PropertyName = "push-skew-x"

	// PushSkewY is the constant for "push-skew-y" property tag.
	//
	// Used by StackLayout.
	//
	// Used to access the "skew-y" property of StackLayout "push-transform" property:
	// Angle to use to distort the element along the ordinate. The default value is 0.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	PushSkewY PropertyName = "push-skew-y"
)

Constants which represent StackLayout animation type during pushing or popping views

const (
	// TableVerticalAlign is the constant for "table-vertical-align" property tag.
	//
	// Used by TableView.
	// Set the vertical alignment of the content inside a table cell.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopAlign) or "top" - Top alignment.
	//   - 1 (BottomAlign) or "bottom" - Bottom alignment.
	//   - 2 (CenterAlign) or "center" - Center alignment.
	//   - 3 (StretchAlign) or "stretch" - Work as baseline alignment, see below.
	//   - 4 (BaselineAlign) or "baseline" - Baseline alignment.
	TableVerticalAlign PropertyName = "table-vertical-align"

	// HeadHeight is the constant for "head-height" property tag.
	//
	// Used by TableView.
	// Sets the number of rows in the table header. The default value is 0 (no header).
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "0" - No header.
	//   - positive value - Number of rows act as a header.
	HeadHeight PropertyName = "head-height"

	// HeadStyle is the constant for "head-style" property tag.
	//
	// Used by TableView.
	// Set the header style name or description of style properties.
	//
	// Supported types: string, Params.
	//
	// Internal type is either string or Params.
	//
	// Conversion rules:
	//   - string - must contain style name defined in resources.
	//   - Params - must contain style properties.
	HeadStyle PropertyName = "head-style"

	// FootHeight is the constant for "foot-height" property tag.
	//
	// Used by TableView.
	// Sets the number of rows in the table footer. The default value is 0 (no footer).
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "0" - No footer.
	//   - positive value - Number of rows act as a footer.
	FootHeight PropertyName = "foot-height"

	// FootStyle is the constant for "foot-style" property tag.
	//
	// Used by TableView.
	// Set the footer style name or description of style properties.
	//
	// Supported types: string, Params.
	//
	// Internal type is either string or Params.
	//
	// Conversion rules:
	//   - string - must contain style name defined in resources.
	//   - Params - must contain style properties.
	FootStyle PropertyName = "foot-style"

	// RowSpan is the constant for "row-span" property tag.
	//
	// Used by TableView.
	// Set the number of table row to span. Used only when specifying cell parameters in the implementation of
	// TableCellStyle.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "0" - No merging will be applied.
	//   - positive value - Number of rows including current one to be merged together.
	RowSpan PropertyName = "row-span"

	// ColumnSpan is the constant for "column-span" property tag.
	//
	// Used by TableView.
	// Sets the number of table column cells to be merged together. Used only when specifying cell parameters in the
	// implementation of TableCellStyle.
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 or "0" - No merging will be applied.
	//   - positive value - Number of columns including current one to be merged together.
	ColumnSpan PropertyName = "column-span"

	// RowStyle is the constant for "row-style" property tag.
	//
	// Used by TableView.
	// Set the adapter which specifies styles of each table row.
	//
	// Supported types: TableRowStyle, []Params.
	//
	// Internal type is TableRowStyle, other types converted to it during assignment.
	// See TableRowStyle description for more details.
	RowStyle PropertyName = "row-style"

	// ColumnStyle is the constant for "column-style" property tag.
	//
	// Used by TableView.
	// Set the adapter which specifies styles of each table column.
	//
	// Supported types: TableColumnStyle, []Params.
	//
	// Internal type is TableColumnStyle, other types converted to it during assignment.
	// See TableColumnStyle description for more details.
	ColumnStyle PropertyName = "column-style"

	// CellStyle is the constant for "cell-style" property tag.
	//
	// Used by TableView.
	// Set the adapter which specifies styles of each table cell. This property can be assigned only by an implementation of
	// TableCellStyle interface.
	//
	// Supported types: TableCellStyle.
	CellStyle PropertyName = "cell-style"

	// CellPadding is the constant for "cell-padding" property tag.
	//
	// Used by TableView.
	// Sets the padding area on all four sides of a table cell at once. An element's padding area is the space between its
	// content and its border.
	//
	// Supported types: BoundsProperty, Bounds, SizeUnit, float32, float64, int.
	//
	// Internal type is BoundsProperty, other types converted to it during assignment.
	// See BoundsProperty, Bounds and SizeUnit description for more details.
	CellPadding PropertyName = "cell-padding"

	// CellPaddingLeft is the constant for "cell-padding-left" property tag.
	//
	// Used by TableView.
	// Set the width of the padding area to the left of a cell content. An element's padding area is the space between its
	// content and its border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellPaddingLeft PropertyName = "cell-padding-left"

	// CellPaddingRight is the constant for "cell-padding-right" property tag.
	//
	// Used by TableView.
	// Set the width of the padding area to the left of a cell content. An element's padding area is the space between its
	// content and its border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellPaddingRight PropertyName = "cell-padding-right"

	// CellPaddingTop is the constant for "cell-padding-top" property tag.
	//
	// Used by TableView.
	// Set the height of the padding area to the top of a cell content. An element's padding area is the space between its
	// content and its border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellPaddingTop PropertyName = "cell-padding-top"

	// CellPaddingBottom is the constant for "cell-padding-bottom" property tag.
	//
	// Used by TableView.
	// Set the height of the padding area to the bottom of a cell content.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellPaddingBottom PropertyName = "cell-padding-bottom"

	// CellBorder is the constant for "cell-border" property tag.
	//
	// Used by TableView.
	// Set a table cell's border. It sets the values of a border width, style, and color. Can also be used when setting
	// parameters in properties "row-style", "column-style", "foot-style" and "head-style".
	//
	// Supported types: BorderProperty, ViewBorder, ViewBorders.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See BorderProperty, ViewBorder and ViewBorders description for more details.
	CellBorder PropertyName = "cell-border"

	// CellBorderLeft is the constant for "cell-border-left" property tag.
	//
	// Used by TableView.
	// Set a view's left border. It sets the values of a border width, style, and color. This property can be assigned a value
	// of BorderProperty, ViewBorder types or BorderProperty text representation.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder and BorderProperty description for more details.
	CellBorderLeft PropertyName = "cell-border-left"

	// CellBorderRight is the constant for "cell-border-right" property tag.
	//
	// Used by TableView.
	// Set a view's right border. It sets the values of a border width, style, and color. This property can be assigned a
	// value of BorderProperty, ViewBorder types or BorderProperty text representation.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder and BorderProperty description for more details.
	CellBorderRight PropertyName = "cell-border-right"

	// CellBorderTop is the constant for "cell-border-top" property tag.
	//
	// Used by TableView.
	// Set a view's top border. It sets the values of a border width, style, and color. This property can be assigned a value
	// of BorderProperty, ViewBorder types or BorderProperty text representation.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder and BorderProperty description for more details.
	CellBorderTop PropertyName = "cell-border-top"

	// CellBorderBottom is the constant for "cell-border-bottom" property tag.
	//
	// Used by TableView.
	// Set a view's bottom border. It sets the values of a border width, style, and color.
	//
	// Supported types: ViewBorder, BorderProperty, string.
	//
	// Internal type is BorderProperty, other types converted to it during assignment.
	// See ViewBorder and BorderProperty description for more details.
	CellBorderBottom PropertyName = "cell-border-bottom"

	// CellBorderStyle is the constant for "cell-border-style" property tag.
	//
	// Used by TableView.
	// Set the line style for all four sides of a table cell's border. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	CellBorderStyle PropertyName = "cell-border-style"

	// CellBorderLeftStyle is the constant for "cell-border-left-style" property tag.
	//
	// Used by TableView.
	// Set the line style of a table cell's left border. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	CellBorderLeftStyle PropertyName = "cell-border-left-style"

	// CellBorderRightStyle is the constant for "cell-border-right-style" property tag.
	//
	// Used by TableView.
	// Set the line style of a table cell's right border. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	CellBorderRightStyle PropertyName = "cell-border-right-style"

	// CellBorderTopStyle is the constant for "cell-border-top-style" property tag.
	//
	// Used by TableView.
	// Set the line style of a table cell's top border. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	CellBorderTopStyle PropertyName = "cell-border-top-style"

	// CellBorderBottomStyle is the constant for "cell-border-bottom-style" property tag.
	//
	// Used by TableView.
	// Sets the line style of a table cell's bottom border. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneLine) or "none" - The border will not be drawn.
	//   - 1 (SolidLine) or "solid" - Solid line as a border.
	//   - 2 (DashedLine) or "dashed" - Dashed line as a border.
	//   - 3 (DottedLine) or "dotted" - Dotted line as a border.
	//   - 4 (DoubleLine) or "double" - Double line as a border.
	CellBorderBottomStyle PropertyName = "cell-border-bottom-style"

	// CellBorderWidth is the constant for "cell-border-width" property tag.
	//
	// Used by TableView.
	// Set the line width for all four sides of a table cell's border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellBorderWidth PropertyName = "cell-border-width"

	// CellBorderLeftWidth is the constant for "cell-border-left-width" property tag.
	//
	// Used by TableView.
	// Set the line width of a table cell's left border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellBorderLeftWidth PropertyName = "cell-border-left-width"

	// CellBorderRightWidth is the constant for "cell-border-right-width" property tag.
	//
	// Used by TableView.
	// Set the line width of a table cell's right border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellBorderRightWidth PropertyName = "cell-border-right-width"

	// CellBorderTopWidth is the constant for "cell-border-top-width" property tag.
	//
	// Used by TableView.
	// Set the line width of a table cell's top border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellBorderTopWidth PropertyName = "cell-border-top-width"

	// CellBorderBottomWidth is the constant for "cell-border-bottom-width" property tag.
	//
	// Used by TableView.
	// Set the line width of a table cell's bottom border.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	CellBorderBottomWidth PropertyName = "cell-border-bottom-width"

	// CellBorderColor is the constant for "cell-border-color" property tag.
	//
	// Used by TableView.
	// Set the line color for all four sides of a table cell's border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	CellBorderColor PropertyName = "cell-border-color"

	// CellBorderLeftColor is the constant for "cell-border-left-color" property tag.
	//
	// Used by TableView.
	// Set the line color of a table cell's left border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	CellBorderLeftColor PropertyName = "cell-border-left-color"

	// CellBorderRightColor is the constant for "cell-border-right-color" property tag.
	//
	// Used by TableView.
	// Set the line color of a table cell's right border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	CellBorderRightColor PropertyName = "cell-border-right-color"

	// CellBorderTopColor is the constant for "cell-border-top-color" property tag.
	//
	// Used by TableView.
	// Set the line color of a table cell's top border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	CellBorderTopColor PropertyName = "cell-border-top-color"

	// CellBorderBottomColor is the constant for "cell-border-bottom-color" property tag.
	//
	// Used by TableView.
	// Set the line color of a table cell's bottom border.
	//
	// Supported types: Color, string.
	//
	// Internal type is Color, other types converted to it during assignment.
	// See Color description for more details.
	CellBorderBottomColor PropertyName = "cell-border-bottom-color"

	// SelectionMode is the constant for "selection-mode" property tag.
	//
	// Used by TableView.
	// Sets the mode of the table elements selection. Default value is "none".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (NoneSelection) or "none" - Table elements are not selectable. The table cannot receive input focus.
	//   - 1 (CellSelection) or "cell" - One table cell can be selected(highlighted). The cell is selected interactively using the mouse or keyboard(using the cursor keys).
	//   - 2 (RowSelection) or "row" - The entire table row can be selected (highlighted). The row is selected interactively using the mouse or keyboard (using the cursor keys).
	SelectionMode PropertyName = "selection-mode"

	// TableCellClickedEvent is the constant for "table-cell-clicked" property tag.
	//
	// Used by TableView.
	// Occur when the user clicks on a table cell.
	//
	// General listener format:
	//
	//  func(table rui.TableView, row, col int)
	//
	// where:
	//   - table - Interface of a table view which generated this event,
	//   - row - Row of the clicked cell,
	//   - col - Column of the clicked cell.
	//
	// Allowed listener formats:
	//
	//  func(row, col int)
	TableCellClickedEvent PropertyName = "table-cell-clicked"

	// TableCellSelectedEvent is the constant for "table-cell-selected" property tag.
	//
	// Used by TableView.
	// Occur when a table cell becomes selected.
	//
	// General listener format:
	//
	//  func(table rui.TableView, row, col int)
	//
	// where:
	//   - table - Interface of a table view which generated this event,
	//   - row - Row of the selected cell,
	//   - col - Column of the selected cell.
	//
	// Allowed listener formats:
	//
	//  func(row, col int)
	TableCellSelectedEvent PropertyName = "table-cell-selected"

	// TableRowClickedEvent is the constant for "table-row-clicked" property tag.
	//
	// Used by TableView.
	// Occur when the user clicks on a table row.
	//
	// General listener format:
	//
	//  func(table rui.TableView, row int)
	//
	// where:
	//   - table - Interface of a table view which generated this event,
	//   - row - Clicked row.
	//
	// Allowed listener formats:
	//
	//  func(row int)
	TableRowClickedEvent PropertyName = "table-row-clicked"

	// TableRowSelectedEvent is the constant for "table-row-selected" property tag.
	//
	// Used by TableView.
	// Occur when a table row becomes selected.
	//
	// General listener format:
	//
	//  func(table rui.TableView, row int)
	//
	// where:
	//   - table - Interface of a table view which generated this event,
	//   - row - Selected row.
	//
	// Allowed listener formats:
	//
	//  func(row int)
	TableRowSelectedEvent PropertyName = "table-row-selected"

	// AllowSelection is the constant for "allow-selection" property tag.
	//
	// Used by TableView.
	// Set the adapter which specifies whether cell/row selection is allowed. This property can be assigned by an
	// implementation of TableAllowCellSelection or TableAllowRowSelection interface.
	//
	// Supported types: TableAllowCellSelection, TableAllowRowSelection.
	//
	// Internal type is either TableAllowCellSelection, TableAllowRowSelection, see their description for more details.
	AllowSelection PropertyName = "allow-selection"
)

Constants for TableView specific properties and events

const (
	// CurrentTabChangedEvent is the constant for "current-tab-changed" property tag.
	//
	// Used by TabsLayout.
	// Occur when the new tab becomes active.
	//
	// General listener format:
	//
	//   func(tabsLayout rui.TabsLayout, newTab, oldTab int)
	//
	// where:
	//   - tabsLayout - Interface of a tabs layout which generated this event,
	//   - newTab - Index of a new active tab,
	//   - oldTab - Index of an old active tab.
	//
	// Allowed listener formats:
	//
	//  func(tabsLayout rui.TabsLayout, newTab int)
	//  func(newTab, oldTab int)
	//  func(newTab int)
	//  func()
	CurrentTabChangedEvent PropertyName = "current-tab-changed"

	// Icon is the constant for "icon" property tag.
	//
	// Used by TabsLayout.
	// Defines the icon name that is displayed in the tab. The property is set for the child view of TabsLayout.
	//
	// Supported types: string.
	Icon = "icon"

	// TabCloseButton is the constant for "tab-close-button" property tag.
	//
	// Used by TabsLayout.
	// Controls whether to add close button to a tab(s). This property can be set separately for each child view or for tabs
	// layout itself. Property set for child view takes precedence over the value set for tabs layout. Default value is
	// false.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Tab(s) has close button.
	//   - false, 0, "false", "no", "off", "0" - No close button in tab(s).
	TabCloseButton PropertyName = "tab-close-button"

	// TabCloseEvent is the constant for "tab-close-event" property tag.
	//
	// Used by TabsLayout.
	// Occurs when the user clicks on the tab close button.
	//
	// General listener format:
	//
	//  func(tabsLayout rui.TabsLayout, tab int)
	//
	// where:
	//   - tabsLayout - Interface of a tabs layout which generated this event,
	//   - tab - Index of the tab.
	//
	// Allowed listener formats:
	//
	//  func(tab int)
	//  func(tabsLayout rui.TabsLayout)
	//  func()
	TabCloseEvent PropertyName = "tab-close-event"

	// Tabs is the constant for "tabs" property tag.
	//
	// Used by TabsLayout.
	// Sets where the tabs are located. Default value is "top".
	//
	// Supported types: int, string.
	//
	// Values:
	//   - 0 (TopTabs) or "top" - Tabs on the top.
	//   - 1 (BottomTabs) or "bottom" - Tabs on the bottom.
	//   - 2 (LeftTabs) or "left" - Tabs on the left. Each tab is rotated 90° counterclockwise.
	//   - 3 (RightTabs) or "right" - Tabs located on the right. Each tab is rotated 90° clockwise.
	//   - 4 (LeftListTabs) or "left-list" - Tabs on the left. The tabs are displayed as a list.
	//   - 5 (RightListTabs) or "right-list" - Tabs on the right. The tabs are displayed as a list.
	//   - 6 (HiddenTabs) or "hidden" - Tabs are hidden.
	Tabs PropertyName = "tabs"

	// TabBarStyle is the constant for "tab-bar-style" property tag.
	//
	// Used by TabsLayout.
	// Set the style for the display of the tab bar. The default value is "ruiTabBar".
	//
	// Supported types: string.
	TabBarStyle PropertyName = "tab-bar-style"

	// TabStyle is the constant for "tab-style" property tag.
	//
	// Used by TabsLayout.
	// Set the style for the display of the tab. The default value is "ruiTab" or "ruiVerticalTab".
	//
	// Supported types: string.
	TabStyle PropertyName = "tab-style"

	// CurrentTabStyle is the constant for "current-tab-style" property tag.
	//
	// Used by TabsLayout.
	// Set the style for the display of the current(selected) tab. The default value is "ruiCurrentTab" or
	// "ruiCurrentVerticalTab".
	//
	// Supported types: string.
	CurrentTabStyle PropertyName = "current-tab-style"
)

Constants for TabsLayout specific view and events

const (
	// TimeChangedEvent is the constant for "time-changed" property tag.
	//
	// Used by TimePicker.
	// Occur when current time of the time picker has been changed.
	//
	// General listener format:
	//  func(picker rui.TimePicker, newTime time.Time, oldTime time.Time).
	//
	// where:
	//   - picker - Interface of a time picker which generated this event,
	//   - newTime - New time value,
	//   - oldTime - Old time value.
	//
	// Allowed listener formats:
	//  func(picker rui.TimePicker, newTime time.Time),
	//  func(newTime time.Time, oldTime time.Time),
	//  func(newTime time.Time),
	//  func(picker rui.TimePicker),
	//  func().
	TimeChangedEvent PropertyName = "time-changed"

	// TimePickerMin is the constant for "time-picker-min" property tag.
	//
	// Used by TimePicker.
	// The minimum value of the time.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "HH:MM:SS" - "08:15:00".
	//   - "HH:MM:SS PM" - "08:15:00 AM".
	//   - "HH:MM" - "08:15".
	//   - "HH:MM PM" - "08:15 AM".
	TimePickerMin PropertyName = "time-picker-min"

	// TimePickerMax is the constant for "time-picker-max" property tag.
	//
	// Used by TimePicker.
	// The maximum value of the time.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "HH:MM:SS" - "08:15:00".
	//   - "HH:MM:SS PM" - "08:15:00 AM".
	//   - "HH:MM" - "08:15".
	//   - "HH:MM PM" - "08:15 AM".
	TimePickerMax PropertyName = "time-picker-max"

	// TimePickerStep is the constant for "time-picker-step" property tag.
	//
	// Used by TimePicker.
	// Time step in seconds.
	//
	// Supported types: int, string.
	//
	// Values:
	// positive value - Step value in seconds used to increment or decrement time.
	TimePickerStep PropertyName = "time-picker-step"

	// TimePickerValue is the constant for "time-picker-value" property tag.
	//
	// Used by TimePicker.
	// Current value.
	//
	// Supported types: time.Time, string.
	//
	// Internal type is time.Time, other types converted to it during assignment.
	//
	// Conversion rules:
	// string - values of this type parsed and converted to time.Time. The following formats are supported:
	//   - "HH:MM:SS" - "08:15:00".
	//   - "HH:MM:SS PM" - "08:15:00 AM".
	//   - "HH:MM" - "08:15".
	//   - "HH:MM PM" - "08:15 AM".
	TimePickerValue PropertyName = "time-picker-value"
)

Constants for TimePicker specific properties and events.

const (
	// TouchStart is the constant for "touch-start" property tag.
	//
	// Used by View.
	// Is fired when one or more touch points are placed on the touch surface.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.TouchEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Touch event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.TouchEvent)
	//  func(view rui.View)
	//  func()
	TouchStart PropertyName = "touch-start"

	// TouchEnd is the constant for "touch-end" property tag.
	//
	// Used by View.
	// Fired when one or more touch points are removed from the touch surface.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.TouchEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Touch event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.TouchEvent)
	//  func(view rui.View)
	//  func()
	TouchEnd PropertyName = "touch-end"

	// TouchMove is the constant for "touch-move" property tag.
	//
	// Used by View.
	// Is fired when one or more touch points are moved along the touch surface.
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.TouchEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Touch event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.TouchEvent)
	//  func(view rui.View)
	//  func()
	TouchMove PropertyName = "touch-move"

	// TouchCancel is the constant for "touch-cancel" property tag.
	//
	// Used by View.
	// Is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many
	// touch points are created).
	//
	// General listener format:
	//
	//  func(view rui.View, event rui.TouchEvent)
	//
	// where:
	//   - view - Interface of a view which generated this event,
	//   - event - Touch event.
	//
	// Allowed listener formats:
	//
	//  func(event rui.TouchEvent)
	//  func(view rui.View)
	//  func()
	TouchCancel PropertyName = "touch-cancel"
)

Constants which represent View specific touch events properties

const (
	// Transform is the constant for "transform" property tag.
	//
	// Used by View.
	// Specify translation, scale and rotation over x, y and z axes as well as a distortion of a view along x and y axes.
	//
	// Supported types: TransformProperty, string.
	//
	// See TransformProperty description for more details.
	//
	// Conversion rules:
	//   - TransformProperty - stored as is, no conversion performed.
	//   - string - string representation of TransformProperty interface. Example: "_{translate-x = 10px, scale-y = 1.1}".
	Transform PropertyName = "transform"

	// Perspective is the constant for "perspective" property tag.
	//
	// Used by View, TransformProperty.
	// Distance between the z-plane and the user in order to give a 3D-positioned element some perspective. Each 3D element
	// with z > 0 becomes larger, each 3D-element with z < 0 becomes smaller. The default value is 0 (no 3D effects).
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	Perspective PropertyName = "perspective"

	// PerspectiveOriginX is the constant for "perspective-origin-x" property tag.
	//
	// Used by View.
	// x-coordinate of the position at which the viewer is looking. It is used as the vanishing point by the "perspective"
	// property. The default value is 50%.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PerspectiveOriginX PropertyName = "perspective-origin-x"

	// PerspectiveOriginY is the constant for "perspective-origin-y" property tag.
	//
	// Used by View.
	// y-coordinate of the position at which the viewer is looking. It is used as the vanishing point by the "perspective"
	// property. The default value is 50%.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	PerspectiveOriginY PropertyName = "perspective-origin-y"

	// BackfaceVisible is the constant for "backface-visibility" property tag.
	//
	// Used by View.
	// Controls whether the back face of a view is visible when turned towards the user. Default value is true.
	//
	// Supported types: bool, int, string.
	//
	// Values:
	//   - true, 1, "true", "yes", "on", "1" - Back face is visible when turned towards the user.
	//   - false, 0, "false", "no", "off", "0" - Back face is hidden, effectively making the view invisible when turned away from the user.
	BackfaceVisible PropertyName = "backface-visibility"

	// TransformOriginX is the constant for "transform-origin-x" property tag.
	//
	// Used by View.
	// x-coordinate of the point around which a view transformation is applied. The default value is 50%.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TransformOriginX PropertyName = "transform-origin-x"

	// TransformOriginY is the constant for "transform-origin-y" property tag.
	//
	// Used by View.
	// y-coordinate of the point around which a view transformation is applied. The default value is 50%.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TransformOriginY PropertyName = "transform-origin-y"

	// TransformOriginZ is the constant for "transform-origin-z" property tag.
	//
	// Used by View.
	// z-coordinate of the point around which a view transformation is applied. The default value is 50%.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TransformOriginZ PropertyName = "transform-origin-z"

	// TranslateX is the constant for "translate-x" property tag.
	//
	// Used by View, TransformProperty.
	//
	// x-axis translation value of a 2D/3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TranslateX PropertyName = "translate-x"

	// TranslateY is the constant for "translate-y" property tag.
	//
	// Used by View, TransformProperty.
	//
	// x-axis translation value of a 2D/3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TranslateY PropertyName = "translate-y"

	// TranslateZ is the constant for "translate-z" property tag.
	//
	// Used by View, TransformProperty.
	//
	// z-axis translation value of a 3D translation.
	//
	// Supported types: SizeUnit, SizeFunc, string, float, int.
	//
	// Internal type is SizeUnit, other types converted to it during assignment.
	// See SizeUnit description for more details.
	TranslateZ PropertyName = "translate-z"

	// ScaleX is the constant for "scale-x" property tag.
	//
	// Used by View, TransformProperty.
	//
	// x-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ScaleX PropertyName = "scale-x"

	// ScaleY is the constant for "scale-y" property tag.
	//
	// Used by View, TransformProperty.
	//
	// y-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ScaleY PropertyName = "scale-y"

	// ScaleZ is the constant for "scale-z" property tag.
	//
	// Used by View, TransformProperty.
	//
	// z-axis scaling value of a 3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
	// scale, more than 1 - to increase. The default value is 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	ScaleZ PropertyName = "scale-z"

	// Rotate is the constant for "rotate" property tag.
	//
	// Used by View, TransformProperty.
	//
	// Angle of the view rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	Rotate PropertyName = "rotate"

	// RotateX is the constant for "rotate-x" property tag.
	//
	// Used by View, TransformProperty.
	//
	// x-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	RotateX PropertyName = "rotate-x"

	// RotateY is the constant for "rotate-y" property tag.
	//
	// Used by View, TransformProperty.
	//
	// y-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	RotateY PropertyName = "rotate-y"

	// RotateZ is the constant for "rotate-z" property tag.
	//
	// Used by View, TransformProperty.
	//
	// z-coordinate of the vector denoting the axis of rotation in range 0 to 1.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	RotateZ PropertyName = "rotate-z"

	// SkewX is the constant for "skew-x" property tag.
	//
	// Used by View, TransformProperty.
	//
	// Angle to use to distort the element along the abscissa. The default value is 0.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	SkewX PropertyName = "skew-x"

	// SkewY is the constant for "skew-y" property tag.
	//
	// Used by View, TransformProperty.
	//
	// Angle to use to distort the element along the ordinate. The default value is 0.
	//
	// Supported types: AngleUnit, string, float, int.
	//
	// Internal type is AngleUnit, other types will be converted to it during assignment.
	// See AngleUnit description for more details.
	//
	// Conversion rules:
	//   - AngleUnit - stored as is, no conversion performed.
	//   - string - must contain string representation of AngleUnit. If numeric value will be provided without any suffix then AngleUnit with value and Radian value type will be created.
	//   - float - a new AngleUnit value will be created with Radian as a type.
	//   - int - a new AngleUnit value will be created with Radian as a type.
	SkewY PropertyName = "skew-y"
)

Constants for TransformProperty specific properties

const (
	// VideoWidth is the constant for "video-width" property tag.
	//
	// Used by VideoPlayer.
	// Defines the width of the video's display area in pixels.
	//
	// Supported types: float, int, string.
	//
	// Values:
	// Internal type is float, other types converted to it during assignment.
	VideoWidth PropertyName = "video-width"

	// VideoHeight is the constant for "video-height" property tag.
	//
	// Used by VideoPlayer.
	// Defines the height of the video's display area in pixels.
	//
	// Supported types: float, int, string.
	//
	// Internal type is float, other types converted to it during assignment.
	VideoHeight PropertyName = "video-height"

	// Poster is the constant for "poster" property tag.
	//
	// Used by VideoPlayer.
	// Defines an URL for an image to be shown while the video is downloading. If this attribute isn't specified, nothing is
	// displayed until the first frame is available, then the first frame is shown as the poster frame.
	//
	// Supported types: string.
	Poster PropertyName = "poster"
)

Constants for VideoPlayer specific properties and events

const CheckboxChangedEvent PropertyName = "checkbox-event"

CheckboxChangedEvent is the constant for "checkbox-event" property tag.

Used by `Checkbox`. Event occurs when the checkbox becomes checked/unchecked.

General listener format:

func(checkbox rui.Checkbox, checked bool)

where:

  • checkbox - Interface of a checkbox which generated this event,
  • checked - Checkbox state.

Allowed listener formats:

func(checkbox rui.Checkbox)
func(checked bool)
func()
const (
	// DataList is the constant for "data-list" property tag.
	//
	// Used by ColorPicker, DatePicker, EditView, NumberPicker, TimePicker.
	//
	// # Usage in ColorPicker
	//
	// List of pre-defined colors.
	//
	// Supported types: []string, string, []fmt.Stringer, []Color, []any containing
	// elements of string, fmt.Stringer, int, int8…int64, uint, uint8…uint64.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - contain single item.
	//   - []string - an array of items.
	//   - []fmt.Stringer - an array of objects convertible to a string.
	//   - []Color - An array of color values which will be converted to a string array.
	//   - []any - this array must contain only types which were listed in Types section.
	//
	// # Usage in DatePicker
	//
	// List of predefined dates. If we set this property, date picker may have a drop-down menu with a list of these values.
	// Some browsers may ignore this property, such as Safari for macOS. The value of this property must be an array of
	// strings in the format "YYYY-MM-DD".
	//
	// Supported types: []string, string, []fmt.Stringer, []time.Time, []any containing elements of string, fmt.Stringer, time.Time.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - contain single item.
	//   - []string - an array of items.
	//   - []fmt.Stringer - an array of objects convertible to a string.
	//   - []time.Time - an array of Time values which will be converted to a string array.
	//   - []any - this array must contain only types which were listed in Types section.
	//
	// # Usage in EditView
	//
	// Array of recommended values.
	//
	// Supported types: []string, string, []fmt.Stringer, and []any containing
	// elements of string, fmt.Stringer, bool, rune, float32, float64, int, int8…int64, uint, uint8…uint64.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - contain single item.
	//   - []string - an array of items.
	//   - []fmt.Stringer - an array of objects convertible to a string.
	//   - []any - this array must contain only types which were listed in Types section.
	//
	// # Usage in NumberPicker
	//
	// Specify an array of recommended values.
	//
	// Supported types: []string, string, []fmt.Stringer, []float, []int, []bool, []any containing elements
	// of string, fmt.Stringer, rune, float32, float64, int, int8…int64, uint, uint8…uint64.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - must contain integer or floating point number, converted to []string.
	//   - []string - an array of strings which must contain integer or floating point numbers, stored as is.
	//   - []fmt.Stringer - object which implement this interface must contain integer or floating point numbers, converted to a []string.
	//   - []float - converted to []string.
	//   - []int - converted to []string.
	//   - []any - an array which may contain types listed in Types section above, each value will be converted to a string and wrapped to array.
	//
	// # Usage in TimePicker
	//
	// An array of recommended values. The value of this property must be an array of strings in the format "HH:MM:SS" or
	// "HH:MM".
	//
	// Supported types: []string, string, []fmt.Stringer, []time.Time, []any containing elements of string, fmt.Stringer, time.Time.
	//
	// Internal type is []string, other types converted to it during assignment.
	//
	// Conversion rules:
	//   - string - contain single item.
	//   - []string - an array of items.
	//   - []fmt.Stringer - an array of objects convertible to a string.
	//   - []time.Time - An array of Time values which will be converted to a string array.
	//   - []any - this array must contain only types which were listed in Types section.
	DataList PropertyName = "data-list"
)
const DrawFunction PropertyName = "draw-function"

DrawFunction is the constant for "draw-function" property tag.

Used by `CanvasView`. Property sets the draw function of `CanvasView`.

Supported types: `func(Canvas)`.

const DropDownEvent PropertyName = "drop-down-event"

DropDownEvent is the constant for "drop-down-event" property tag.

Used by DropDownList. Occur when a list item becomes selected.

General listener format:

func(list rui.DropDownList, index int)

where:

  • list - Interface of a drop down list which generated this event,
  • index - Index of a newly selected item.

Allowed listener formats:

func(index int)
func(list rui.DropDownList)
func()
const ResizeEvent PropertyName = "resize-event"

ResizeEvent is the constant for "resize-event" property tag.

Used by View. Is fired when the view changes its size.

General listener format:

func(view rui.View, frame rui.Frame)

where:

  • view - Interface of a view which generated this event,
  • frame - New offset and size of the view's visible area.

Allowed listener formats:

func(frame rui.Frame)
func(view rui.View)
func()
const ScrollEvent PropertyName = "scroll-event"

ScrollEvent is the constant for "scroll-event" property tag.

Used by View. Is fired when the content of the view is scrolled.

General listener format:

func(view rui.View, frame rui.Frame)

where:

  • view - Interface of a view which generated this event,
  • frame - New offset and size of the view's visible area.

Allowed listener formats:

func(frame rui.Frame)
func(view rui.View)
func()

type RadialGradientRadiusType added in v0.18.0

type RadialGradientRadiusType int
const (
	// EllipseGradient is value of the Shape property of a radial gradient background:
	// the shape is an axis-aligned ellipse
	EllipseGradient = 0

	// CircleGradient is value of the Shape property of a radial gradient background:
	// the gradient's shape is a circle with constant radius
	CircleGradient = 1

	// ClosestSideGradient is value of the Radius property of a radial gradient background:
	// The gradient's ending shape meets the side of the box closest to its center (for circles)
	// or meets both the vertical and horizontal sides closest to the center (for ellipses).
	ClosestSideGradient RadialGradientRadiusType = 0

	// ClosestCornerGradient is value of the Radius property of a radial gradient background:
	// The gradient's ending shape is sized so that it exactly meets the closest corner
	// of the box from its center.
	ClosestCornerGradient RadialGradientRadiusType = 1

	// FarthestSideGradient is value of the Radius property of a radial gradient background:
	// Similar to closest-side, except the ending shape is sized to meet the side of the box
	// farthest from its center (or vertical and horizontal sides).
	FarthestSideGradient RadialGradientRadiusType = 2

	// FarthestCornerGradient is value of the Radius property of a radial gradient background:
	// The default value, the gradient's ending shape is sized so that it exactly meets
	// the farthest corner of the box from its center.
	FarthestCornerGradient RadialGradientRadiusType = 3
)

Constants related to view's background gradient description

type RadiusProperty

type RadiusProperty interface {
	Properties

	fmt.Stringer

	// BoxRadius returns x and y radius of the corners of the element
	BoxRadius(session Session) BoxRadius
	// contains filtered or unexported methods
}

RadiusProperty is a description of the View (shape) elliptical corner radius.

func NewEllipticRadius added in v0.18.0

func NewEllipticRadius[xType SizeUnit | int | float64, yType SizeUnit | int | float64](x xType, y yType) RadiusProperty

NewRadiusProperty creates the new RadiusProperty which having the same elliptical radii for all angles.

Arguments determines the x- and y-axis elliptic rounding radius. if an argument is specified as int or float64, the value is considered to be in pixels

func NewRadii added in v0.18.0

func NewRadii[topRightType SizeUnit | int | float64, bottomRightType SizeUnit | int | float64, bottomLeftType SizeUnit | int | float64, topLeftType SizeUnit | int | float64](
	topRight topRightType, bottomRight bottomRightType, bottomLeft bottomLeftType, topLeft topLeftType) RadiusProperty

NewRadius creates the new RadiusProperty.

The arguments specify the radii in a clockwise direction: "top-right", "bottom-right", "bottom-left", and "top-left".

if an argument is specified as int or float64, the value is considered to be in pixels

func NewRadiusProperty

func NewRadiusProperty(params Params) RadiusProperty

NewRadiusProperty creates the new RadiusProperty

The following properties can be used:

  • "x" (X) - Determines the x-axis elliptic rounding radius of an element's outer border edge.
  • "y" (Y) - Determines the y-axis corner elliptic rounding radius of an element's outer border edge.
  • "top-left" (TopLeft) - Determines the top-left corner rounding radius of an element's outer border edge.
  • "top-left-x" (TopLeftX) - Determines the x-axis top-left corner elliptic rounding radius of an element's outer border edge.
  • "top-left-y" (TopLeftY) - Determines the y-axis top-left corner elliptic rounding radius of an element's outer border edge.
  • "top-right" (TopRight) - Determines the top-right corner rounding radius of an element's outer border edge.
  • "top-right-x" (TopRightX) - Determines the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
  • "top-right-y" (TopRightY) - Determines the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
  • "bottom-left" (BottomLeft) - Determines the bottom-left corner rounding radius of an element's outer border edge.
  • "bottom-left-x" (BottomLeftX) - Determines the x-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
  • "bottom-left-y" (BottomLeftY) - Determines the y-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
  • "bottom-right" (BottomRight) - Determines the bottom-right corner rounding radius of an element's outer border edge.
  • "bottom-right-x" (BottomRightX) - Determines the x-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
  • "bottom-right-y" (BottomRightY) - Determines the y-axis bottom-right corner elliptic rounding radius of an element's outer border edge.

type Range

type Range struct {
	First, Last int
}

Range defines range limits. The First and Last value are included in the range

func GetColumn

func GetColumn(view View, subviewID ...string) Range

GetColumn returns the range of column numbers of a GridLayout in which the subview is placed. If the second argument (subviewID) is not specified or it is "" then a values from the first argument (view) is returned.

func GetRow

func GetRow(view View, subviewID ...string) Range

GetRow returns the range of row numbers of a GridLayout in which the subview is placed. If the second argument (subviewID) is not specified or it is "" then a values from the first argument (view) is returned.

func (Range) String

func (r Range) String() string

String returns a string representation of the Range struct

type Resizable

type Resizable interface {
	View
	ParentView
}

Resizable represents a Resizable view

func NewResizable

func NewResizable(session Session, params Params) Resizable

NewResizable create new Resizable object and return it

type Session

type Session interface {
	// App return the current application interface
	App() Application
	// ID return the id of the session
	ID() int

	// DarkTheme returns "true" if the dark theme is used
	DarkTheme() bool
	// Mobile returns "true" if current session is displayed on a touch screen device
	TouchScreen() bool
	// PixelRatio returns the ratio of the resolution in physical pixels to the resolution
	// in logical pixels for the current display device.
	PixelRatio() float64
	// TextDirection returns the default text direction (LeftToRightDirection (1) or RightToLeftDirection (2))
	TextDirection() int
	// Constant returns the constant with "tag" name or "" if it is not exists
	Constant(tag string) (string, bool)
	// Color returns the color with "tag" name or 0 if it is not exists
	Color(tag string) (Color, bool)
	// ImageConstant returns the image constant with "tag" name or "" if it is not exists
	ImageConstant(tag string) (string, bool)
	// SetCustomTheme set the custom theme
	SetCustomTheme(name string) bool
	// UserAgent returns the "user-agent" text of the client browser
	UserAgent() string
	// RemoteAddr returns the client address.
	RemoteAddr() string
	// Language returns the current session language
	Language() string
	// SetLanguage set the current session language
	SetLanguage(lang string)
	// GetString returns the text for the current language
	GetString(tag string) (string, bool)

	// Content returns the SessionContent of session
	Content() SessionContent

	// SetTitle sets the text of the browser title/tab
	SetTitle(title string)
	// SetTitleColor sets the color of the browser navigation bar. Supported only in Safari and Chrome for android
	SetTitleColor(color Color)

	// RootView returns the root view of the session
	RootView() View
	// Get returns a value of the view (with id defined by the first argument) property with name defined by the second argument.
	// The type of return value depends on the property. If the property is not set then nil is returned.
	Get(viewID string, tag PropertyName) any
	// Set sets the value (third argument) of the property (second argument) of the view with id defined by the first argument.
	// Return "true" if the value has been set, in the opposite case "false" are returned and
	// a description of the error is written to the log
	Set(viewID string, tag PropertyName, value any) bool

	// DownloadFile downloads (saves) on the client side the file located at the specified path on the server.
	DownloadFile(path string)
	//DownloadFileData downloads (saves) on the client side a file with a specified name and specified content.
	DownloadFileData(filename string, data []byte)
	// OpenURL opens the url in the new browser tab
	OpenURL(url string)

	// ClientItem reads value by key from the client-side storage
	ClientItem(key string) (string, bool)
	// SetClientItem stores a key-value pair in the client-side storage
	SetClientItem(key, value string)
	// RemoveClientItem removes a key-value pair in the client-side storage
	RemoveClientItem(key string)
	// RemoveAllClientItems removes all key-value pair from the client-side storage
	RemoveAllClientItems()

	// SetHotKey sets the function that will be called when the given hotkey is pressed.
	// Invoke SetHotKey(..., ..., nil) for remove hotkey function.
	SetHotKey(keyCode KeyCode, controlKeys ControlKeyMask, fn func(Session))

	// StartTimer starts a timer on the client side.
	// The first argument specifies the timer period in milliseconds.
	// The second argument specifies a function that will be called on each timer event.
	// The result is the id of the timer, which is used to stop the timer
	StartTimer(ms int, timerFunc func(Session)) int
	// StopTimer the timer with the given id
	StopTimer(timerID int)
	// contains filtered or unexported methods
}

Session provide interface to session parameters assess

type SessionContent

type SessionContent interface {

	// CreateRootView will be called by the library to create a root view of the application
	CreateRootView(session Session) View
}

SessionContent is the interface of a session content

type SessionDisconnectListener

type SessionDisconnectListener interface {
	// OnDisconnect is a function that is called by the library if the server loses connection with the client and
	// this happens when the connection is broken
	OnDisconnect(session Session)
}

SessionPauseListener is the listener interface of a session disconnect event

type SessionFinishListener

type SessionFinishListener interface {
	// OnFinish is a function that is called by the library when the user closes the application page in the browser
	OnFinish(session Session)
}

SessionFinishListener is the listener interface of a session start event

type SessionPauseListener

type SessionPauseListener interface {
	// OnPause is a function that is called by the library when the application page in the client's browser becomes
	// inactive and is also called when the user switches to a different browser tab/window, minimizes the browser,
	// or switches to another application
	OnPause(session Session)
}

SessionPauseListener is the listener interface of a session pause event

type SessionReconnectListener

type SessionReconnectListener interface {
	// OnReconnect is a function that is called by the library after the server reconnects with the client
	// and this happens when the connection is restored
	OnReconnect(session Session)
}

SessionPauseListener is the listener interface of a session reconnect event

type SessionResumeListener

type SessionResumeListener interface {
	// OnResume is a function that is called by the library when the application page in the client's browser becomes
	// active and is also called immediately after OnStart
	OnResume(session Session)
}

SessionResumeListener is the listener interface of a session resume event

type SessionStartListener

type SessionStartListener interface {
	// OnStart is a function that is called by the library after the creation of the root view of the application
	OnStart(session Session)
}

SessionStartListener is the listener interface of a session start event

type ShadowProperty added in v0.18.0

type ShadowProperty interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

ShadowProperty contains attributes of the view shadow

func GetShadowPropertys added in v0.18.0

func GetShadowPropertys(view View, subviewID ...string) []ShadowProperty

GetShadowPropertys returns shadows of the subview. If the second argument (subviewID) is not specified or it is "" then shadows of the first argument (view) is returned.

func GetTextShadows

func GetTextShadows(view View, subviewID ...string) []ShadowProperty

GetTextShadows returns text shadows of the subview. If the second argument (subviewID) is not specified or it is "" then shadows of the first argument (view) is returned.

func NewInsetShadow added in v0.18.0

func NewInsetShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64, spreadType SizeUnit | int | float64](
	xOffset xOffsetType, yOffset yOffsetType, blurRadius blurType, spreadRadius spreadType, color Color) ShadowProperty

NewInsetShadow create the new inset shadow property for a view. Arguments:

  • offsetX, offsetY is x and y offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • spreadRadius is the spread radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • color is the color of the shadow.

func NewShadow added in v0.18.0

func NewShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64, spreadType SizeUnit | int | float64](
	xOffset xOffsetType, yOffset yOffsetType, blurRadius blurType, spreadRadius spreadType, color Color) ShadowProperty

NewShadow create the new shadow property for a view. Arguments:

  • offsetX, offsetY is x and y offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • spreadRadius is the spread radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • color is the color of the shadow.

func NewShadowProperty added in v0.18.0

func NewShadowProperty(params Params) ShadowProperty

NewShadowProperty create the new shadow property for a view.

The following properties can be used:

  • "color" (ColorTag). Determines the color of the shadow (Color);
  • "x-offset" (XOffset). Determines the shadow horizontal offset (SizeUnit);
  • "y-offset" (YOffset). Determines the shadow vertical offset (SizeUnit);
  • "blur" (BlurRadius). Determines the radius of the blur effect (SizeUnit);
  • "spread-radius" (SpreadRadius). Positive values (SizeUnit) will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink;
  • "inset" (Inset). Controls (bool) whether to draw shadow inside the frame or outside.

func NewTextShadow

func NewTextShadow[xOffsetType SizeUnit | int | float64, yOffsetType SizeUnit | int | float64, blurType SizeUnit | int | float64](
	xOffset xOffsetType, yOffset yOffsetType, blurRadius blurType, color Color) ShadowProperty

NewTextShadow create the new text shadow property. Arguments:

  • offsetX, offsetY is the x- and y-offset of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • blurRadius is the blur radius of the shadow (if the argument is specified as int or float64, the value is considered to be in pixels);
  • color is the color of the shadow.

type SimpleTableAdapter

type SimpleTableAdapter interface {
	TableAdapter
	TableCellStyle
}

SimpleTableAdapter is implementation of TableAdapter where the content defines as [][]any.

When you assign [][]any value to the "content" property, it is converted to SimpleTableAdapter

func NewSimpleTableAdapter

func NewSimpleTableAdapter(content [][]any) SimpleTableAdapter

NewSimpleTableAdapter creates the new SimpleTableAdapter

type SizeFunc added in v0.9.0

type SizeFunc interface {
	fmt.Stringer
	// Name() returns the function name: "min", "max", "clamp", "sum", "sub", "mul",
	// "div", "mod", "rem", "round", "round-up", "round-down" or "round-to-zero"
	Name() string
	// Args() returns a list of function arguments
	Args() []any
	// contains filtered or unexported methods
}

SizeFunc describes a function that calculates the SizeUnit size.

Used as the value of the SizeUnit properties.

"min", "max", "clamp", "sum", "sub", "mul", "div", mod, "round", "round-up", "round-down" and "round-to-zero" functions are available.

func ClampSize added in v0.9.0

func ClampSize(min, value, max any) SizeFunc

ClampSize creates a SizeUnit function whose the result is calculated as follows:

min ≤ value ≤ max -> value;
value < min -> min;
max < value -> max;

Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func DivSize added in v0.9.0

func DivSize(arg0, arg1 any) SizeFunc

DivSize creates a SizeUnit function that calculates the result of dividing the arguments (arg1 / arg2). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func MaxSize added in v0.9.0

func MaxSize(arg0, arg1 any, args ...any) SizeFunc

MaxSize creates a SizeUnit function that calculates the maximum argument. Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc

func MinSize added in v0.9.0

func MinSize(arg0, arg1 any, args ...any) SizeFunc

MinSize creates a SizeUnit function that calculates the minimum argument. Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func ModSize added in v0.17.0

func ModSize(arg0, arg1 any) SizeFunc

ModSize creates a SizeUnit function that calculates the remainder of a division operation with the same sign as the divisor (arg1 % arg2). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func MulSize added in v0.9.0

func MulSize(arg0, arg1 any) SizeFunc

MulSize creates a SizeUnit function that calculates the result of multiplying the arguments (arg1 * arg2). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func RemSize added in v0.17.0

func RemSize(arg0, arg1 any) SizeFunc

RemSize creates a SizeUnit function that calculates the remainder of a division operation with the same sign as the dividend (arg1 % arg2). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func RoundDownSize added in v0.17.0

func RoundDownSize(valueToRound, roundingInterval any) SizeFunc

RoundDownSize creates a SizeUnit function that calculates a rounded number. The function rounds valueToRound (first argument) down to the nearest integer multiple of roundingInterval (second argument) (if the value is negative, it will become "more negative"). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func RoundSize added in v0.17.0

func RoundSize(valueToRound, roundingInterval any) SizeFunc

RoundSize creates a SizeUnit function that calculates a rounded number. The function rounds valueToRound (first argument) to the nearest integer multiple of roundingInterval (second argument), which may be either above or below the value. If the valueToRound is half way between the rounding targets above and below (neither is "nearest"), it will be rounded up. Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func RoundToZeroSize added in v0.17.0

func RoundToZeroSize(valueToRound, roundingInterval any) SizeFunc

RoundToZeroSize creates a SizeUnit function that calculates a rounded number. The function rounds valueToRound (first argument) to the nearest integer multiple of roundingInterval (second argument), which may be either above or below the value. If the valueToRound is half way between the rounding targets above and below. Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func RoundUpSize added in v0.17.0

func RoundUpSize(valueToRound, roundingInterval any) SizeFunc

RoundUpSize creates a SizeUnit function that calculates a rounded number. The function rounds valueToRound (first argument) up to the nearest integer multiple of roundingInterval (second argument) (if the value is negative, it will become "more positive"). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc. The second argument can also be a number (float32, float32, int, int8...int64, uint, uint8...unit64) or a string which is a text representation of a number.

func SubSize added in v0.9.0

func SubSize(arg0, arg1 any) SizeFunc

SumSize creates a SizeUnit function that calculates the result of subtracting the arguments (arg1 - arg2). Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func SumSize added in v0.9.0

func SumSize(arg0, arg1 any, args ...any) SizeFunc

SumSize creates a SizeUnit function that calculates the sum of arguments. Valid arguments types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

type SizeUnit

type SizeUnit struct {
	// Type or dimension of the value
	Type SizeUnitType

	// Value of the size in Type units
	Value float64

	// Function representation of a size unit.
	// When setting this value type should be set to SizeFunction
	Function SizeFunc
}

SizeUnit describe a size (Value field) and size unit (Type field).

func AutoSize

func AutoSize() SizeUnit

AutoSize creates SizeUnit with Auto type

func Cm

func Cm[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Cm creates SizeUnit with SizeInCM type

func Em

func Em[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Em creates SizeUnit with SizeInEM type

func Ex

func Ex[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Ex creates SizeUnit with SizeInEX type

func Fr

func Fr[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Fr creates SizeUnit with SizeInFraction type

func GetBottom

func GetBottom(view View, subviewID ...string) SizeUnit

GetBottom returns a top position of the subview in an AbsoluteLayout container. If a parent view is not an AbsoluteLayout container then this value is ignored. If the second argument (subviewID) is not specified or it is "" then a bottom position of the first argument (view) is returned

func GetCellHeight

func GetCellHeight(view View, subviewID ...string) []SizeUnit

GetCellHeight returns the height of a GridLayout cell. If the result is an empty array, then the height is not set. If the result is a single value array, then the height of all cell is equal. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetCellWidth

func GetCellWidth(view View, subviewID ...string) []SizeUnit

GetCellWidth returns the width of a GridLayout cell. If the result is an empty array, then the width is not set. If the result is a single value array, then the width of all cell is equal. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetColumnGap

func GetColumnGap(view View, subviewID ...string) SizeUnit

GetColumnGap returns SizeUnit property which specifies the size of the gap (gutter) between columns of ColumnLayout. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetColumnSeparatorWidth

func GetColumnSeparatorWidth(view View, subviewID ...string) SizeUnit

ColumnSeparatorWidth returns SizeUnit value which specifies the width of the line drawn between columns in a multi-column layout. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetColumnWidth

func GetColumnWidth(view View, subviewID ...string) SizeUnit

GetColumnWidth returns SizeUnit value which specifies the width of each column of ColumnLayout. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetGridColumnGap

func GetGridColumnGap(view View, subviewID ...string) SizeUnit

GetGridColumnGap returns the gap between GridLayout columns. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetGridRowGap

func GetGridRowGap(view View, subviewID ...string) SizeUnit

GetGridRowGap returns the gap between GridLayout rows. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetHeight

func GetHeight(view View, subviewID ...string) SizeUnit

GetHeight returns the subview height. If the second argument (subviewID) is not specified or it is "" then a height of the first argument (view) is returned

func GetLeft

func GetLeft(view View, subviewID ...string) SizeUnit

GetLeft returns a left position of the subview in an AbsoluteLayout container. If a parent view is not an AbsoluteLayout container then this value is ignored. If the second argument (subviewID) is not specified or it is "" then a left position of the first argument (view) is returned

func GetLetterSpacing

func GetLetterSpacing(view View, subviewID ...string) SizeUnit

GetLetterSpacing returns a letter spacing of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetLineHeight

func GetLineHeight(view View, subviewID ...string) SizeUnit

GetLineHeight returns a height of a text line of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListColumnGap added in v0.9.0

func GetListColumnGap(view View, subviewID ...string) SizeUnit

GetListColumnGap returns the gap between ListLayout or ListView columns. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemHeight

func GetListItemHeight(view View, subviewID ...string) SizeUnit

GetListItemHeight returns the height of a ListView item. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListItemWidth

func GetListItemWidth(view View, subviewID ...string) SizeUnit

GetListItemWidth returns the width of a ListView item. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetListRowGap added in v0.9.0

func GetListRowGap(view View, subviewID ...string) SizeUnit

GetListRowGap returns the gap between ListLayout or ListView rows. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetMaxHeight

func GetMaxHeight(view View, subviewID ...string) SizeUnit

GetMaxHeight returns a maximal subview height. If the second argument (subviewID) is not specified or it is "" then a maximal height of the first argument (view) is returned

func GetMaxWidth

func GetMaxWidth(view View, subviewID ...string) SizeUnit

GetMaxWidth returns a maximal subview width. If the second argument (subviewID) is not specified or it is "" then a maximal width of the first argument (view) is returned

func GetMinHeight

func GetMinHeight(view View, subviewID ...string) SizeUnit

GetMinHeight returns a minimal subview height. If the second argument (subviewID) is not specified or it is "" then a minimal height of the first argument (view) is returned

func GetMinWidth

func GetMinWidth(view View, subviewID ...string) SizeUnit

GetMinWidth returns a minimal subview width. If the second argument (subviewID) is not specified or it is "" then a minimal width of the first argument (view) is returned

func GetOutlineOffset added in v0.13.0

func GetOutlineOffset(view View, subviewID ...string) SizeUnit

GetOutlineOffset returns the subview outline offset. If the second argument (subviewID) is not specified or it is "" then a offset of the first argument (view) is returned

func GetPerspective

func GetPerspective(view View, subviewID ...string) SizeUnit

GetPerspective returns a distance between the z = 0 plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The default value is 0 (no 3D effects). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetRight

func GetRight(view View, subviewID ...string) SizeUnit

GetRight returns a right position of the subview in an AbsoluteLayout container. If a parent view is not an AbsoluteLayout container then this value is ignored. If the second argument (subviewID) is not specified or it is "" then a right position of the first argument (view) is returned

func GetTextIndent

func GetTextIndent(view View, subviewID ...string) SizeUnit

GetTextIndent returns a text indent of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextLineThickness

func GetTextLineThickness(view View, subviewID ...string) SizeUnit

GetTextLineThickness returns the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTextSize

func GetTextSize(view View, subviewID ...string) SizeUnit

GetTextSize returns a text size of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTop

func GetTop(view View, subviewID ...string) SizeUnit

GetTop returns a top position of the subview in an AbsoluteLayout container. If a parent view is not an AbsoluteLayout container then this value is ignored. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

func GetWidth

func GetWidth(view View, subviewID ...string) SizeUnit

GetWidth returns the subview width. If the second argument (subviewID) is not specified or it is "" then a width of the first argument (view) is returned

func GetWordSpacing

func GetWordSpacing(view View, subviewID ...string) SizeUnit

GetWordSpacing returns a word spacing of the subview. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func Inch

func Inch[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Inch creates SizeUnit with SizeInInch type

func Mm

func Mm[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Mm creates SizeUnit with SizeInMM type

func Pc

func Pc[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Pc creates SizeUnit with SizeInPc type

func Percent

func Percent[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Percent creates SizeUnit with SizeInDIP type

func Pt

func Pt[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Pt creates SizeUnit with SizeInPt type

func Px

func Px[T float64 | float32 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64](value T) SizeUnit

Px creates SizeUnit with SizeInPixel type

func StringToSizeUnit

func StringToSizeUnit(value string) (SizeUnit, bool)

StringToSizeUnit converts the string argument to SizeUnit

func (SizeUnit) Equal

func (size SizeUnit) Equal(size2 SizeUnit) bool

Equal compare two SizeUnit. Return true if SizeUnit are equal

func (SizeUnit) String

func (size SizeUnit) String() string

String - convert SizeUnit to string

type SizeUnitType

type SizeUnitType uint8

SizeUnitType : type of enumerated constants for define a type of SizeUnit value.

Can take the following values: Auto, SizeInPixel, SizeInPercent, SizeInDIP, SizeInPt, SizeInInch, SizeInMM, SizeInFraction

const (
	// Auto is the SizeUnit type: default value.
	Auto SizeUnitType = 0
	// SizeInPixel is the SizeUnit type: the Value field specifies the size in pixels.
	SizeInPixel SizeUnitType = 1
	// SizeInEM is the SizeUnit type: the Value field specifies the size in em.
	SizeInEM SizeUnitType = 2
	// SizeInEX is the SizeUnit type: the Value field specifies the size in em.
	SizeInEX SizeUnitType = 3
	// SizeInPercent is the SizeUnit type: the Value field specifies the size in percents of the parent size.
	SizeInPercent SizeUnitType = 4
	// SizeInPt is the SizeUnit type: the Value field specifies the size in pt (1/72 inch).
	SizeInPt SizeUnitType = 5
	// SizeInPc is the SizeUnit type: the Value field specifies the size in pc (1pc = 12pt).
	SizeInPc SizeUnitType = 6
	// SizeInInch is the SizeUnit type: the Value field specifies the size in inches.
	SizeInInch SizeUnitType = 7
	// SizeInMM is the SizeUnit type: the Value field specifies the size in millimeters.
	SizeInMM SizeUnitType = 8
	// SizeInCM is the SizeUnit type: the Value field specifies the size in centimeters.
	SizeInCM SizeUnitType = 9
	// SizeInFraction is the SizeUnit type: the Value field specifies the size in fraction.
	// Used only for "cell-width" and "cell-height" property.
	SizeInFraction SizeUnitType = 10
	// SizeFunction is the SizeUnit type: the Function field specifies the size function.
	// "min", "max", "clamp", "sum", "sub", "mul", and "div" functions are available.
	SizeFunction = 11
)

Constants which represent values of a SizeUnitType

type StackLayout

type StackLayout interface {
	ViewsContainer

	// Peek returns the current (visible) View. If StackLayout is empty then it returns nil.
	Peek() View

	// RemovePeek removes the current View and returns it. If StackLayout is empty then it doesn't do anything and returns nil.
	RemovePeek() View

	// MoveToFront makes the given View current.
	//
	// The second argument is a function called after the move to front animation ends.
	//
	// Returns true if successful, false otherwise.
	MoveToFront(view View, onShown ...func(View)) bool

	// MoveToFrontByID makes the View current by viewID.
	//
	// The second argument is a function called after the move to front animation ends.
	//
	// Returns true if successful, false otherwise.
	MoveToFrontByID(viewID string, onShown ...func(View)) bool

	// Push adds a new View to the container and makes it current.
	//
	// It is similar to Append, but the addition is done using an animation effect.
	//
	// The animation type is specified by the second argument and can take the following values:
	//   - DefaultAnimation (0) - Default animation. For the Push function it is EndToStartAnimation, for Pop - StartToEndAnimation;
	//   - StartToEndAnimation (1) - Animation from beginning to end. The beginning and the end are determined by the direction of the text output;
	//   - EndToStartAnimation (2) - End-to-Beginning animation;
	//   - TopDownAnimation (3) - Top-down animation;
	//   - BottomUpAnimation (4) - Bottom up animation.
	// The second argument `onPushFinished` is the function to be called when the animation ends.
	Push(view View, onPushFinished ...func())

	// Pop removes the current View from the container using animation.
	//
	// The argument `onPopFinished` is the function to be called when the animation ends.
	//
	// The function will return false if the StackLayout is empty and true if the current item has been removed.
	Pop(onPopFinished ...func(View)) bool
}

StackLayout represents a StackLayout view

func NewStackLayout

func NewStackLayout(session Session, params Params) StackLayout

NewStackLayout create new StackLayout object and return it

func StackLayoutByID

func StackLayoutByID(rootView View, id string, ids ...string) StackLayout

StackLayoutByID return the StackLayout path to which is specified using the arguments id, ids. Example

view := StackLayoutByID(rootView, "id1", "id2", "id3")
view := StackLayoutByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not StackLayout, the function will return nil

type SvgImageView added in v0.12.0

type SvgImageView interface {
	View
}

SvgImageView represents an SvgImageView view

func NewSvgImageView added in v0.12.0

func NewSvgImageView(session Session, params Params) SvgImageView

NewSvgImageView create new SvgImageView object and return it

type TableAdapter

type TableAdapter interface {
	// RowCount returns number of rows in the table
	RowCount() int

	// ColumnCount returns number of columns in the table
	ColumnCount() int

	// Cell returns the contents of a table cell. The function can return elements of the following types:
	//   - string
	//   - rune
	//   - float32, float64
	//   - integer values: int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64
	//   - bool
	//   - rui.Color
	//   - rui.View
	//   - fmt.Stringer
	//   - rui.VerticalTableJoin, rui.HorizontalTableJoin
	Cell(row, column int) any
}

TableAdapter describes the TableView content

func GetTableContent added in v0.5.0

func GetTableContent(view View, subviewID ...string) TableAdapter

GetTableContent returns a TableAdapter which defines the TableView content. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

type TableAllowCellSelection added in v0.5.0

type TableAllowCellSelection interface {
	// AllowCellSelection returns "true" if we allow the user to select particular cell at specific rows and columns
	AllowCellSelection(row, column int) bool
}

TableAllowCellSelection determines whether TableView cell selection is allowed.

It is only used if the "selection-mode" property is set to CellSelection (1).

To set cell selection allowing, you must either implement the TableAllowCellSelection interface in the table adapter or assign its separate implementation to the "allow-selection" property.

type TableAllowRowSelection added in v0.5.0

type TableAllowRowSelection interface {
	// AllowRowSelection returns "true" if we allow the user to select particular row in the table
	AllowRowSelection(row int) bool
}

TableAllowRowSelection determines whether TableView row selection is allowed.

It is only used if the "selection-mode" property is set to RowSelection (2).

To set row selection allowing, you must either implement the TableAllowRowSelection interface in the table adapter or assign its separate implementation to the "allow-selection" property.

type TableCellStyle

type TableCellStyle interface {
	// CellStyle returns a map of properties which describe the style of the cell
	CellStyle(row, column int) Params
}

TableCellStyle describes the style of TableView cells.

To set row cells, you must either implement the TableCellStyle interface in the table adapter or assign its separate implementation to the "cell-style" property.

func GetTableCellStyle added in v0.5.0

func GetTableCellStyle(view View, subviewID ...string) TableCellStyle

GetTableCellStyle returns a TableCellStyle which defines styles of TableView cells. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

type TableColumnStyle

type TableColumnStyle interface {
	// ColumnStyle returns a map of properties which describe the style of the column
	ColumnStyle(column int) Params
}

TableColumnStyle describes the style of TableView columns.

To set column styles, you must either implement the TableColumnStyle interface in the table adapter or assign its separate implementation to the "column-style" property.

func GetTableColumnStyle added in v0.5.0

func GetTableColumnStyle(view View, subviewID ...string) TableColumnStyle

GetTableColumnStyle returns a TableColumnStyle which defines styles of TableView columns. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

type TableRowStyle

type TableRowStyle interface {
	// RowStyle returns a map of properties which describe the style of the row
	RowStyle(row int) Params
}

TableRowStyle describes the style of TableView rows.

To set row styles, you must either implement the TableRowStyle interface in the table adapter or assign its separate implementation to the "row-style" property.

func GetTableRowStyle added in v0.5.0

func GetTableRowStyle(view View, subviewID ...string) TableRowStyle

GetTableRowStyle returns a TableRowStyle which defines styles of TableView rows. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

type TableView

type TableView interface {
	View
	ParentView

	// ReloadTableData forces the table view to reload all data and redraw the entire table
	ReloadTableData()

	// ReloadCell forces the table view to reload the data for a specific cell and redraw it
	ReloadCell(row, column int)

	// CellFrame returns the frame of a specific cell, describing its position and size within the table view
	CellFrame(row, column int) Frame
}

TableView represents a TableView view

func NewTableView

func NewTableView(session Session, params Params) TableView

NewTableView create new TableView object and return it

func TableViewByID added in v0.3.0

func TableViewByID(rootView View, id string, ids ...string) TableView

TableViewByID return the TableView path to which is specified using the arguments id, ids. Example

view := TableViewByID(rootView, "id1", "id2", "id3")
view := TableViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not TableView, the function will return nil

type TabsLayout

type TabsLayout interface {
	ViewsContainer
	ListAdapter
}

TabsLayout represents a TabsLayout view

func NewTabsLayout

func NewTabsLayout(session Session, params Params) TabsLayout

NewTabsLayout create new TabsLayout object and return it

func TabsLayoutByID

func TabsLayoutByID(rootView View, id string, ids ...string) TabsLayout

TabsLayoutByID return the TabsLayout path to which is specified using the arguments id, ids. Example

view := TabsLayoutByID(rootView, "id1", "id2", "id3")
view := TabsLayoutByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not TabsLayout, the function will return nil

type TextMetrics added in v0.10.0

type TextMetrics struct {
	// Width is the calculated width of a segment of inline text in pixels
	Width float64
	// Ascent is the distance from the horizontal baseline to the top of the bounding rectangle used to render the text, in pixels.
	Ascent float64
	// Descent is the distance from the horizontal baseline to the bottom of the bounding rectangle used to render the text, in pixels.
	Descent float64
	// Left is the distance to the left side of the bounding rectangle of the given text, in  pixels;
	// positive numbers indicating a distance going left from the given alignment point.
	Left float64
	// Right is the distance to the right side of the bounding rectangle of the given text, CSS pixels.
	Right float64
}

TextMetrics is the result of the Canvas.TextMetrics function

type TextTableAdapter

type TextTableAdapter interface {
	TableAdapter
}

TextTableAdapter is implementation of TableAdapter where the content defines as [][]string. When you assign [][]string value to the "content" property, it is converted to TextTableAdapter

func NewTextTableAdapter

func NewTextTableAdapter(content [][]string) TextTableAdapter

NewTextTableAdapter creates the new TextTableAdapter

type TextView

type TextView interface {
	View
}

TextView represents a TextView view

func NewTextView

func NewTextView(session Session, params Params) TextView

NewTextView create new TextView object and return it

func TextViewByID

func TextViewByID(rootView View, id string, ids ...string) TextView

TextViewByID return the TextView path to which is specified using the arguments id, ids. Example

view := TextViewByID(rootView, "id1", "id2", "id3")
view := TextViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not TextView, the function will return nil

type Theme added in v0.6.0

type Theme interface {
	fmt.Stringer

	// Name returns a name of the theme
	Name() string

	// Constant returns normal and touch theme constant value with specific tag
	Constant(tag string) (string, string)

	// SetConstant sets a value for a constant
	SetConstant(tag string, value, touchUIValue string)

	// ConstantTags returns the list of all available constants
	ConstantTags() []string

	// Color returns normal and dark theme color constant value with specific tag
	Color(tag string) (string, string)

	// SetColor sets normal and dark theme color constant value with specific tag
	SetColor(tag, color, darkUIColor string)

	// ColorTags returns the list of all available color constants
	ColorTags() []string

	// Image returns normal and dark theme image constant value with specific tag
	Image(tag string) (string, string)

	// SetImage sets normal and dark theme image constant value with specific tag
	SetImage(tag, image, darkUIImage string)

	// ImageConstantTags returns the list of all available image constants
	ImageConstantTags() []string

	// Style returns view style by its tag
	Style(tag string) ViewStyle

	// SetStyle sets style for a tag
	SetStyle(tag string, style ViewStyle)

	// RemoveStyle removes style with provided tag
	RemoveStyle(tag string)

	// MediaStyle returns media style which correspond to provided media style parameters
	MediaStyle(tag string, params MediaStyleParams) ViewStyle

	// SetMediaStyle sets media style with provided media style parameters and a tag
	SetMediaStyle(tag string, params MediaStyleParams, style ViewStyle)

	// StyleTags returns all tags which describe a style
	StyleTags() []string

	// MediaStyles returns all media style settings which correspond to a style tag
	MediaStyles(tag string) []struct {
		Selectors string
		Params    MediaStyleParams
	}

	// Append theme to a list of themes
	Append(anotherTheme Theme)
	// contains filtered or unexported methods
}

Theme interface to describe application's theme

func CreateThemeFromText added in v0.6.0

func CreateThemeFromText(text string) (Theme, bool)

CreateThemeFromText creates a new theme from text and return its interface on success.

func NewTheme added in v0.6.0

func NewTheme(name string) Theme

NewTheme creates a new theme with specific name and return its interface.

type TimePicker

type TimePicker interface {
	View
}

TimePicker represents a TimePicker view

func NewTimePicker

func NewTimePicker(session Session, params Params) TimePicker

NewTimePicker create new TimePicker object and return it

func TimePickerByID added in v0.3.0

func TimePickerByID(rootView View, id string, ids ...string) TimePicker

TimePickerByID return the TimePicker path to which is specified using the arguments id, ids. Example

view := TimePickerByID(rootView, "id1", "id2", "id3")
view := TimePickerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not TimePicker, the function will return nil

type Touch

type Touch struct {
	// Identifier is a unique identifier for this Touch object. A given touch point (say, by a finger)
	// will have the same identifier for the duration of its movement around the surface.
	// This lets you ensure that you're tracking the same touch all the time.
	Identifier int

	// X provides the horizontal coordinate within the view's viewport.
	X float64

	// Y provides the vertical coordinate within the view's viewport.
	Y float64

	// ClientX provides the horizontal coordinate within the application's viewport at which the event occurred.
	ClientX float64

	// ClientY provides the vertical coordinate within the application's viewport at which the event occurred.
	ClientY float64

	// ScreenX provides the horizontal coordinate (offset) of the touch pointer in global (screen) coordinates.
	ScreenX float64

	// ScreenY provides the vertical coordinate (offset) of the touch pointer in global (screen) coordinates.
	ScreenY float64

	// RadiusX is the X radius of the ellipse that most closely circumscribes the area of contact with the screen.
	// The value is in pixels of the same scale as screenX.
	RadiusX float64

	// RadiusY is the Y radius of the ellipse that most closely circumscribes the area of contact with the screen.
	// The value is in pixels of the same scale as screenX.
	RadiusY float64

	// RotationAngle is the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated,
	// clockwise, to most accurately cover the area of contact between the user and the surface.
	RotationAngle float64

	// Force is the amount of pressure being applied to the surface by the user, as a float
	// between 0.0 (no pressure) and 1.0 (maximum pressure).
	Force float64
}

Touch contains parameters of a single touch of a touch event

type TouchEvent

type TouchEvent struct {
	// TimeStamp is the time at which the event was created (in milliseconds).
	// This value is time since epoch—but in reality, browsers' definitions vary.
	TimeStamp uint64

	// Touches is the array of all the Touch objects representing all current points
	// of contact with the surface, regardless of target or changed status.
	Touches []Touch

	// CtrlKey == true if the control key was down when the event was fired. false otherwise.
	CtrlKey bool
	// ShiftKey == true if the shift key was down when the event was fired. false otherwise.
	ShiftKey bool
	// AltKey == true if the alt key was down when the event was fired. false otherwise.
	AltKey bool
	// MetaKey == true if the meta key was down when the event was fired. false otherwise.
	MetaKey bool
}

TouchEvent contains parameters of a touch event

type TransformProperty added in v0.18.0

type TransformProperty interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

TransformProperty interface specifies view transformation parameters: the x-, y-, and z-axis translation values, the x-, y-, and z-axis scaling values, the angle to use to distort the element along the abscissa and ordinate, the angle of the view rotation.

Valid property tags: Perspective ("perspective"), TranslateX ("translate-x"), TranslateY ("translate-y"), TranslateZ ("translate-z"), ScaleX ("scale-x"), ScaleY ("scale-y"), ScaleZ ("scale-z"), Rotate ("rotate"), RotateX ("rotate-x"), RotateY ("rotate-y"), RotateZ ("rotate-z"), SkewX ("skew-x"), and SkewY ("skew-y")

func GetPushTransform added in v0.18.0

func GetPushTransform(view View, subviewID ...string) TransformProperty

GetPushTransform returns the start transform (translation, scale and rotation over x, y and z axes as well as a distortion) for an animated pushing of a child view. The default value is nil (no transform). If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func GetTransform added in v0.18.0

func GetTransform(view View, subviewID ...string) TransformProperty

GetTransform returns a view transform: translation, scale and rotation over x, y and z axes as well as a distortion of a view along x and y axes. The default value is nil (no transform) If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func NewTransformProperty added in v0.18.0

func NewTransformProperty(params Params) TransformProperty

NewTransform creates a new transform property data and return its interface

The following properties can be used:

Perspective ("perspective"), TranslateX ("translate-x"), TranslateY ("translate-y"), TranslateZ ("translate-z"), ScaleX ("scale-x"), ScaleY ("scale-y"), ScaleZ ("scale-z"), Rotate ("rotate"), RotateX ("rotate-x"), RotateY ("rotate-y"), RotateZ ("rotate-z"), SkewX ("skew-x"), and SkewY ("skew-y")

type VerticalTableJoin

type VerticalTableJoin struct {
}

NewTextTableAdapter is an auxiliary structure. It used as cell content and specifies that the cell should be merged with the one above it

type VideoPlayer

type VideoPlayer interface {
	MediaPlayer
}

VideoPlayer is a type of a View which can play video files

func NewVideoPlayer

func NewVideoPlayer(session Session, params Params) VideoPlayer

NewVideoPlayer create new MediaPlayer object and return it

func VideoPlayerByID

func VideoPlayerByID(rootView View, id string, ids ...string) VideoPlayer

VideoPlayerByID return the VideoPlayer path to which is specified using the arguments id, ids. Example

view := VideoPlayerByID(rootView, "id1", "id2", "id3")
view := VideoPlayerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not VideoPlayer, the function will return nil

type View

type View interface {
	ViewStyle
	fmt.Stringer

	// Session returns the current Session interface
	Session() Session

	// Parent returns the parent view
	Parent() View

	// Tag returns the tag of View interface
	Tag() string

	// ID returns the id of the view
	ID() string

	// Focusable returns true if the view receives the focus
	Focusable() bool

	// Frame returns the location and size of the view in pixels
	Frame() Frame

	// Scroll returns the location size of the scrollable view in pixels
	Scroll() Frame

	// SetParams sets properties with name "tag" of the "rootView" subview. Result:
	//   - true - all properties were set successful,
	//   - false - error (incompatible type or invalid format of a string value, see AppLog).
	SetParams(params Params) bool

	// SetAnimated sets the value (second argument) of the property with name defined by the first argument.
	// Return "true" if the value has been set, in the opposite case "false" are returned and
	// a description of the error is written to the log
	SetAnimated(tag PropertyName, value any, animation AnimationProperty) bool

	// SetChangeListener set the function to track the change of the View property
	SetChangeListener(tag PropertyName, listener func(View, PropertyName))

	// HasFocus returns 'true' if the view has focus
	HasFocus() bool
	// contains filtered or unexported methods
}

View represents a base view interface

func CreateViewFromObject

func CreateViewFromObject(session Session, object DataObject) View

CreateViewFromObject create new View and initialize it by Node data

func CreateViewFromResources

func CreateViewFromResources(session Session, name string) View

CreateViewFromResources create new View and initialize it by the content of the resource file from "views" directory

func CreateViewFromText

func CreateViewFromText(session Session, text string) View

CreateViewFromText create new View and initialize it by content of text

func GetDetailsSummary

func GetDetailsSummary(view View, subviewID ...string) View

GetDetailsSummary returns a value of the Summary property of DetailsView. If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.

func NewView

func NewView(session Session, params Params) View

NewView create new View object and return it

func RemoveView

func RemoveView(rootView View, containerID string, index int) View

Remove removes a view from the list of a view children and return it

func ViewByID

func ViewByID(rootView View, id string, ids ...string) View

ViewByID returns the child View path to which is specified using the arguments id, ids. Example

view := ViewByID(rootView, "id1", "id2", "id3")
view := ViewByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found, the function will return nil

type ViewBorder

type ViewBorder struct {
	// Style of the border line
	Style int

	// Color of the border line
	Color Color

	// Width of the border line
	Width SizeUnit
}

ViewBorder describes parameters of a view border

func GetColumnSeparator

func GetColumnSeparator(view View, subviewID ...string) ViewBorder

GetColumnSeparator returns ViewBorder struct which specifies the line drawn between columns in a multi-column ColumnLayout. If the second argument (subviewID) is not specified or it is "" then a top position of the first argument (view) is returned

type ViewBorders

type ViewBorders struct {
	Top, Right, Bottom, Left ViewBorder
}

ViewBorders describes the top, right, bottom, and left border of a view

func GetBorder

func GetBorder(view View, subviewID ...string) ViewBorders

GetBorder returns ViewBorders of the subview. If the second argument (subviewID) is not specified or it is "" then a ViewBorders of the first argument (view) is returned.

func (*ViewBorders) AllTheSame

func (border *ViewBorders) AllTheSame() bool

AllTheSame returns true if all borders are the same

type ViewOutline

type ViewOutline struct {
	// Style of the outline line
	Style int

	// Color of the outline line
	Color Color

	// Width of the outline line
	Width SizeUnit
}

ViewOutline describes parameters of a view border

func GetOutline

func GetOutline(view View, subviewID ...string) ViewOutline

GetOutline returns ViewOutline of the subview. If the second argument (subviewID) is not specified or it is "" then a ViewOutline of the first argument (view) is returned.

type ViewStyle

type ViewStyle interface {
	Properties

	// Transition returns the transition animation of the property. Returns nil is there is no transition animation.
	Transition(tag PropertyName) AnimationProperty

	// Transitions returns the map of transition animations. The result is always non-nil.
	Transitions() map[PropertyName]AnimationProperty

	// SetTransition sets the transition animation for the property if "animation" argument is not nil, and
	// removes the transition animation of the property if "animation" argument  is nil.
	// The "tag" argument is the property name.
	SetTransition(tag PropertyName, animation AnimationProperty)
	// contains filtered or unexported methods
}

ViewStyle interface of the style of view

func NewViewStyle

func NewViewStyle(params Params) ViewStyle

NewViewStyle create new ViewStyle object

type ViewsContainer

type ViewsContainer interface {
	View
	ParentView

	// Append appends a view to the end of the list of a view children
	Append(view View)

	// Insert inserts a view to the "index" position in the list of a view children
	Insert(view View, index int)

	// Remove removes a view from the list of a view children and return it
	RemoveView(index int) View

	// ViewIndex returns the index of view, -1 overwise
	ViewIndex(view View) int
	// contains filtered or unexported methods
}

ViewsContainer represent a mutable list-container of views

func ViewsContainerByID

func ViewsContainerByID(rootView View, id string, ids ...string) ViewsContainer

ViewsContainerByID return the ViewsContainer path to which is specified using the arguments id, ids. Example

view := ViewsContainerByID(rootView, "id1", "id2", "id3")
view := ViewsContainerByID(rootView, "id1/id2/id3")

These two function calls are equivalent. If a View with this path is not found or View is not ViewsContainer, the function will return nil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL