rui

package module
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 24 Imported by: 0

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
"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;
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 string) 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 ViewShadow 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 ViewShadow:

func NewViewShadow(offsetX, offsetY, blurRadius, spread-radius SizeUnit, color Color) ViewShadow
func NewInsetViewShadow(offsetX, offsetY, blurRadius, spread-radius SizeUnit, color Color) ViewShadow
func NewShadowWithParams(params Params) ViewShadow

The NewViewShadow function creates an outer shadow (Inset == false), NewInsetViewShadow - 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,
})

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

The ViewShadow 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 GetViewShadows(view View, subviewID ...string) []ViewShadow

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 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 ClipShape type specifies the crop area. There are 4 types of crop areas

inset

Rectangular cropping area. Created with the function:

func InsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShape

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 CircleClip(x, y, radius SizeUnit) ClipShape

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 EllipseClip(x, y, rx, ry SizeUnit) ClipShape

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 PolygonClip(points []any) ClipShape
func PolygonPointsClip(points []SizeUnit) ClipShape

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 ViewFilter interface is used as the value of the "filter" properties. ViewFilter is created using the function

func NewViewFilter(params Params) ViewFilter

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 []ViewShadow 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) ViewFilter
func GetBackdropFilter(view View, subviewID ...string) ViewFilter
"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

"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 ViewShadow 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 ViewShadow for the text shadow, the following functions are used:

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

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,
})

ViewShadow, ViewShadow array, ViewShadow 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) []ViewShadow

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

"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.

"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" property

The "cell-vertical-align" property (constant CellVerticalAlign) of type int sets the 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)

"cell-horizontal-align" property

The "cell-horizontal-align" property (constant CellHorizontalAlign) of type int 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)

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.

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

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

and the value of the "summary" property can be obtained using the function

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

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 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

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 "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 "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 "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

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
	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. Path is created using the NewPath () function.

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")
Animation interface

The Animation interface is used to set animation parameters. It extends the Properties interface. The interface is created using the function:

func NewAnimation(params Params) Animation

Some of the properties of the Animation 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.NewAnimation(rui.Params{
	rui.TimingFunction: rui.StepsTiming(10),
})

equivalent to

animation := rui.NewAnimation(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 Animation) 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.NewAnimation(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 Animation) 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 Animation interface. For example,

view.Set(rui.Transition, rui.Params{
	rui.Height: rui.NewAnimation(rui.Params{
		rui.Duration:       0.75,
		rui.TimingFunction: rui.EaseOutTiming,
	},
	rui.BackgroundColor: rui.NewAnimation(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 Animation) 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 Animation:

"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 Animation to the "animation" property (the AnimationTag 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 Animation and [] Animation, 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.NewAnimation(rui.Params{
	rui.PropertyTag:    []rui.AnimatedProperty{prop},
	rui.Duration:       2,
	rui.TimingFunction: LinearTiming,
})
rui.Set(view, "subview", rui.AnimationTag, 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 (
	// AnimationTag is the constant for the "animation" property tag.
	// The "animation" property sets and starts animations.
	// Valid types of value are []Animation and Animation
	AnimationTag = "animation"

	// AnimationPause is the constant for the "animation-pause" property tag.
	// The "animation-pause" property sets whether an animation is running or paused.
	AnimationPaused = "animation-paused"

	// TransitionTag is the constant for the "transition" property tag.
	// The "transition" property sets transition animation of view properties.
	// Valid type of "transition" property value is Params. Valid type of Params value is Animation.
	Transition = "transition"

	// PropertyTag is the constant for the "property" animation property tag.
	// The "property" property describes a scenario for changing a View property.
	// Valid types of value are []AnimatedProperty and AnimatedProperty
	PropertyTag = "property"

	// Duration is the constant for the "duration" animation property tag.
	// The "duration" float property sets the length of time in seconds that an animation takes to complete one cycle.
	Duration = "duration"

	// Delay is the constant for the "delay" animation property tag.
	// The "delay" float property 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.
	Delay = "delay"

	// TimingFunction is the constant for the "timing-function" animation property tag.
	// The "timing-function" property sets how an animation progresses through the duration of each cycle.
	TimingFunction = "timing-function"

	// IterationCount is the constant for the "iteration-count" animation property tag.
	// The "iteration-count" int property sets the number of times an animation sequence
	// should be played before stopping.
	IterationCount = "iteration-count"

	// AnimationDirection is the constant for the "animation-direction" animation property tag.
	//The "animation-direction" property sets whether an animation should play forward, backward,
	// or alternate back and forth between playing the sequence forward and backward.
	AnimationDirection = "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"
)
View Source
const (
	// TransitionRunEvent is the constant for "transition-run-event" property tag.
	// The "transition-run-event" is fired when a transition is first created,
	// i.e. before any transition delay has begun.
	TransitionRunEvent = "transition-run-event"

	// TransitionStartEvent is the constant for "transition-end-event" property tag.
	// The "transition-start-event" is fired when a transition has actually started,
	// i.e., after "delay" has ended.
	TransitionStartEvent = "transition-start-event"

	// TransitionEndEvent is the constant for "transition-end-event" property tag.
	// The "transition-end-event" is fired when a transition has completed.
	TransitionEndEvent = "transition-end-event"

	// TransitionCancelEvent is the constant for "transition-cancel-event" property tag.
	// The "transition-cancel-event" 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.
	TransitionCancelEvent = "transition-cancel-event"

	// AnimationStartEvent is the constant for "animation-start-event" property tag.
	// The "animation-start-event" is fired when an animation has started.
	// If there is an animation-delay, this event will fire once the delay period has expired.
	AnimationStartEvent = "animation-start-event"

	// AnimationEndEvent is the constant for "animation-end-event" property tag.
	// The "animation-end-event" is 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.
	AnimationEndEvent = "animation-end-event"

	// AnimationCancelEvent is the constant for "animation-cancel-event" property tag.
	// The "animation-cancel-event" is 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.
	AnimationCancelEvent = "animation-cancel-event"

	// AnimationIterationEvent is the constant for "animation-iteration-event" property tag.
	// The "animation-iteration-event" is 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.
	AnimationIterationEvent = "animation-iteration-event"
)
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

	// BorderBoxClip is value of the BackgroundClip property:
	// The background extends to the outside edge of the border (but underneath the border in z-ordering).
	BorderBoxClip = 0
	// PaddingBoxClip is value of the BackgroundClip property:
	// The background extends to the outside edge of the padding. No background is drawn beneath the border.
	PaddingBoxClip = 1
	// ContentBoxClip is value of the BackgroundClip property:
	// The background is painted within (clipped to) the content box.
	ContentBoxClip = 2
)
View Source
const (

	// ToTopGradient is value of the Direction property of a linear gradient. The value is equivalent to the 0deg angle
	ToTopGradient = 0
	// ToRightTopGradient is value of the Direction property of a linear gradient.
	ToRightTopGradient = 1
	// ToRightGradient is value of the Direction property of a linear gradient. The value is equivalent to the 90deg angle
	ToRightGradient = 2
	// ToRightBottomGradient is value of the Direction property of a linear gradient.
	ToRightBottomGradient = 3
	// ToBottomGradient is value of the Direction property of a linear gradient. The value is equivalent to the 180deg angle
	ToBottomGradient = 4
	// ToLeftBottomGradient is value of the Direction property of a linear gradient.
	ToLeftBottomGradient = 5
	// ToLeftGradient is value of the Direction property of a linear gradient. The value is equivalent to the 270deg angle
	ToLeftGradient = 6
	// ToLeftTopGradient is value of the Direction property of a linear gradient.
	ToLeftTopGradient = 7

	// 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 = 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 = 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 = 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 = 3
)
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.
	LeftStyle = "left-style"
	// RightStyle is the constant for "-right-style" property tag.
	RightStyle = "right-style"
	// TopStyle is the constant for "top-style" property tag.
	TopStyle = "top-style"
	// BottomStyle is the constant for "bottom-style" property tag.
	BottomStyle = "bottom-style"
	// LeftWidth is the constant for "left-width" property tag.
	LeftWidth = "left-width"
	// RightWidth is the constant for "-right-width" property tag.
	RightWidth = "right-width"
	// TopWidth is the constant for "top-width" property tag.
	TopWidth = "top-width"
	// BottomWidth is the constant for "bottom-width" property tag.
	BottomWidth = "bottom-width"
	// LeftColor is the constant for "left-color" property tag.
	LeftColor = "left-color"
	// RightColor is the constant for "-right-color" property tag.
	RightColor = "right-color"
	// TopColor is the constant for "top-color" property tag.
	TopColor = "top-color"
	// BottomColor is the constant for "bottom-color" property tag.
	BottomColor = "bottom-color"
)
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 = 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 = 1
	// BevelJoin - Fills an additional triangular area between the common endpoint
	// of connected segments, and the separate outside rectangular corners of each segment.
	BevelJoin = 2

	// ButtCap - the ends of lines are squared off at the endpoints. Default value.
	ButtCap = 0
	// RoundCap - the ends of lines are rounded.
	RoundCap = 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 = 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
)
View Source
const (
	ColorChangedEvent = "color-changed"
	ColorPickerValue  = "color-picker-value"
)
View Source
const (
	// ColumnCount is the constant for the "column-count" property tag.
	// The "column-count" int property specifies number of columns into which the content is break
	// Values less than zero are not valid. if the "column-count" property value is 0 then
	// the number of columns is calculated based on the "column-width" property
	ColumnCount = "column-count"

	// ColumnWidth is the constant for the "column-width" property tag.
	// The "column-width" SizeUnit property specifies the width of each column.
	ColumnWidth = "column-width"

	// ColumnGap is the constant for the "column-gap" property tag.
	// The "column-width" SizeUnit property sets the size of the gap (gutter) between columns.
	ColumnGap = "column-gap"

	// ColumnSeparator is the constant for the "column-separator" property tag.
	// The "column-separator" property specifies the line drawn between columns in a multi-column layout.
	ColumnSeparator = "column-separator"

	// ColumnSeparatorStyle is the constant for the "column-separator-style" property tag.
	// The "column-separator-style" int property sets 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).
	ColumnSeparatorStyle = "column-separator-style"

	// ColumnSeparatorWidth is the constant for the "column-separator-width" property tag.
	// The "column-separator-width" SizeUnit property sets the width of the line drawn between
	// columns in a multi-column layout.
	ColumnSeparatorWidth = "column-separator-width"

	// ColumnSeparatorColor is the constant for the "column-separator-color" property tag.
	// The "column-separator-color" Color property sets the color of the line drawn between
	// columns in a multi-column layout.
	ColumnSeparatorColor = "column-separator-color"

	// ColumnFill is the constant for the "column-fill" property tag.
	// The "column-fill" int property controls how an ColumnLayout's contents are balanced when broken into columns.
	// Valid values are
	// * ColumnFillBalance (0) - Content is equally divided between columns (default value);
	// * ColumnFillAuto (1) - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
	ColumnFill = "column-fill"

	// ColumnSpanAll is the constant for the "column-span-all" property tag.
	// The "column-span-all" bool property makes it possible for a view to span across all columns when its value is set to true.
	ColumnSpanAll = "column-span-all"
)
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
)
View Source
const (
	DateChangedEvent = "date-changed"
	DatePickerMin    = "date-picker-min"
	DatePickerMax    = "date-picker-max"
	DatePickerStep   = "date-picker-step"
	DatePickerValue  = "date-picker-value"
)
View Source
const (
	// Summary is the constant for the "summary" property tag.
	// The contents of the "summary" property are used as the label for the disclosure widget.
	Summary = "summary"
	// Expanded is the constant for the "expanded" property tag.
	// If the "expanded" boolean property is "true", then the content of view is visible.
	// If the value is "false" then the content is collapsed.
	Expanded = "expanded"
)
View Source
const (
	// EditTextChangedEvent is the constant for the "edit-text-changed" property tag.
	EditTextChangedEvent = "edit-text-changed"
	// EditViewType is the constant for the "edit-view-type" property tag.
	EditViewType = "edit-view-type"
	// EditViewPattern is the constant for the "edit-view-pattern" property tag.
	EditViewPattern = "edit-view-pattern"
	// Spellcheck is the constant for the "spellcheck" property tag.
	Spellcheck = "spellcheck"
)
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
)
View Source
const (
	// FileSelectedEvent is the constant for "file-selected-event" property tag.
	// The "file-selected-event" is fired when user selects file(s) in the FilePicker.
	FileSelectedEvent = "file-selected-event"
	// Accept is the constant for "accept" property tag.
	// The "accept" property of the FilePicker sets the list of allowed file extensions or MIME types.
	Accept = "accept"
	// Multiple is the constant for "multiple" property tag.
	// The "multiple" bool property of the FilePicker sets whether multiple files can be selected
	Multiple = "multiple"
)
View Source
const (
	// FocusEvent is the constant for "focus-event" property tag.
	// The "focus-event" event occurs when the View takes input focus.
	// The main listener format:
	//   func(View).
	// The additional listener format:
	//   func().
	FocusEvent = "focus-event"

	// LostFocusEvent is the constant for "lost-focus-event" property tag.
	// The "lost-focus-event" event occurs when the View lost input focus.
	// The main listener format:
	//   func(View).
	// The additional listener format:
	//   func().
	LostFocusEvent = "lost-focus-event"
)
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
)
View Source
const (
	// LoadedEvent is the constant for the "loaded-event" property tag.
	// The "loaded-event" event occurs event occurs when the image has been loaded.
	LoadedEvent = "loaded-event"
	// ErrorEvent is the constant for the "error-event" property tag.
	// The "error-event" event occurs event occurs when the image loading failed.
	ErrorEvent = "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
)
View Source
const (
	// KeyDown is the constant for "key-down-event" property tag.
	// The "key-down-event" event is fired when a key is pressed.
	// The main listener format:
	//   func(View, KeyEvent).
	// The additional listener formats:
	//   func(KeyEvent), func(View), and func().
	KeyDownEvent = "key-down-event"

	// KeyPp is the constant for "key-up-event" property tag.
	// The "key-up-event" event is fired when a key is released.
	// The main listener format:
	//   func(View, KeyEvent).
	// The additional listener formats:
	//   func(KeyEvent), func(View), and func().
	KeyUpEvent = "key-up-event"
)
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              KeyCode = "KeyA"
	KeyB              KeyCode = "KeyB"
	KeyC              KeyCode = "KeyC"
	KeyD              KeyCode = "KeyD"
	KeyE              KeyCode = "KeyE"
	KeyF              KeyCode = "KeyF"
	KeyG              KeyCode = "KeyG"
	KeyH              KeyCode = "KeyH"
	KeyI              KeyCode = "KeyI"
	KeyJ              KeyCode = "KeyJ"
	KeyK              KeyCode = "KeyK"
	KeyL              KeyCode = "KeyL"
	KeyM              KeyCode = "KeyM"
	KeyN              KeyCode = "KeyN"
	KeyO              KeyCode = "KeyO"
	KeyP              KeyCode = "KeyP"
	KeyQ              KeyCode = "KeyQ"
	KeyR              KeyCode = "KeyR"
	KeyS              KeyCode = "KeyS"
	KeyT              KeyCode = "KeyT"
	KeyU              KeyCode = "KeyU"
	KeyV              KeyCode = "KeyV"
	KeyW              KeyCode = "KeyW"
	KeyX              KeyCode = "KeyX"
	KeyY              KeyCode = "KeyY"
	KeyZ              KeyCode = "KeyZ"
	Digit0Key         KeyCode = "Digit0"
	Digit1Key         KeyCode = "Digit1"
	Digit2Key         KeyCode = "Digit2"
	Digit3Key         KeyCode = "Digit3"
	Digit4Key         KeyCode = "Digit4"
	Digit5Key         KeyCode = "Digit5"
	Digit6Key         KeyCode = "Digit6"
	Digit7Key         KeyCode = "Digit7"
	Digit8Key         KeyCode = "Digit8"
	Digit9Key         KeyCode = "Digit9"
	SpaceKey          KeyCode = "Space"
	MinusKey          KeyCode = "Minus"
	EqualKey          KeyCode = "Equal"
	IntlBackslashKey  KeyCode = "IntlBackslash"
	BracketLeftKey    KeyCode = "BracketLeft"
	BracketRightKey   KeyCode = "BracketRight"
	SemicolonKey      KeyCode = "Semicolon"
	CommaKey          KeyCode = "Comma"
	PeriodKey         KeyCode = "Period"
	QuoteKey          KeyCode = "Quote"
	BackquoteKey      KeyCode = "Backquote"
	SlashKey          KeyCode = "Slash"
	EscapeKey         KeyCode = "Escape"
	EnterKey          KeyCode = "Enter"
	TabKey            KeyCode = "Tab"
	CapsLockKey       KeyCode = "CapsLock"
	DeleteKey         KeyCode = "Delete"
	InsertKey         KeyCode = "Insert"
	HelpKey           KeyCode = "Help"
	BackspaceKey      KeyCode = "Backspace"
	PrintScreenKey    KeyCode = "PrintScreen"
	ScrollLockKey     KeyCode = "ScrollLock"
	PauseKey          KeyCode = "Pause"
	ContextMenuKey    KeyCode = "ContextMenu"
	ArrowLeftKey      KeyCode = "ArrowLeft"
	ArrowRightKey     KeyCode = "ArrowRight"
	ArrowUpKey        KeyCode = "ArrowUp"
	ArrowDownKey      KeyCode = "ArrowDown"
	HomeKey           KeyCode = "Home"
	EndKey            KeyCode = "End"
	PageUpKey         KeyCode = "PageUp"
	PageDownKey       KeyCode = "PageDown"
	F1Key             KeyCode = "F1"
	F2Key             KeyCode = "F2"
	F3Key             KeyCode = "F3"
	F4Key             KeyCode = "F4"
	F5Key             KeyCode = "F5"
	F6Key             KeyCode = "F6"
	F7Key             KeyCode = "F7"
	F8Key             KeyCode = "F8"
	F9Key             KeyCode = "F9"
	F10Key            KeyCode = "F10"
	F11Key            KeyCode = "F11"
	F12Key            KeyCode = "F12"
	F13Key            KeyCode = "F13"
	NumLockKey        KeyCode = "NumLock"
	NumpadKey0        KeyCode = "Numpad0"
	NumpadKey1        KeyCode = "Numpad1"
	NumpadKey2        KeyCode = "Numpad2"
	NumpadKey3        KeyCode = "Numpad3"
	NumpadKey4        KeyCode = "Numpad4"
	NumpadKey5        KeyCode = "Numpad5"
	NumpadKey6        KeyCode = "Numpad6"
	NumpadKey7        KeyCode = "Numpad7"
	NumpadKey8        KeyCode = "Numpad8"
	NumpadKey9        KeyCode = "Numpad9"
	NumpadDecimalKey  KeyCode = "NumpadDecimal"
	NumpadEnterKey    KeyCode = "NumpadEnter"
	NumpadAddKey      KeyCode = "NumpadAdd"
	NumpadSubtractKey KeyCode = "NumpadSubtract"
	NumpadMultiplyKey KeyCode = "NumpadMultiply"
	NumpadDivideKey   KeyCode = "NumpadDivide"
	ShiftLeftKey      KeyCode = "ShiftLeft"
	ShiftRightKey     KeyCode = "ShiftRight"
	ControlLeftKey    KeyCode = "ControlLeft"
	ControlRightKey   KeyCode = "ControlRight"
	AltLeftKey        KeyCode = "AltLeft"
	AltRightKey       KeyCode = "AltRight"
	MetaLeftKey       KeyCode = "MetaLeft"
	MetaRightKey      KeyCode = "MetaRight"
)
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
	// 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
)
View Source
const (
	// ListItemClickedEvent is the constant for "list-item-clicked" property tag.
	// The "list-item-clicked" event occurs when the user clicks on an item in the list.
	// The main listener format: func(ListView, int), where the second argument is the item index.
	ListItemClickedEvent = "list-item-clicked"
	// ListItemSelectedEvent is the constant for "list-item-selected" property tag.
	// The "list-item-selected" event occurs when a list item becomes selected.
	// The main listener format: func(ListView, int), where the second argument is the item index.
	ListItemSelectedEvent = "list-item-selected"
	// ListItemCheckedEvent is the constant for "list-item-checked" property tag.
	// The "list-item-checked" event occurs when a list item checkbox becomes checked/unchecked.
	// The main listener format: func(ListView, []int), where the second argument is the array of checked item indexes.
	ListItemCheckedEvent = "list-item-checked"
	// ListItemStyle is the constant for "list-item-style" property tag.
	// The "list-item-style" string property defines the style of an unselected item
	ListItemStyle = "list-item-style"
	// CurrentStyle is the constant for "current-style" property tag.
	// The "current-style" string property defines the style of the selected item when the ListView is focused.
	CurrentStyle = "current-style"
	// CurrentInactiveStyle is the constant for "current-inactive-style" property tag.
	// The "current-inactive-style" string property defines the style of the selected item when the ListView is unfocused.
	CurrentInactiveStyle = "current-inactive-style"
)
View Source
const (
	// VerticalOrientation is the vertical ListView orientation
	VerticalOrientation = 0
	// HorizontalOrientation is the horizontal ListView orientation
	HorizontalOrientation = 1

	// 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
)
View Source
const (
	// Controls is the constant for the "autoplay" controls tag.
	// If the "controls" bool property is "true", the browser will offer controls to allow the user
	// to control audio/video playback, including volume, seeking, and pause/resume playback.
	// Its default value is false.
	Controls = "controls"
	// Loop is the constant for the "loop" property tag.
	// If the "loop" bool property is "true", the audio/video player will automatically seek back
	// to the start upon reaching the end of the audio/video.
	// Its default value is false.
	Loop = "loop"
	// Muted is the constant for the "muted" property tag.
	// The "muted" bool property indicates whether the audio/video will be initially silenced.
	// Its default value is false.
	Muted = "muted"
	// Preload is the constant for the "preload" property tag.
	// The "preload" int property is intended to provide a hint to the browser about what
	// the author thinks will lead to the best user experience. It may have one of the following values:
	// PreloadNone (0), PreloadMetadata (1), and PreloadAuto (2)
	// The default value is different for each browser.
	Preload = "preload"

	// AbortEvent is the constant for the "abort-event" property tag.
	// The "abort-event" event fired when the resource was not fully loaded, but not as the result of an error.
	AbortEvent = "abort-event"
	// CanPlayEvent is the constant for the "can-play-event" property tag.
	// The "can-play-event" event occurs 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.
	CanPlayEvent = "can-play-event"
	// CanPlayThroughEvent is the constant for the "can-play-through-event" property tag.
	// The "can-play-through-event" event occurs when the browser estimates it can play the media up
	// to its end without stopping for content buffering.
	CanPlayThroughEvent = "can-play-through-event"
	// CompleteEvent is the constant for the "complete-event" property tag.
	// The "complete-event" event occurs when the rendering of an OfflineAudioContext is terminated.
	CompleteEvent = "complete-event"
	// DurationChangedEvent is the constant for the "duration-changed-event" property tag.
	// The "duration-changed-event" event occurs when the duration attribute has been updated.
	DurationChangedEvent = "duration-changed-event"
	// EmptiedEvent is the constant for the "emptied-event" property tag.
	// The "emptied-event" event occurs 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.
	EmptiedEvent = "emptied-event"
	// EndedEvent is the constant for the "ended-event" property tag.
	// The "ended-event" event occurs when the playback has stopped because the end of the media was reached.
	EndedEvent = "ended-event"
	// LoadedDataEvent is the constant for the "loaded-data-event" property tag.
	// The "loaded-data-event" event occurs when the first frame of the media has finished loading.
	LoadedDataEvent = "loaded-data-event"
	// LoadedMetadataEvent is the constant for the "loaded-metadata-event" property tag.
	// The "loaded-metadata-event" event occurs when the metadata has been loaded.
	LoadedMetadataEvent = "loaded-metadata-event"
	// LoadStartEvent is the constant for the "load-start-event" property tag.
	// The "load-start-event" event is fired when the browser has started to load a resource.
	LoadStartEvent = "load-start-event"
	// PauseEvent is the constant for the "pause-event" property tag.
	// The "pause-event" event occurs when the playback has been paused.
	PauseEvent = "pause-event"
	// PlayEvent is the constant for the "play-event" property tag.
	// The "play-event" event occurs when the playback has begun.
	PlayEvent = "play-event"
	// PlayingEvent is the constant for the "playing-event" property tag.
	// The "playing-event" event occurs when the playback is ready to start after having been paused or delayed due to lack of data.
	PlayingEvent = "playing-event"
	// ProgressEvent is the constant for the "progress-event" property tag.
	// The "progress-event" event is fired periodically as the browser loads a resource.
	ProgressEvent = "progress-event"
	// RateChangeEvent is the constant for the "rate-change-event" property tag.
	// The "rate-change-event" event occurs when the playback rate has changed.
	RateChangedEvent = "rate-changed-event"
	// SeekedEvent is the constant for the "seeked-event" property tag.
	// The "seeked-event" event occurs when a seek operation completed.
	SeekedEvent = "seeked-event"
	// SeekingEvent is the constant for the "seeking-event" property tag.
	// The "seeking-event" event occurs when a seek operation began.
	SeekingEvent = "seeking-event"
	// StalledEvent is the constant for the "stalled-event" property tag.
	// The "stalled-event" event occurs when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
	StalledEvent = "stalled-event"
	// SuspendEvent is the constant for the "suspend-event" property tag.
	// The "suspend-event" event occurs when the media data loading has been suspended.
	SuspendEvent = "suspend-event"
	// TimeUpdateEvent is the constant for the "time-update-event" property tag.
	// The "time-update-event" event occurs when the time indicated by the currentTime attribute has been updated.
	TimeUpdateEvent = "time-update-event"
	// VolumeChangedEvent is the constant for the "volume-change-event" property tag.
	// The "volume-change-event" event occurs when the volume has changed.
	VolumeChangedEvent = "volume-changed-event"
	// WaitingEvent is the constant for the "waiting-event" property tag.
	// The "waiting-event" event occurs when the playback has stopped because of a temporary lack of data
	WaitingEvent = "waiting-event"
	// PlayerErrorEvent is the constant for the "player-error-event" property tag.
	// The "player-error-event" event is fired when the resource could not be loaded due to an error
	// (for example, a network connectivity problem).
	PlayerErrorEvent = "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
)
View Source
const (
	// ClickEvent is the constant for "click-event" property tag.
	// The "click-event" event occurs when the user clicks on the View.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	ClickEvent = "click-event"

	// DoubleClickEvent is the constant for "double-click-event" property tag.
	// The "double-click-event" event occurs when the user double clicks on the View.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	DoubleClickEvent = "double-click-event"

	// MouseDown is the constant for "mouse-down" property tag.
	// The "mouse-down" event is fired at a View when a pointing device button is pressed
	// while the pointer is inside the view.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	MouseDown = "mouse-down"

	// MouseUp is the constant for "mouse-up" property tag.
	// The "mouse-up" event 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.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	MouseUp = "mouse-up"

	// MouseMove is the constant for "mouse-move" property tag.
	// The "mouse-move" event is fired at a view when a pointing device (usually a mouse) is moved
	// while the cursor's hotspot is inside it.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	MouseMove = "mouse-move"

	// MouseOut is the constant for "mouse-out" property tag.
	// The "mouse-out" event 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.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	MouseOut = "mouse-out"

	// MouseOver is the constant for "mouse-over" property tag.
	// The "mouse-over" event 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.
	// The main listener formats:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	MouseOver = "mouse-over"

	// ContextMenuEvent is the constant for "context-menu-event" property tag.
	// The "context-menu-event" event occurs when the user calls the context menu by the right mouse clicking.
	// The main listener format:
	//   func(View, MouseEvent).
	// The additional listener formats:
	//   func(MouseEvent), func(View), and func().
	ContextMenuEvent = "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
)
View Source
const (
	NumberChangedEvent = "number-changed"
	NumberPickerType   = "number-picker-type"
	NumberPickerMin    = "number-picker-min"
	NumberPickerMax    = "number-picker-max"
	NumberPickerStep   = "number-picker-step"
	NumberPickerValue  = "number-picker-value"
)
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
)
View Source
const (
	// PointerDown is the constant for "pointer-down" property tag.
	// The "pointer-down" event is 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.
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerDown = "pointer-down"

	// PointerUp is the constant for "pointer-up" property tag.
	// The "pointer-up" event is fired when a pointer is no longer active.
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerUp = "pointer-up"

	// PointerMove is the constant for "pointer-move" property tag.
	// The "pointer-move" event is fired when a pointer changes coordinates.
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerMove = "pointer-move"

	// PointerCancel is the constant for "pointer-cancel" property tag.
	// The "pointer-cancel" event is fired if the pointer will no longer be able to generate events
	// (for example the related device is deactivated).
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerCancel = "pointer-cancel"

	// PointerOut is the constant for "pointer-out" property tag.
	// The "pointer-out" event is fired for several reasons including: pointing device is moved out
	// of the hit test boundaries of an element; firing the pointerup event for a device
	// that does not support hover (see "pointer-up"); after firing the pointercancel event (see "pointer-cancel");
	// when a pen stylus leaves the hover range detectable by the digitizer.
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerOut = "pointer-out"

	// PointerOver is the constant for "pointer-over" property tag.
	// The "pointer-over" event is fired when a pointing device is moved into an view's hit test boundaries.
	// The main listener format: func(View, PointerEvent).
	// The additional listener formats: func(PointerEvent), func(View), and func().
	PointerOver = "pointer-over"
)
View Source
const (
	// Title is the constant for the "title" property tag.
	// The "title" property is defined the Popup/Tabs title
	Title = "title"

	// TitleStyle is the constant for the "title-style" property tag.
	// The "title-style" string property is used to set the title style of the Popup.
	TitleStyle = "title-style"

	// CloseButton is the constant for the "close-button" property tag.
	// The "close-button" bool property allow to add the close button to the Popup.
	// Setting this property to "true" adds a window close button to the title bar (the default value is "false").
	CloseButton = "close-button"

	// OutsideClose is the constant for the "outside-close" property tag.
	// The "outside-close" is a bool property. If it is set to "true",
	// then clicking outside the popup window automatically calls the Dismiss() method.
	OutsideClose = "outside-close"

	// Buttons is the constant for the "buttons" property tag.
	// Using the "buttons" property you can add buttons that will be placed at the bottom of the Popup.
	// The "buttons" property can be assigned the following data types: PopupButton and []PopupButton
	Buttons = "buttons"

	// ButtonsAlign is the constant for the "buttons-align" property tag.
	// The "buttons-align" int property is used for set the horizontal alignment of Popup buttons.
	// Valid values: LeftAlign (0), RightAlign (1), CenterAlign (2), and StretchAlign (3)
	ButtonsAlign = "buttons-align"

	// DismissEvent is the constant for the "dismiss-event" property tag.
	// The "dismiss-event" event 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)
	DismissEvent = "dismiss-event"

	// Arrow is the constant for the "arrow" property tag.
	// Using the "popup-arrow" int property you can add ...
	Arrow = "arrow"

	// ArrowAlign is the constant for the "arrow-align" property tag.
	// The "arrow-align" int property is used for set the horizontal alignment of the Popup arrow.
	// Valid values: LeftAlign (0), RightAlign (1), TopAlign (0), BottomAlign (1), CenterAlign (2)
	ArrowAlign = "arrow-align"

	// ArrowSize is the constant for the "arrow-size" property tag.
	// The "arrow-size" SizeUnit property is used for set the size (length) of the Popup arrow.
	ArrowSize = "arrow-size"

	// ArrowWidth is the constant for the "arrow-width" property tag.
	// The "arrow-width" SizeUnit property is used for set the width of the Popup arrow.
	ArrowWidth = "arrow-width"

	// ArrowOffset is the constant for the "arrow-offset" property tag.
	// The "arrow-offset" SizeUnit property is used for set the offset of the Popup arrow.
	ArrowOffset = "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

	// 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
)
View Source
const (
	ProgressBarMax   = "progress-max"
	ProgressBarValue = "progress-value"
)
View Source
const (
	// ID is the constant for the "id" property tag.
	// The "id" property is an optional textual identifier for the View.
	ID = "id"

	// Style is the constant for the "style" property tag.
	// The string "style" property 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.
	Style = "style"

	// StyleDisabled is the constant for the "style-disabled" property tag.
	// The string "style-disabled" property sets the name of the style that is applied to the View when the "disabled" property is set to true.
	StyleDisabled = "style-disabled"

	// Disabled is the constant for the "disabled" property tag.
	// The bool "disabled" property allows/denies the View to receive focus.
	Disabled = "disabled"

	// Focusable is the constant for the "disabled" property tag.
	// The bool "focusable" determines whether the view will receive focus.
	Focusable = "focusable"

	// Semantics is the constant for the "semantics" property tag.
	// The "semantics" property 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.
	Semantics = "semantics"

	// Visibility is the constant for the "visibility" property tag.
	// The "visibility" int property specifies the visibility of the View. Valid values are
	// * Visible (0) - the View is visible (default value);
	// * Invisible (1) - the View is invisible but takes up space;
	// * Gone (2) - the View is invisible and does not take up space.
	Visibility = "visibility"

	// ZIndex is the constant for the "z-index" property tag.
	// The int "z-index" property sets the z-order of a positioned view.
	// Overlapping views with a larger z-index cover those with a smaller one.
	ZIndex = "z-index"

	// Opacity is the constant for the "opacity" property tag.
	// The float "opacity" property in [1..0] range sets the opacity of an element.
	// Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency.
	Opacity = "opacity"

	// Overflow is the constant for the "overflow" property tag.
	// The "overflow" int property sets 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.
	// Valid values: OverflowHidden (0), OverflowVisible (1), OverflowScroll (2), OverflowAuto (3)
	Overflow = "overflow"

	// Row is the constant for the "row" property tag.
	Row = "row"

	// Column is the constant for the "column" property tag.
	Column = "column"

	// Left is the constant for the "left" property tag.
	// The "left" SizeUnit property participates in specifying the left border position of a positioned view.
	// Used only for views placed in an AbsoluteLayout.
	Left = "left"

	// Right is the constant for the "right" property tag.
	// The "right" SizeUnit property participates in specifying the right border position of a positioned view.
	// Used only for views placed in an AbsoluteLayout.
	Right = "right"

	// Top is the constant for the "top" property tag.
	// The "top" SizeUnit property participates in specifying the top border position of a positioned view.
	// Used only for views placed in an AbsoluteLayout.
	Top = "top"

	// Bottom is the constant for the "bottom" property tag.
	// The "bottom" SizeUnit property participates in specifying the bottom border position of a positioned view.
	// Used only for views placed in an AbsoluteLayout.
	Bottom = "bottom"

	// Width is the constant for the "width" property tag.
	// The "width" SizeUnit property sets an view's width.
	Width = "width"

	// Height is the constant for the "height" property tag.
	// The "height" SizeUnit property sets an view's height.
	Height = "height"

	// MinWidth is the constant for the "min-width" property tag.
	// The "width" SizeUnit property sets an view's minimal width.
	MinWidth = "min-width"

	// MinHeight is the constant for the "min-height" property tag.
	// The "height" SizeUnit property sets an view's minimal height.
	MinHeight = "min-height"

	// MaxWidth is the constant for the "max-width" property tag.
	// The "width" SizeUnit property sets an view's maximal width.
	MaxWidth = "max-width"

	// MaxHeight is the constant for the "max-height" property tag.
	// The "height" SizeUnit property sets an view's maximal height.
	MaxHeight = "max-height"

	// Margin is the constant for the "margin" property tag.
	// The "margin" property sets the margin area on all four sides of an element.
	// ...
	Margin = "margin"

	// MarginLeft is the constant for the "margin-left" property tag.
	// The "margin-left" SizeUnit property sets 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.
	MarginLeft = "margin-left"

	// MarginRight is the constant for the "margin-right" property tag.
	// The "margin-right" SizeUnit property sets 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.
	MarginRight = "margin-right"

	// MarginTop is the constant for the "margin-top" property tag.
	// The "margin-top" SizeUnit property sets 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.
	MarginTop = "margin-top"

	// MarginBottom is the constant for the "margin-bottom" property tag.
	// The "margin-bottom" SizeUnit property sets 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.
	MarginBottom = "margin-bottom"

	// Padding is the constant for the "padding" property tag.
	// The "padding" Bounds property 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.
	Padding = "padding"

	// PaddingLeft is the constant for the "padding-left" property tag.
	// The "padding-left" SizeUnit property sets the width of the padding area to the left of a view.
	PaddingLeft = "padding-left"

	// PaddingRight is the constant for the "padding-right" property tag.
	// The "padding-right" SizeUnit property sets the width of the padding area to the right of a view.
	PaddingRight = "padding-right"

	// PaddingTop is the constant for the "padding-top" property tag.
	// The "padding-top" SizeUnit property sets the height of the padding area to the top of a view.
	PaddingTop = "padding-top"

	// PaddingBottom is the constant for the "padding-bottom" property tag.
	// The "padding-bottom" SizeUnit property sets the height of the padding area to the bottom of a view.
	PaddingBottom = "padding-bottom"

	// AccentColor is the constant for the "accent-color" property tag.
	// The "accent-color" property sets sets the accent color for UI controls generated by some elements.
	AccentColor = "accent-color"

	// BackgroundColor is the constant for the "background-color" property tag.
	// The "background-color" property sets the background color of a view.
	BackgroundColor = "background-color"

	// Background is the constant for the "background" property tag.
	// The "background" property sets one or more background images and/or gradients on a view.
	// ...
	Background = "background"

	// Cursor is the constant for the "cursor" property tag.
	// The "cursor" int property sets the type of mouse cursor, if any, to show when the mouse pointer is over a view
	// Valid values are "auto" (0), "default" (1), "none" (2), "context-menu" (3), "help" (4), "pointer" (5),
	// "progress" (6), "wait" (7), "cell" (8), "crosshair" (9), "text" (10), "vertical-text" (11), "alias" (12),
	// "copy" (13), "move" (14), "no-drop" (15), "not-allowed" (16), "e-resize" (17), "n-resize" (18),
	// "ne-resize" (19), "nw-resize" (20), "s-resize" (21), "se-resize" (22), "sw-resize" (23), "w-resize" (24),
	// "ew-resize" (25), "ns-resize" (26), "nesw-resize" (27), "nwse-resize" (28), "col-resize" (29),
	// "row-resize" (30), "all-scroll" (31), "zoom-in" (32), "zoom-out" (33), "grab" (34), "grabbing" (35).
	Cursor = "cursor"

	// Border is the constant for the "border" property tag.
	// The "border" property sets a view's border. It sets the values of a border width, style, and color.
	// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
	Border = "border"

	// BorderLeft is the constant for the "border-left" property tag.
	// The "border-left" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	BorderLeft = "border-left"

	// BorderRight is the constant for the "border-right" property tag.
	// The "border-right" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	BorderRight = "border-right"

	// BorderTop is the constant for the "border-top" property tag.
	// The "border-top" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	BorderTop = "border-top"

	// BorderBottom is the constant for the "border-bottom" property tag.
	// The "border-bottom" property sets a view's bottom border. It sets the values of a border width, style, and color.
	// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
	BorderBottom = "border-bottom"

	// BorderStyle is the constant for the "border-style" property tag.
	// The "border-style" property sets the line style for all four sides of a view's border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	BorderStyle = "border-style"

	// BorderLeftStyle is the constant for the "border-left-style" property tag.
	// The "border-left-style" int property sets the line style of a view's left border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	BorderLeftStyle = "border-left-style"

	// BorderRightStyle is the constant for the "border-right-style" property tag.
	// The "border-right-style" int property sets the line style of a view's right border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	BorderRightStyle = "border-right-style"

	// BorderTopStyle is the constant for the "border-top-style" property tag.
	// The "border-top-style" int property sets the line style of a view's top border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	BorderTopStyle = "border-top-style"

	// BorderBottomStyle is the constant for the "border-bottom-style" property tag.
	// The "border-bottom-style" int property sets the line style of a view's bottom border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	BorderBottomStyle = "border-bottom-style"

	// BorderWidth is the constant for the "border-width" property tag.
	// The "border-width" property sets the line width for all four sides of a view's border.
	BorderWidth = "border-width"

	// BorderLeftWidth is the constant for the "border-left-width" property tag.
	// The "border-left-width" SizeUnit property sets the line width of a view's left border.
	BorderLeftWidth = "border-left-width"

	// BorderRightWidth is the constant for the "border-right-width" property tag.
	// The "border-right-width" SizeUnit property sets the line width of a view's right border.
	BorderRightWidth = "border-right-width"

	// BorderTopWidth is the constant for the "border-top-width" property tag.
	// The "border-top-width" SizeUnit property sets the line width of a view's top border.
	BorderTopWidth = "border-top-width"

	// BorderBottomWidth is the constant for the "border-bottom-width" property tag.
	// The "border-bottom-width" SizeUnit property sets the line width of a view's bottom border.
	BorderBottomWidth = "border-bottom-width"

	// BorderColor is the constant for the "border-color" property tag.
	// The "border-color" property sets the line color for all four sides of a view's border.
	BorderColor = "border-color"

	// BorderLeftColor is the constant for the "border-left-color" property tag.
	// The "border-left-color" property sets the line color of a view's left border.
	BorderLeftColor = "border-left-color"

	// BorderRightColor is the constant for the "border-right-color" property tag.
	// The "border-right-color" property sets the line color of a view's right border.
	BorderRightColor = "border-right-color"

	// BorderTopColor is the constant for the "border-top-color" property tag.
	// The "border-top-color" property sets the line color of a view's top border.
	BorderTopColor = "border-top-color"

	// BorderBottomColor is the constant for the "border-bottom-color" property tag.
	// The "border-bottom-color" property sets the line color of a view's bottom border.
	BorderBottomColor = "border-bottom-color"

	// Outline is the constant for the "outline" property tag.
	// The "border" property sets a view's outline. It sets the values of an outline width, style, and color.
	Outline = "outline"

	// OutlineStyle is the constant for the "outline-style" property tag.
	// The "outline-style" int property sets the style of an view's outline.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	OutlineStyle = "outline-style"

	// OutlineColor is the constant for the "outline-color" property tag.
	// The "outline-color" property sets the color of an view's outline.
	OutlineColor = "outline-color"

	// OutlineWidth is the constant for the "outline-width" property tag.
	// The "outline-width" SizeUnit property sets the width of an view's outline.
	OutlineWidth = "outline-width"

	// OutlineWidth is the constant for the "outline-offset" property tag.
	// The "outline-offset" SizeUnit property sets the amount of space between an outline and the edge or border of an element..
	OutlineOffset = "outline-offset"

	// Shadow is the constant for the "shadow" property tag.
	// The "shadow" property adds shadow effects around a view's frame. A shadow is described
	// by X and Y offsets relative to the element, blur and spread radius, and color.
	// ...
	Shadow = "shadow"

	// FontName is the constant for the "font-name" property tag.
	// The "font-name" string property specifies a prioritized list of one or more font family names and/or
	// generic family names for the selected 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.
	FontName = "font-name"

	// TextColor is the constant for the "text-color" property tag.
	// The "color" property sets 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.
	TextColor = "text-color"

	// TextSize is the constant for the "text-size" property tag.
	// The "text-size" SizeUnit property sets 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.
	TextSize = "text-size"

	// Italic is the constant for the "italic" property tag.
	// The "italic" is the bool property. If it is "true" then a 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.
	Italic = "italic"

	// SmallCaps is the constant for the "small-caps" property tag.
	// The "small-caps" is the bool property. If it is "true" then a text is displayed in small caps.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	SmallCaps = "small-caps"

	// Strikethrough is the constant for the "strikethrough" property tag.
	// The "strikethrough" is the bool property. If it is "true" then a text is displayed strikethrough.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	Strikethrough = "strikethrough"

	// Overline is the constant for the "overline" property tag.
	// The "overline" is the bool property. If it is "true" then a text is displayed overlined.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	Overline = "overline"

	// Underline is the constant for the "underline" property tag.
	// The "underline" is the bool property. If it is "true" then a text is displayed underlined.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	Underline = "underline"

	// TextLineThickness is the constant for the "text-line-thickness" property tag.
	// The "text-line-thickness" SizeUnit property sets the stroke thickness of the decoration line that
	// is used on text in an element, such as a line-through, underline, or overline.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextLineThickness = "text-line-thickness"

	// TextLineStyle is the constant for the "text-line-style" property tag.
	// The "text-line-style" int property sets the style of the lines specified by "text-decoration" property.
	// The style applies to all lines that are set with "text-decoration" property.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextLineStyle = "text-line-style"

	// TextLineColor is the constant for the "text-line-color" property tag.
	// The "text-line-color" Color property sets the color of the lines specified by "text-decoration" property.
	// The color applies to all lines that are set with "text-decoration" property.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextLineColor = "text-line-color"

	// TextWeight is the constant for the "text-weight" property tag.
	// Valid values are SolidLine (1), DashedLine (2), DottedLine (3), DoubleLine (4) and WavyLine (5).
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextWeight = "text-weight"

	// TextAlign is the constant for the "text-align" property tag.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextAlign = "text-align"

	// TextIndent is the constant for the "text-indent" property tag.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextIndent = "text-indent"

	// TextShadow is the constant for the "text-shadow" property tag.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextShadow = "text-shadow"

	// TabSize is the constant for the "tab-size" property tag.
	// The "tab-size" int property sets 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.
	TabSize = "tab-size"

	// LetterSpacing is the constant for the "letter-spacing" property tag.
	// The "letter-spacing" SizeUnit property sets 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.
	LetterSpacing = "letter-spacing"

	// WordSpacing is the constant for the "word-spacing" property tag.
	// The "word-spacing" SizeUnit property sets 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.
	WordSpacing = "word-spacing"

	// LineHeight is the constant for the "line-height" property tag.
	// The "line-height" SizeUnit property sets 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.
	LineHeight = "line-height"

	// WhiteSpace is the constant for the "white-space" property tag.
	// The "white-space" int property sets how white space inside an element is handled.
	// Valid values are WhiteSpaceNormal (0),  WhiteSpaceNowrap (1), WhiteSpacePre (2),
	// WhiteSpacePreWrap (3), WhiteSpacePreLine (4), WhiteSpaceBreakSpaces (5)
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	WhiteSpace = "white-space"

	// WordBreak is the constant for the "word-break" property tag.
	// The "word-break" int property sets 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.
	WordBreak = "word-break"

	// TextTransform is the constant for the "text-transform" property tag.
	// The "text-transform" int property 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.
	TextTransform = "text-transform"

	// TextDirection is the constant for the "text-direction" property tag.
	// The "text-direction" int property sets the direction of text, table columns, and horizontal overflow.
	// Use 1 (LeftToRightDirection) for languages written from right to left (like Hebrew or Arabic),
	// and 2 (RightToLeftDirection) for those written from left to right (like English and most other languages).
	// The default value of the property is 0 (SystemTextDirection): use the system text direction.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	TextDirection = "text-direction"

	// WritingMode is the constant for the "writing-mode" property tag.
	// The "writing-mode" int property sets 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.
	WritingMode = "writing-mode"

	// VerticalTextOrientation is the constant for the "vertical-text-orientation" property tag.
	// The "vertical-text-orientation" int property sets 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.
	VerticalTextOrientation = "vertical-text-orientation"

	// TextOverflow is the constant for the "text-overflow" property tag.
	// The "text-overflow" int property sets how hidden overflow content is signaled to users.
	// It can be clipped or display an ellipsis ('…'). Valid values are
	TextOverflow = "text-overflow"

	// Hint is the constant for the "hint" property tag.
	// The "hint" string property sets a hint to the user of what can be entered in the control.
	Hint = "hint"

	// MaxLength is the constant for the "max-length" property tag.
	// The "max-length" int property sets the maximum number of characters that the user can enter
	MaxLength = "max-length"

	// ReadOnly is the constant for the "readonly" property tag.
	// This bool property indicates that the user cannot modify the value of the EditView.
	ReadOnly = "readonly"

	// Content is the constant for the "content" property tag.
	Content = "content"

	// Items is the constant for the "items" property tag.
	Items = "items"

	// DisabledItems is the constant for the "disabled-items" property tag.
	DisabledItems = "disabled-items"

	// Current is the constant for the "current" property tag.
	Current = "current"

	// Type is the constant for the "type" property tag.
	Type = "type"

	// Pattern is the constant for the "pattern" property tag.
	Pattern = "pattern"

	// GridAutoFlow is the constant for the "grid-auto-flow" property tag.
	// The "grid-auto-flow" int property controls how the GridLayout auto-placement algorithm works,
	// specifying exactly how auto-placed items get flowed into the grid.
	// Valid values are RowAutoFlow (0), ColumnAutoFlow (1), RowDenseAutoFlow (2), and ColumnDenseAutoFlow (3)
	GridAutoFlow = "grid-auto-flow"

	// CellWidth is the constant for the "cell-width" property tag.
	// The "cell-width" properties allow to set a fixed width of GridLayout 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.
	CellWidth = "cell-width"

	// CellHeight is the constant for the "cell-height" property tag.
	// The "cell-height" properties allow to set a fixed height of GridLayout 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 row.
	CellHeight = "cell-height"

	// GridRowGap is the constant for the "grid-row-gap" property tag.
	// The "grid-row-gap" SizeUnit properties allow to set the distance between the rows of the GridLayout container.
	// The default is 0px.
	GridRowGap = "grid-row-gap"

	// GridColumnGap is the constant for the "grid-column-gap" property tag.
	// The "grid-column-gap" SizeUnit properties allow to set the distance between the columns of the GridLayout container.
	// The default is 0px.
	GridColumnGap = "grid-column-gap"

	// Source is the constant for the "src" property tag.
	// The "src" property specifies the image to display in the ImageView.
	Source = "src"

	// SrcSet is the constant for the "srcset" property tag.
	// The "srcset" property is a string which identifies one or more image candidate strings, separated using commas (,)
	// each specifying image resources to use under given screen density.
	// This property is only used if you are building an application for js/wasm platform
	SrcSet = "srcset"

	// Fit is the constant for the "fit" property tag.
	Fit = "fit"

	// Repeat is the constant for the "repeat" property tag.
	Repeat = "repeat"

	// Attachment is the constant for the "attachment" property tag.
	Attachment = "attachment"

	// BackgroundClip is the constant for the "background-clip" property tag.
	BackgroundClip = "background-clip"

	// Gradient is the constant for the "gradient" property tag.
	Gradient = "gradient"

	// Direction is the constant for the "direction" property tag.
	Direction = "direction"

	// Repeating is the constant for the "repeating" property tag.
	Repeating = "repeating"

	// Repeating is the constant for the "repeating" property tag.
	From = "from"

	// RadialGradientRadius is the constant for the "radial-gradient-radius" property tag.
	RadialGradientRadius = "radial-gradient-radius"

	// RadialGradientShape is the constant for the "radial-gradient-shape" property tag.
	RadialGradientShape = "radial-gradient-shape"

	// Shape is the constant for the "shape" property tag. It's a short form of "radial-gradient-shape"
	Shape = "shape"

	// CenterX is the constant for the "center-x" property tag.
	CenterX = "center-x"

	// CenterY is the constant for the "center-x" property tag.
	CenterY = "center-y"

	// AltText is the constant for the "alt-text" property tag.
	AltText = "alt-text"

	// AvoidBreak is the constant for the "avoid-break" property tag.
	// The "avoid-break" bool property sets how region breaks should behave inside a generated box.
	// If the property value is "true" then avoids any break from being inserted within the principal box.
	// If the property value is "false" then allows, but does not force, any break to be inserted within
	// the principal box.
	AvoidBreak = "avoid-break"

	// ItemWidth is the constant for the "item-width" property tag.
	ItemWidth = "item-width"

	// ItemHeight is the constant for the "item-height" property tag.
	ItemHeight = "item-height"

	// ListWrap is the constant for the "wrap" property tag.
	ListWrap = "list-wrap"

	// EditWrap is the constant for the "wrap" property tag.
	EditWrap = "edit-wrap"

	// CaretColor is the constant for the "caret-color" property tag.
	// The "caret-color" Color property 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.
	CaretColor = "caret-color"

	// Min is the constant for the "min" property tag.
	Min = "min"

	// Max is the constant for the "max" property tag.
	Max = "max"

	// Step is the constant for the "step" property tag.
	Step = "step"

	// Value is the constant for the "value" property tag.
	Value = "value"

	// Orientation is the constant for the "orientation" property tag.
	Orientation = "orientation"

	// Gap is t he constant for the "gap" property tag.
	Gap = "gap"

	// ListRowGap is the constant for the "list-row-gap" property tag.
	// The "list-row-gap" SizeUnit properties allow to set the distance between the rows of the ListLayout or ListView.
	// The default is 0px.
	ListRowGap = "list-row-gap"

	// ListColumnGap is the constant for the "list-column-gap" property tag.
	// The "list-column-gap" SizeUnit properties allow to set the distance between the columns of the GridLayout or ListView.
	// The default is 0px.
	ListColumnGap = "list-column-gap"

	// Text is the constant for the "text" property tag.
	Text = "text"

	// VerticalAlign is the constant for the "vertical-align" property tag.
	VerticalAlign = "vertical-align"

	// HorizontalAlign is the constant for the "horizontal-align" property tag.
	// The "horizontal-align" int property sets the horizontal alignment of the content inside a block element
	HorizontalAlign = "horizontal-align"

	// ImageVerticalAlign is the constant for the "image-vertical-align" property tag.
	ImageVerticalAlign = "image-vertical-align"

	// ImageHorizontalAlign is the constant for the "image-horizontal-align" property tag.
	ImageHorizontalAlign = "image-horizontal-align"

	// Checked is the constant for the "checked" property tag.
	Checked = "checked"

	// ItemVerticalAlign is the constant for the "item-vertical-align" property tag.
	ItemVerticalAlign = "item-vertical-align"

	// ItemHorizontalAlign is the constant for the "item-horizontal-align" property tag.
	ItemHorizontalAlign = "item-horizontal-align"

	// ItemCheckbox is the constant for the "checkbox" property tag.
	ItemCheckbox = "checkbox"

	// CheckboxHorizontalAlign is the constant for the "checkbox-horizontal-align" property tag.
	CheckboxHorizontalAlign = "checkbox-horizontal-align"

	// CheckboxVerticalAlign is the constant for the "checkbox-vertical-align" property tag.
	CheckboxVerticalAlign = "checkbox-vertical-align"

	// NotTranslate is the constant for the "not-translate" property tag.
	// This bool property indicates that no need to translate the text.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	NotTranslate = "not-translate"

	// Filter is the constant for the "filter" property tag.
	// The "filter" property applies graphical effects to a View,
	// such as such as blurring, color shifting, changing brightness/contrast, etc.
	Filter = "filter"

	// BackdropFilter is the constant for the "backdrop-filter" property tag.
	// The "backdrop-filter" property applies graphical effects to the area behind a View,
	// such as such as blurring, color shifting, changing brightness/contrast, etc.
	BackdropFilter = "backdrop-filter"

	// Clip is the constant for the "clip" property tag.
	// The "clip" property creates a clipping region that sets what part of a View should be shown.
	Clip = "clip"

	// Points is the constant for the "points" property tag.
	Points = "points"

	// ShapeOutside is the constant for the "shape-outside" property tag.
	// The "shape-outside" 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;
	// "shape-outside" provides a way to customize this wrapping, making it possible to wrap text around
	// complex objects rather than simple boxes.
	ShapeOutside = "shape-outside"

	// Float is the constant for the "float" property tag.
	// The "float" property places a View on the left or right side of its container,
	// allowing text and inline Views to wrap around it.
	Float = "float"

	// UserData is the constant for the "user-data" property tag.
	// The "user-data" property can contain any user data
	UserData = "user-data"

	// Resize is the constant for the "resize" property tag.
	// The "resize" int property sets whether an element is resizable, and if so, in which directions.
	// Valid values are "none" (0), "both" (1), horizontal (2), and "vertical" (3)
	Resize = "resize"

	// UserSelect is the constant for the "user-select" property tag.
	// The "user-select" bool property controls whether the user can select text.
	// This is an inherited property, i.e. if it is not defined, then the value of the parent view is used.
	UserSelect = "user-select"

	// Order is the constant for the "Order" property tag.
	// The "Order" int property sets the order to layout an item in a ListLayout or GridLayout container.
	// Items in a container are sorted by ascending order value and then by their source code order.
	Order = "Order"

	// BackgroundBlendMode is the constant for the "background-blend-mode" property tag.
	// The "background-blend-mode" int property sets how an view's background images should blend
	// with each other and with the view's background color.
	// Valid values are "normal" (0), "multiply" (1), "screen" (2), "overlay" (3), "darken" (4), "lighten" (5),
	// "color-dodge" (6), "color-burn" (7), "hard-light" (8), "soft-light" (9), "difference" (10),
	// "exclusion" (11), "hue" (12), "saturation" (13), "color" (14), "luminosity" (15).
	BackgroundBlendMode = "background-blend-mode"

	// MixBlendMode is the constant for the "mix-blend-mode" property tag.
	// The "mix-blend-mode" int property sets how a view's content should blend
	// with the content of the view's parent and the view's background.
	// Valid values are "normal" (0), "multiply" (1), "screen" (2), "overlay" (3), "darken" (4), "lighten" (5),
	// "color-dodge" (6), "color-burn" (7), "hard-light" (8), "soft-light" (9), "difference" (10),
	// "exclusion" (11), "hue" (12), "saturation" (13), "color" (14), "luminosity" (15).
	MixBlendMode = "mix-blend-mode"

	// TabIndex is the constant for the "tabindex" property tag.
	// The "tabindex" int property indicates that View can be focused, and where it participates in sequential keyboard navigation
	// (usually with the Tab key, hence the name).
	// * A negative value means that View is not reachable via sequential keyboard navigation, but could be focused by clicking with the mouse or touching.
	// * tabindex="0" means that View should be focusable in sequential keyboard navigation, after any positive tabindex values and its order is defined in order of its addition.
	// * A positive value means View should be focusable in sequential keyboard navigation, with its order defined by the value of the number.
	TabIndex = "tabindex"

	Tooltip = "tooltip"
)
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
)
View Source
const (
	// Radius is the SizeUnit view property that determines the corners rounding radius
	// of an element's outer border edge.
	Radius = "radius"
	// RadiusX is the SizeUnit view property that determines the x-axis corners elliptic rounding
	// radius of an element's outer border edge.
	RadiusX = "radius-x"
	// RadiusY is the SizeUnit view property that determines the y-axis corners elliptic rounding
	// radius of an element's outer border edge.
	RadiusY = "radius-y"
	// RadiusTopLeft is the SizeUnit view property that determines the top-left corner rounding radius
	// of an element's outer border edge.
	RadiusTopLeft = "radius-top-left"
	// RadiusTopLeftX is the SizeUnit view property that determines the x-axis top-left corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusTopLeftX = "radius-top-left-x"
	// RadiusTopLeftY is the SizeUnit view property that determines the y-axis top-left corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusTopLeftY = "radius-top-left-y"
	// RadiusTopRight is the SizeUnit view property that determines the top-right corner rounding radius
	// of an element's outer border edge.
	RadiusTopRight = "radius-top-right"
	// RadiusTopRightX is the SizeUnit view property that determines the x-axis top-right corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusTopRightX = "radius-top-right-x"
	// RadiusTopRightY is the SizeUnit view property that determines the y-axis top-right corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusTopRightY = "radius-top-right-y"
	// RadiusBottomLeft is the SizeUnit view property that determines the bottom-left corner rounding radius
	// of an element's outer border edge.
	RadiusBottomLeft = "radius-bottom-left"
	// RadiusBottomLeftX is the SizeUnit view property that determines the x-axis bottom-left corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusBottomLeftX = "radius-bottom-left-x"
	// RadiusBottomLeftY is the SizeUnit view property that determines the y-axis bottom-left corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusBottomLeftY = "radius-bottom-left-y"
	// RadiusBottomRight is the SizeUnit view property that determines the bottom-right corner rounding radius
	// of an element's outer border edge.
	RadiusBottomRight = "radius-bottom-right"
	// RadiusBottomRightX is the SizeUnit view property that determines the x-axis bottom-right corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusBottomRightX = "radius-bottom-right-x"
	// RadiusBottomRightY is the SizeUnit view property that determines the y-axis bottom-right corner elliptic
	// rounding radius of an element's outer border edge.
	RadiusBottomRightY = "radius-bottom-right-y"
	// X is the SizeUnit property of the ShadowProperty that determines the x-axis corners elliptic rounding
	// radius of an element's outer border edge.
	X = "x"
	// Y is the SizeUnit property of the ShadowProperty that determines the y-axis corners elliptic rounding
	// radius of an element's outer border edge.
	Y = "y"
	// TopLeft is the SizeUnit property of the ShadowProperty that determines the top-left corner rounding radius
	// of an element's outer border edge.
	TopLeft = "top-left"
	// TopLeftX is the SizeUnit property of the ShadowProperty that determines the x-axis top-left corner elliptic
	// rounding radius of an element's outer border edge.
	TopLeftX = "top-left-x"
	// TopLeftY is the SizeUnit property of the ShadowProperty that determines the y-axis top-left corner elliptic
	// rounding radius of an element's outer border edge.
	TopLeftY = "top-left-y"
	// TopRight is the SizeUnit property of the ShadowProperty that determines the top-right corner rounding radius
	// of an element's outer border edge.
	TopRight = "top-right"
	// TopRightX is the SizeUnit property of the ShadowProperty that determines the x-axis top-right corner elliptic
	// rounding radius of an element's outer border edge.
	TopRightX = "top-right-x"
	// TopRightY is the SizeUnit property of the ShadowProperty that determines the y-axis top-right corner elliptic
	// rounding radius of an element's outer border edge.
	TopRightY = "top-right-y"
	// BottomLeft is the SizeUnit property of the ShadowProperty that determines the bottom-left corner rounding radius
	// of an element's outer border edge.
	BottomLeft = "bottom-left"
	// BottomLeftX is the SizeUnit property of the ShadowProperty that determines the x-axis bottom-left corner elliptic
	// rounding radius of an element's outer border edge.
	BottomLeftX = "bottom-left-x"
	// BottomLeftY is the SizeUnit property of the ShadowProperty that determines the y-axis bottom-left corner elliptic
	// rounding radius of an element's outer border edge.
	BottomLeftY = "bottom-left-y"
	// BottomRight is the SizeUnit property of the ShadowProperty that determines the bottom-right corner rounding radius
	// of an element's outer border edge.
	BottomRight = "bottom-right"
	// BottomRightX is the SizeUnit property of the ShadowProperty that determines the x-axis bottom-right corner elliptic
	// rounding radius of an element's outer border edge.
	BottomRightX = "bottom-right-x"
	// BottomRightY is the SizeUnit property of the ShadowProperty that determines the y-axis bottom-right corner elliptic
	// rounding radius of an element's outer border edge.
	BottomRightY = "bottom-right-y"
)
View Source
const (
	// Side is the constant for the "side" property tag.
	// The "side" int property determines which side of the container is used to resize.
	// The value of property is or-combination of TopSide (1), RightSide (2), BottomSide (4), and LeftSide (8)
	Side = "side"
	// ResizeBorderWidth is the constant for the "resize-border-width" property tag.
	// The "ResizeBorderWidth" SizeUnit property determines the width of the resizing border
	ResizeBorderWidth = "resize-border-width"
	// CellVerticalAlign is the constant for the "cell-vertical-align" property tag.
	CellVerticalAlign = "cell-vertical-align"
	// CellHorizontalAlign is the constant for the "cell-horizontal-align" property tag.
	CellHorizontalAlign = "cell-horizontal-align"

	// 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
)
View Source
const (
	// ColorTag is the name of the color property of the shadow.
	ColorTag = "color"
	// Inset is the name of bool property of the shadow. If it is set to "false" (default) then the shadow
	// is assumed to be a drop shadow (as if the box were raised above the content).
	// If it is set to  "true" then the shadow to one inside the frame (as if the content was depressed inside the box).
	// Inset shadows are drawn inside the border (even transparent ones), above the background, but below content.
	Inset = "inset"
	// XOffset is the name of the SizeUnit property of the shadow that determines the shadow horizontal offset.
	// Negative values place the shadow to the left of the element.
	XOffset = "x-offset"
	// YOffset is the name of the SizeUnit property of the shadow that determines the shadow vertical offset.
	// Negative values place the shadow above the element.
	YOffset = "y-offset"
	// BlurRadius is the name of the SizeUnit property of the shadow that 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.
	BlurRadius = "blur"
	// SpreadRadius is the name of the SizeUnit property of the shadow. Positive values will cause the shadow to expand
	// and grow bigger, negative values will cause the shadow to shrink.
	SpreadRadius = "spread-radius"
)
View Source
const (
	// DefaultAnimation - default animation of StackLayout push
	DefaultAnimation = 0
	// StartToEndAnimation - start to end animation of StackLayout push
	StartToEndAnimation = 1
	// EndToStartAnimation - end to start animation of StackLayout push
	EndToStartAnimation = 2
	// TopDownAnimation - top down animation of StackLayout push
	TopDownAnimation = 3
	// BottomUpAnimation - bottom up animation of StackLayout push
	BottomUpAnimation = 4
)
View Source
const (
	// TableVerticalAlign is the constant for the "table-vertical-align" property tag.
	// The "table-vertical-align" int property sets the vertical alignment of the content inside a table cell.
	// Valid values are TopAlign (0), BottomAlign (1), CenterAlign (2), and BaselineAlign (3, 4)
	TableVerticalAlign = "table-vertical-align"

	// HeadHeight is the constant for the "head-height" property tag.
	// The "head-height" int property sets the number of rows in the table header.
	// The default value is 0 (no header)
	HeadHeight = "head-height"

	// HeadStyle is the constant for the "head-style" property tag.
	// The "head-style" string property sets the header style name
	HeadStyle = "head-style"

	// FootHeight is the constant for the "foot-height" property tag.
	// The "foot-height" int property sets the number of rows in the table footer.
	// The default value is 0 (no footer)
	FootHeight = "foot-height"

	// FootStyle is the constant for the "foot-style" property tag.
	// The "foot-style" string property sets the footer style name
	FootStyle = "foot-style"

	// RowSpan is the constant for the "row-span" property tag.
	// The "row-span" int property sets the number of table row to span.
	// Used only when specifying cell parameters in the implementation of TableCellStyle
	RowSpan = "row-span"

	// ColumnSpan is the constant for the "column-span" property tag.
	// The "column-span" int property sets the number of table column to span.
	// Used only when specifying cell parameters in the implementation of TableCellStyle
	ColumnSpan = "column-span"

	// RowStyle is the constant for the "row-style" property tag.
	// The "row-style" property sets the adapter which specifies styles of each table row.
	// This property can be assigned or by an implementation of TableRowStyle interface, or by an array of Params.
	RowStyle = "row-style"

	// ColumnStyle is the constant for the "column-style" property tag.
	// The "column-style" property sets the adapter which specifies styles of each table column.
	// This property can be assigned or by an implementation of TableColumnStyle interface, or by an array of Params.
	ColumnStyle = "column-style"

	// CellStyle is the constant for the "cell-style" property tag.
	// The "cell-style" property sets the adapter which specifies styles of each table cell.
	// This property can be assigned only by an implementation of TableCellStyle interface.
	CellStyle = "cell-style"

	// CellPadding is the constant for the "cell-padding" property tag.
	// The "cell-padding" Bounds property sets the padding area on all four sides of a table call at once.
	// An element's padding area is the space between its content and its border.
	CellPadding = "cell-padding"

	// CellPaddingLeft is the constant for the "cell-padding-left" property tag.
	// The "cell-padding-left" SizeUnit property sets 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.
	CellPaddingLeft = "cell-padding-left"

	// CellPaddingRight is the constant for the "cell-padding-right" property tag.
	// The "cell-padding-right" SizeUnit property sets 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.
	CellPaddingRight = "cell-padding-right"

	// CellPaddingTop is the constant for the "cell-padding-top" property tag.
	// The "cell-padding-top" SizeUnit property sets 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.
	CellPaddingTop = "cell-padding-top"

	// CellPaddingBottom is the constant for the "cell-padding-bottom" property tag.
	// The "cell-padding-bottom" SizeUnit property sets the height of the padding area to the bottom of a cell content.
	CellPaddingBottom = "cell-padding-bottom"

	// CellBorder is the constant for the "cell-border" property tag.
	// The "cell-border" property sets a table cell's border. It sets the values of a border width, style, and color.
	// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
	CellBorder = "cell-border"

	// CellBorderLeft is the constant for the "cell-border-left" property tag.
	// The "cell-border-left" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	CellBorderLeft = "cell-border-left"

	// CellBorderRight is the constant for the "cell-border-right" property tag.
	// The "cell-border-right" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	CellBorderRight = "cell-border-right"

	// CellBorderTop is the constant for the "cell-border-top" property tag.
	// The "cell-border-top" property sets 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 type, or ViewBorder type, or BorderProperty text representation.
	CellBorderTop = "cell-border-top"

	// CellBorderBottom is the constant for the "cell-border-bottom" property tag.
	// The "cell-border-bottom" property sets a view's bottom border. It sets the values of a border width, style, and color.
	// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
	CellBorderBottom = "cell-border-bottom"

	// CellBorderStyle is the constant for the "cell-border-style" property tag.
	// The "cell-border-style" int property sets the line style for all four sides of a table cell's border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	CellBorderStyle = "cell-border-style"

	// CellBorderLeftStyle is the constant for the "cell-border-left-style" property tag.
	// The "cell-border-left-style" int property sets the line style of a table cell's left border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	CellBorderLeftStyle = "cell-border-left-style"

	// CellBorderRightStyle is the constant for the "cell-border-right-style" property tag.
	// The "cell-border-right-style" int property sets the line style of a table cell's right border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	CellBorderRightStyle = "cell-border-right-style"

	// CellBorderTopStyle is the constant for the "cell-border-top-style" property tag.
	// The "cell-border-top-style" int property sets the line style of a table cell's top border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	CellBorderTopStyle = "cell-border-top-style"

	// CellBorderBottomStyle is the constant for the "cell-border-bottom-style" property tag.
	// The "cell-border-bottom-style" int property sets the line style of a table cell's bottom border.
	// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
	CellBorderBottomStyle = "cell-border-bottom-style"

	// CellBorderWidth is the constant for the "cell-border-width" property tag.
	// The "cell-border-width" property sets the line width for all four sides of a table cell's border.
	CellBorderWidth = "cell-border-width"

	// CellBorderLeftWidth is the constant for the "cell-border-left-width" property tag.
	// The "cell-border-left-width" SizeUnit property sets the line width of a table cell's left border.
	CellBorderLeftWidth = "cell-border-left-width"

	// CellBorderRightWidth is the constant for the "cell-border-right-width" property tag.
	// The "cell-border-right-width" SizeUnit property sets the line width of a table cell's right border.
	CellBorderRightWidth = "cell-border-right-width"

	// CellBorderTopWidth is the constant for the "cell-border-top-width" property tag.
	// The "cell-border-top-width" SizeUnit property sets the line width of a table cell's top border.
	CellBorderTopWidth = "cell-border-top-width"

	// CellBorderBottomWidth is the constant for the "cell-border-bottom-width" property tag.
	// The "cell-border-bottom-width" SizeUnit property sets the line width of a table cell's bottom border.
	CellBorderBottomWidth = "cell-border-bottom-width"

	// CellBorderColor is the constant for the "cell-border-color" property tag.
	// The "cell-border-color" property sets the line color for all four sides of a table cell's border.
	CellBorderColor = "cell-border-color"

	// CellBorderLeftColor is the constant for the "cell-border-left-color" property tag.
	// The "cell-border-left-color" property sets the line color of a table cell's left border.
	CellBorderLeftColor = "cell-border-left-color"

	// CellBorderRightColor is the constant for the "cell-border-right-color" property tag.
	// The "cell-border-right-color" property sets the line color of a table cell's right border.
	CellBorderRightColor = "cell-border-right-color"

	// CellBorderTopColor is the constant for the "cell-border-top-color" property tag.
	// The "cell-border-top-color" property sets the line color of a table cell's top border.
	CellBorderTopColor = "cell-border-top-color"

	// CellBorderBottomColor is the constant for the "cell-border-bottom-color" property tag.
	// The "cell-border-bottom-color" property sets the line color of a table cell's bottom border.
	CellBorderBottomColor = "cell-border-bottom-color"

	// SelectionMode is the constant for the "selection-mode" property tag.
	// The "selection-mode" int property sets the mode of the table elements selection.
	// Valid values are NoneSelection (0), CellSelection (1), and RowSelection (2)
	SelectionMode = "selection-mode"

	// TableCellClickedEvent is the constant for "table-cell-clicked" property tag.
	// The "table-cell-clicked" event occurs when the user clicks on a table cell.
	// The main listener format: func(TableView, int, int), where the second argument is the row number,
	// and third argument is the column number.
	TableCellClickedEvent = "table-cell-clicked"

	// TableCellSelectedEvent is the constant for "table-cell-selected" property tag.
	// The "table-cell-selected" event occurs when a table cell becomes selected.
	// The main listener format: func(TableView, int, int), where the second argument is the row number,
	// and third argument is the column number.
	TableCellSelectedEvent = "table-cell-selected"

	// TableRowClickedEvent is the constant for "table-row-clicked" property tag.
	// The "table-row-clicked" event occurs when the user clicks on a table row.
	// The main listener format: func(TableView, int), where the second argument is the row number.
	TableRowClickedEvent = "table-row-clicked"

	// TableRowSelectedEvent is the constant for "table-row-selected" property tag.
	// The "table-row-selected" event occurs when a table row becomes selected.
	// The main listener format: func(TableView, int), where the second argument is the row number.
	TableRowSelectedEvent = "table-row-selected"

	// AllowSelection is the constant for the "allow-selection" property tag.
	// The "allow-selection" property sets the adapter which specifies styles of each table row.
	// This property can be assigned or by an implementation of TableAllowCellSelection
	// or TableAllowRowSelection interface.
	AllowSelection = "allow-selection"

	// NoneSelection is the value of "selection-mode" property: the selection is forbidden.
	NoneSelection = 0
	// CellSelection is the value of "selection-mode" property: the selection of a single cell only is enabled.
	CellSelection = 1
	// RowSelection is the value of "selection-mode" property: the selection of a table row only is enabled.
	RowSelection = 2
)
View Source
const (
	// CurrentTabChangedEvent is the constant for "current-tab-changed" property tag.
	// The "current-tab-changed" event occurs when the new tab becomes active.
	// The main listener format: func(TabsLayout, int, int), where
	// the second argument is the index of the new active tab,
	// the third argument is the index of the old active tab.
	CurrentTabChangedEvent = "current-tab-changed"

	// Icon is the constant for "icon" property tag.
	// The string "icon" property defines the icon name that is displayed in the tab.
	Icon = "icon"

	// TabCloseButton is the constant for "tab-close-button" property tag.
	// The "tab-close-button" is the bool property. If it is "true" then a close button is displayed within the tab.
	TabCloseButton = "tab-close-button"

	// TabCloseEvent is the constant for "tab-close-event" property tag.
	// The "tab-close-event" occurs when when the user clicks on the tab close button.
	// The main listener format: func(TabsLayout, int), where the second argument is the index of the tab.
	TabCloseEvent = "tab-close-event"

	// Tabs is the constant for the "tabs" property tag.
	// The "tabs" is the int property that sets where the tabs are located.
	// Valid values: TopTabs (0), BottomTabs (1), LeftTabs (2), RightTabs (3), LeftListTabs (4), RightListTabs (5), and HiddenTabs (6).
	Tabs = "tabs"

	// TabBarStyle is the constant for the "tab-bar-style" property tag.
	// The "tab-bar-style" is the string property that sets the style for the display of the tab bar.
	// The default value is "ruiTabBar".
	TabBarStyle = "tab-bar-style"

	// TabStyle is the constant for the "tab-style" property tag.
	// The "tab-style" is the string property that sets the style for the display of the tab.
	// The default value is "ruiTab" or "ruiVerticalTab".
	TabStyle = "tab-style"

	// CurrentTabStyle is the constant for the "current-tab-style" property tag.
	// The "current-tab-style" is the string property that sets the style for the display of the current (selected) tab.
	// The default value is "ruiCurrentTab" or "ruiCurrentVerticalTab".
	CurrentTabStyle = "current-tab-style"

	// 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
)
View Source
const (
	DefaultMedia   = 0
	PortraitMedia  = 1
	LandscapeMedia = 2
)
View Source
const (
	TimeChangedEvent = "time-changed"
	TimePickerMin    = "time-picker-min"
	TimePickerMax    = "time-picker-max"
	TimePickerStep   = "time-picker-step"
	TimePickerValue  = "time-picker-value"
)
View Source
const (
	// TouchStart is the constant for "touch-start" property tag.
	// The "touch-start" event is fired when one or more touch points are placed on the touch surface.
	// The main listener format: func(View, TouchEvent).
	// The additional listener formats: func(TouchEvent), func(View), and func().
	TouchStart = "touch-start"

	// TouchEnd is the constant for "touch-end" property tag.
	// The "touch-end" event fires when one or more touch points are removed from the touch surface.
	// The main listener format: func(View, TouchEvent).
	// The additional listener formats: func(TouchEvent), func(View), and func().
	TouchEnd = "touch-end"

	// TouchMove is the constant for "touch-move" property tag.
	// The "touch-move" event is fired when one or more touch points are moved along the touch surface.
	// The main listener format: func(View, TouchEvent).
	// The additional listener formats: func(TouchEvent), func(View), and func().
	TouchMove = "touch-move"

	// TouchCancel is the constant for "touch-cancel" property tag.
	// The "touch-cancel" event is fired when one or more touch points have been disrupted
	// in an implementation-specific manner (for example, too many touch points are created).
	// The main listener format: func(View, TouchEvent).
	// The additional listener formats: func(TouchEvent), func(View), and func().
	TouchCancel = "touch-cancel"
)
View Source
const (
	// VideoWidth is the constant for the "video-width" property tag of VideoPlayer.
	// The "video-width" float property defines the width of the video's display area in pixels.
	VideoWidth = "video-width"
	// VideoHeight is the constant for the "video-height" property tag of VideoPlayer.
	// The "video-height" float property defines the height of the video's display area in pixels.
	VideoHeight = "video-height"
	// Poster is the constant for the "poster" property tag of VideoPlayer.
	// The "poster" property 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.
	Poster = "poster"
)
View Source
const (
	// Blur is the constant for the "blur" property tag of the ViewFilter interface.
	// The "blur" float64 property 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.
	Blur = "blur"

	// Brightness is the constant for the "brightness" property tag of the ViewFilter interface.
	// The "brightness" float64 property 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.
	Brightness = "brightness"

	// Contrast is the constant for the "contrast" property tag of the ViewFilter interface.
	// The "contrast" float64 property 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.
	Contrast = "contrast"

	// DropShadow is the constant for the "drop-shadow" property tag of the ViewFilter interface.
	// The "drop-shadow" property 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 ViewShadow interface
	DropShadow = "drop-shadow"

	// Grayscale is the constant for the "grayscale" property tag of the ViewFilter interface.
	// The "grayscale" float64 property 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.
	Grayscale = "grayscale"

	// HueRotate is the constant for the "hue-rotate" property tag of the ViewFilter interface.
	// The "hue-rotate" AngleUnit property 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.
	HueRotate = "hue-rotate"

	// Invert is the constant for the "invert" property tag of the ViewFilter interface.
	// The "invert" float64 property 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.
	Invert = "invert"

	// Saturate is the constant for the "saturate" property tag of the ViewFilter interface.
	// The "saturate" float64 property 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.
	Saturate = "saturate"

	// Sepia is the constant for the "sepia" property tag of the ViewFilter interface.
	// The "sepia" float64 property 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.
	Sepia = "sepia"
)
View Source
const (
	// Perspective is the name of the SizeUnit property that determines the 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).
	Perspective = "perspective"
	// PerspectiveOriginX is the name of the SizeUnit property that determines the 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%.
	PerspectiveOriginX = "perspective-origin-x"
	// PerspectiveOriginY is the name of the SizeUnit property that determines the 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%.
	PerspectiveOriginY = "perspective-origin-y"
	// BackfaceVisible is the name of the 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.
	BackfaceVisible = "backface-visibility"
	// OriginX is the name of the SizeUnit property that determines the x-coordinate of the point around which
	// a view transformation is applied.
	// The default value is 50%.
	OriginX = "origin-x"
	// OriginY is the name of the SizeUnit property that determines the y-coordinate of the point around which
	// a view transformation is applied.
	// The default value is 50%.
	OriginY = "origin-y"
	// OriginZ is the name of the SizeUnit property that determines the z-coordinate of the point around which
	// a view transformation is applied.
	// The default value is 50%.
	OriginZ = "origin-z"
	// TranslateX is the name of the SizeUnit property that specify the x-axis translation value
	// of a 2D/3D translation
	TranslateX = "translate-x"
	// TranslateY is the name of the SizeUnit property that specify the y-axis translation value
	// of a 2D/3D translation
	TranslateY = "translate-y"
	// TranslateZ is the name of the SizeUnit property that specify the z-axis translation value
	// of a 3D translation
	TranslateZ = "translate-z"
	// ScaleX is the name of the float property that specify the x-axis scaling value of a 2D/3D scale
	// The default value is 1.
	ScaleX = "scale-x"
	// ScaleY is the name of the float property that specify the y-axis scaling value of a 2D/3D scale
	// The default value is 1.
	ScaleY = "scale-y"
	// ScaleZ is the name of the float property that specify the z-axis scaling value of a 3D scale
	// The default value is 1.
	ScaleZ = "scale-z"
	// Rotate is the name of the AngleUnit property that determines the angle of the view rotation.
	// A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
	Rotate = "rotate"
	// RotateX is the name of the float property that determines the x-coordinate of the vector denoting
	// the axis of rotation which could between 0 and 1.
	RotateX = "rotate-x"
	// RotateY is the name of the float property that determines the y-coordinate of the vector denoting
	// the axis of rotation which could between 0 and 1.
	RotateY = "rotate-y"
	// RotateZ is the name of the float property that determines the z-coordinate of the vector denoting
	// the axis of rotation which could between 0 and 1.
	RotateZ = "rotate-z"
	// SkewX is the name of the AngleUnit property that representing the angle to use to distort
	// the element along the abscissa. The default value is 0.
	SkewX = "skew-x"
	// SkewY is the name of the AngleUnit property that representing the angle to use to distort
	// the element along the ordinate. The default value is 0.
	SkewY = "skew-y"
)
View Source
const CheckboxChangedEvent = "checkbox-event"

CheckboxChangedEvent is the constant for "checkbox-event" property tag. The "checkbox-event" event occurs when the checkbox becomes checked/unchecked. The main listener format: func(Checkbox, bool), where the second argument is the checkbox state.

View Source
const DrawFunction = "draw-function"

DrawFunction is the constant for the "draw-function" property tag. The "draw-function" property sets the draw function of CanvasView. The function should have the following format: func(Canvas)

View Source
const DropDownEvent = "drop-down-event"

DropDownEvent is the constant for "drop-down-event" property tag. The "drop-down-event" event occurs when a list item becomes selected. The main listener format: func(DropDownList, int), where the second argument is the item index.

View Source
const PopupMenuResult = "popup-menu-result"

PopupMenuResult is the constant for the "popup-menu-result" property tag. The "popup-menu-result" property sets the function (format: func(int)) to be called when a menu item of popup menu is selected.

View Source
const ResizeEvent = "resize-event"

ResizeEvent is the constant for "resize-event" property tag. The "resize-event" is fired when the view changes its size. The main listener format:

func(View, Frame).

The additional listener formats:

func(Frame), func(View), and func().
View Source
const ScrollEvent = "scroll-event"

ScrollEvent is the constant for "scroll-event" property tag. The "scroll-event" is fired when the content of the view is scrolled. The main listener format:

func(View, Frame).

The additional listener formats:

func(Frame), func(View), and func().

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)

func AddTheme

func AddTheme(theme Theme)

func AddTransition

func AddTransition(view View, subviewID, tag string, animation Animation) 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

func AllImageResources() []string

func AllRawResources

func AllRawResources() []string

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

func BlurView(view View)

BlurView removes keyboard focus from the specified View.

func BlurViewByID

func BlurViewByID(viewID string, session Session)

BlurViewByID removes keyboard focus from the View with the specified viewID.

func CreateSocketBridge

func CreateSocketBridge(w http.ResponseWriter, req *http.Request) webBridge

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

func FinishApp()

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, tag string) 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.

func GetAnimationCancelListeners

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

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

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

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

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 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 GetCheckboxHorizontalAlign

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

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

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

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 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

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

GetDropDownDisabledItems return the list of DropDownList disabled item indexes. 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

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

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

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

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 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

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

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 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

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 GetOrigin

func GetOrigin(view View, subviewID ...string) (SizeUnit, SizeUnit, SizeUnit)

GetOrigin 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 GetOverflow

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 GetResize

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

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

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

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

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

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

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

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

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

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

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

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

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 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

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 GetTransitionCancelListeners

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

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

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

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

func GetTransitions(view View, subviewID ...string) map[string]Animation

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

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

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

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 IsMultipleFilePicker

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 IsTimingFunctionValid

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

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

func LastError() string

LastError returns the last error text

func LoadFilePickerFile

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

func NewHandler(urlPrefix string, createContentFunc func(Session) SessionContent, params AppParams) *httpHandler

func OpenBrowser

func OpenBrowser(url string) bool

func ReadRawResource

func ReadRawResource(filename string) []byte

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

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

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, tag string, 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).

func SetAnimated

func SetAnimated(rootView View, viewID, tag string, value any, animation Animation) 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

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

SetChangeListener sets a listener for changing a subview property value. If the second argument (subviewID) is not specified or it 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 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

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

Types

type AbsoluteLayout

type AbsoluteLayout interface {
	ViewsContainer
}

AbsoluteLayout - list-container of View

func NewAbsoluteLayout

func NewAbsoluteLayout(session Session, params Params) AbsoluteLayout

NewAbsoluteLayout create new AbsoluteLayout object and return it

type AngleUnit

type AngleUnit struct {
	Type  AngleUnitType
	Value float64
}

AngleUnit describe a size (Value field) and size unit (Type field).

func Deg

func Deg(value float64) 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(value float64) AngleUnit

Grad create AngleUnit with Gradian type

func PiRad

func PiRad(value float64) AngleUnit

PiRad create AngleUnit with PiRadian type

func Rad

func Rad(value float64) 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
)

type AnimatedProperty

type AnimatedProperty struct {
	// Tag is the name of the property
	Tag string
	// 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 Animation

type Animation interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

Animation interface is used to set animation parameters. Used properties: "property", "id", "duration", "delay", "timing-function", "iteration-count", and "animation-direction"

func GetAnimation

func GetAnimation(view View, subviewID ...string) []Animation

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

func GetTransition(view View, subviewID, tag string) Animation

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

func NewAnimation(params Params) Animation

type AppParams

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
	// 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
}

AppParams defines parameters of the app

type Application

type Application interface {
	Finish()
	// contains filtered or unexported methods
}

Application - app interface

type AudioPlayer

type AudioPlayer interface {
	MediaPlayer
}

func AudioPlayerByID

func AudioPlayerByID(rootView View, id string) AudioPlayer

AudioPlayerByID return a AudioPlayer with id equal to the argument of the function or nil if there is no such View or View is not AudioPlayer

func NewAudioPlayer

func NewAudioPlayer(session Session, params Params) AudioPlayer

NewAudioPlayer create new MediaPlayer object and return it

type BackgroundElement

type BackgroundElement interface {
	Properties

	Tag() string
	Clone() BackgroundElement
	// contains filtered or unexported methods
}

BackgroundElement describes the background element.

func NewBackgroundConicGradient

func NewBackgroundConicGradient(params Params) BackgroundElement

NewBackgroundConicGradient creates the new background conic gradient

func NewBackgroundImage

func NewBackgroundImage(params Params) BackgroundElement

NewBackgroundImage creates the new background image

func NewBackgroundLinearGradient

func NewBackgroundLinearGradient(params Params) BackgroundElement

NewBackgroundLinearGradient creates the new background linear gradient

func NewBackgroundRadialGradient

func NewBackgroundRadialGradient(params Params) BackgroundElement

NewBackgroundRadialGradient creates the new background radial gradient

type BackgroundGradientAngle

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

func (point *BackgroundGradientAngle) String() 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 (angle constant or textual description of the SizeUnit)
	Pos any
}

BackgroundGradientPoint define point on gradient straight line

type BorderProperty

type BorderProperty interface {
	Properties
	fmt.Stringer

	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

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(session Session) Bounds
	// contains filtered or unexported methods
}

BorderProperty is the interface of a bounds property data

func NewBoundsProperty

func NewBoundsProperty(params Params) BoundsProperty

NewBoundsProperty creates the new BoundsProperty object

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 - button view

func ButtonByID

func ButtonByID(rootView View, id string) Button

ButtonByID return a Button with id equal to the argument of the function or nil if there is no such View or View is not Button

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 ⎦
	//   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)

	// 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 int)

	// 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 int)

	// 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)

	// 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

type CanvasView

type CanvasView interface {
	View
	Redraw()
}

CanvasView interface of a custom draw view

func CanvasViewByID

func CanvasViewByID(rootView View, id string) CanvasView

CanvasViewByID return a CanvasView with id equal to the argument of the function or nil if there is no such View or View is not CanvasView

func NewCanvasView

func NewCanvasView(session Session, params Params) CanvasView

NewCanvasView creates the new custom draw view

type CellIndex

type CellIndex struct {
	Row, Column int
}

CellIndex defines coordinates of the TableView cell

func GetTableCurrent

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 - checkbox view

func CheckboxByID

func CheckboxByID(rootView View, id string) Checkbox

CheckboxByID return a Checkbox with id equal to the argument of the function or nil if there is no such View or View is not Checkbox

func NewCheckbox

func NewCheckbox(session Session, params Params) Checkbox

NewCheckbox create new Checkbox object and return it

type ClipShape

type ClipShape interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

ClipShape defines a View clipping area

func CircleClip

func CircleClip(x, y, radius SizeUnit) ClipShape

CircleClip creates a circle View clipping area.

func EllipseClip

func EllipseClip(x, y, rx, ry SizeUnit) ClipShape

EllipseClip creates a ellipse View clipping area.

func GetClip

func GetClip(view View, subviewID ...string) ClipShape

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) ClipShape

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 InsetClip

func InsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShape

InsetClip 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 PolygonClip

func PolygonClip(points []any) ClipShape

PolygonClip creates a polygon View clipping area. The elements of the function argument can be or text constants, or the text representation of SizeUnit, or elements of SizeUnit type.

func PolygonPointsClip

func PolygonPointsClip(points []SizeUnit) ClipShape

PolygonPointsClip creates a polygon View clipping area.

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
)

func GetAccentColor

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

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 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 - ColorPicker view

func ColorPickerByID

func ColorPickerByID(rootView View, id string) ColorPicker

ColorPickerByID return a ColorPicker with id equal to the argument of the function or nil if there is no such View or View is not ColorPicker

func NewColorPicker

func NewColorPicker(session Session, params Params) ColorPicker

NewColorPicker create new ColorPicker object and return it

type ColumnLayout

type ColumnLayout interface {
	ViewsContainer
}

ColumnLayout - grid-container of View

func ColumnLayoutByID

func ColumnLayoutByID(rootView View, id string) ColumnLayout

ColumnLayoutByID return a ColumnLayout with id equal to the argument of the function or nil if there is no such View or View is not ColumnLayout

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(session Session) ViewBorder
	// contains filtered or unexported methods
}

ColumnSeparatorProperty is the interface of a view separator data

func NewColumnSeparator

func NewColumnSeparator(params Params) ColumnSeparatorProperty

NewColumnSeparator creates the new ColumnSeparatorProperty

type ControlKeyMask

type ControlKeyMask int

type CustomView

type CustomView interface {
	ViewsContainer
	CreateSuperView(session Session) View
	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() []string

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 string) 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

func (customView *CustomViewData) HasFocus() bool

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 string)

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

func (*CustomViewData) Session

func (customView *CustomViewData) Session() Session

Session returns a current Session interface

func (*CustomViewData) Set

func (customView *CustomViewData) Set(tag string, 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 string, value any, animation Animation) bool

func (*CustomViewData) SetChangeListener

func (customView *CustomViewData) SetChangeListener(tag string, listener func(View, string))

func (*CustomViewData) SetTransition

func (customView *CustomViewData) SetTransition(tag string, animation Animation)

func (*CustomViewData) String

func (customView *CustomViewData) String() 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

func (customView *CustomViewData) Transition(tag string) Animation

func (*CustomViewData) Transitions

func (customView *CustomViewData) Transitions() map[string]Animation

func (*CustomViewData) ViewIndex

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() string
	Type() int
	Text() string
	Object() DataObject
	ArraySize() int
	ArrayElement(index int) DataValue
	ArrayElements() []DataValue
	ArrayAsParams() []Params
}

DataNode interface of a data node

type DataObject

type DataObject interface {
	DataValue
	Tag() string
	PropertyCount() int
	Property(index int) DataNode
	PropertyByTag(tag string) DataNode
	PropertyValue(tag string) (string, bool)
	PropertyObject(tag string) DataObject
	SetPropertyValue(tag, value string)
	SetPropertyObject(tag string, object DataObject)
	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() bool
	Object() DataObject
	Value() string
}

DataValue interface of a data node value

type DatePicker

type DatePicker interface {
	View
}

DatePicker - DatePicker view

func DatePickerByID

func DatePickerByID(rootView View, id string) DatePicker

DatePickerByID return a DatePicker with id equal to the argument of the function or nil if there is no such View or View is not DatePicker

func NewDatePicker

func NewDatePicker(session Session, params Params) DatePicker

NewDatePicker create new DatePicker object and return it

type DetailsView

type DetailsView interface {
	ViewsContainer
}

DetailsView - collapsible container of View

func DetailsViewByID

func DetailsViewByID(rootView View, id string) DetailsView

DetailsViewByID return a ColumnLayout with id equal to the argument of the function or nil if there is no such View or View is not DetailsView

func NewDetailsView

func NewDetailsView(session Session, params Params) DetailsView

NewDetailsView create new DetailsView object and return it

type DropDownList interface {
	View
	// contains filtered or unexported methods
}

DropDownList - the interface of a drop-down list view

func DropDownListByID(rootView View, id string) DropDownList

DropDownListByID return a DropDownListView with id equal to the argument of the function or nil if there is no such View or View is not DropDownListView

func NewDropDownList

func NewDropDownList(session Session, params Params) DropDownList

NewDropDownList create new DropDownList object and return it

type EditView

type EditView interface {
	View
	AppendText(text string)
}

EditView - grid-container of View

func EditViewByID

func EditViewByID(rootView View, id string) EditView

EditViewByID return a EditView with id equal to the argument of the function or nil if there is no such View or View is not EditView

func NewEditView

func NewEditView(session Session, params Params) EditView

NewEditView create new EditView object and return it

type FileInfo

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

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

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 - the control view for the files selecting

func FilePickerByID

func FilePickerByID(rootView View, id string) FilePicker

FilePickerByID return a FilePicker with id equal to the argument of the function or nil if there is no such View or View is not FilePicker

func NewFilePicker

func NewFilePicker(session Session, params Params) FilePicker

NewFilePicker create new FilePicker object and return it

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 GridLayout

type GridLayout interface {
	ViewsContainer
}

GridLayout - grid-container of View

func GridLayoutByID

func GridLayoutByID(rootView View, id string) GridLayout

GridLayoutByID return a GridLayout with id equal to the argument of the function or nil if there is no such View or View is not GridLayout

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 - image View

func ImageViewByID

func ImageViewByID(rootView View, id string) ImageView

ImageViewByID return a ImageView with id equal to the argument of the function or nil if there is no such View or View is not ImageView

func NewImageView

func NewImageView(session Session, params Params) ImageView

NewImageView create new ImageView object and return it

type KeyCode

type KeyCode string

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
}

type ListAdapter

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

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 ListLayout

type ListLayout interface {
	ViewsContainer
}

ListLayout - list-container of View

func ListLayoutByID

func ListLayoutByID(rootView View, id string) ListLayout

ListLayoutByID return a ListLayout with id equal to the argument of the function or nil if there is no such View or View is not ListLayout

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 - the list view interface

func ListViewByID

func ListViewByID(rootView View, id string) ListView

ListViewByID return a ListView with id equal to the argument of the function or nil if there is no such View or View is not ListView

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
}

type MediaSource

type MediaSource struct {
	Url      string
	MimeType string
}

type MediaStyleParams

type MediaStyleParams struct {
	Orientation int
	MinWidth    int
	MaxWidth    int
	MinHeight   int
	MaxHeight   int
}

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
}

type NamedColor

type NamedColor struct {
	Name  string
	Color Color
}

func NamedColors

func NamedColors() []NamedColor

NamedColors returns the list of named colors

type NumberPicker

type NumberPicker interface {
	View
}

NumberPicker - 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) NumberPicker

NumberPickerByID return a NumberPicker with id equal to the argument of the function or nil if there is no such View or View is not NumberPicker

type OutlineProperty

type OutlineProperty interface {
	Properties

	fmt.Stringer
	ViewOutline(session Session) ViewOutline
	// contains filtered or unexported methods
}

func NewOutlineProperty

func NewOutlineProperty(params Params) OutlineProperty

type Params

type Params map[string]any

Params defines a type of a parameters list

func (Params) AllTags

func (params Params) AllTags() []string

func (Params) Clear

func (params Params) Clear()

func (Params) Get

func (params Params) Get(tag string) any

func (Params) Remove

func (params Params) Remove(tag string)

func (Params) Set

func (params Params) Set(tag string, value any) bool

type ParentView

type ParentView interface {
	// Views return a list of child views
	Views() []View
}

type Path

type Path interface {
	// Reset erases the Path
	Reset()

	// 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

func NewPath

func NewPath() Path

NewPath creates a new empty Path

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
}
type Popup interface {
	View() View
	Session() Session
	Show()
	Dismiss()
	// contains filtered or unexported methods
}

Popup interface

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

func ShowPopup(view View, param Params) Popup

ShowPopup creates a new Popup and shows it

type PopupButton

type PopupButton struct {
	Title   string
	Type    PopupButtonType
	OnClick func(Popup)
}

PopupButton describes a button that will be placed at the bottom of the window.

type PopupButtonType

type PopupButtonType int

type ProgressBar

type ProgressBar interface {
	View
}

ProgressBar - 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) ProgressBar

ProgressBarByID return a ProgressBar with id equal to the argument of the function or nil if there is no such View or View is not ProgressBar

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 string) 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 string, value any) bool

	// Remove removes the property with name defined by the argument
	Remove(tag string)
	// Clear removes all properties
	Clear()
	// AllTags returns an array of the set properties
	AllTags() []string
	// contains filtered or unexported methods
}

Properties interface of properties map

type RadiusProperty

type RadiusProperty interface {
	Properties

	fmt.Stringer
	BoxRadius(session Session) BoxRadius
	// contains filtered or unexported methods
}

func NewRadiusProperty

func NewRadiusProperty(params Params) RadiusProperty

NewRadiusProperty creates the new RadiusProperty

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 - grid-container of 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, tag string) 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, tag string, 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)
	// 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))
	// contains filtered or unexported methods
}

Session provide interface to session parameters assess

type SessionContent

type SessionContent interface {
	CreateRootView(session Session) View
}

SessionContent is the interface of a session content

type SessionDisconnectListener

type SessionDisconnectListener interface {
	OnDisconnect(session Session)
}

SessionPauseListener is the listener interface of a session disconnect event

type SessionFinishListener

type SessionFinishListener interface {
	OnFinish(session Session)
}

SessionFinishListener is the listener interface of a session start event

type SessionPauseListener

type SessionPauseListener interface {
	OnPause(session Session)
}

SessionPauseListener is the listener interface of a session pause event

type SessionReconnectListener

type SessionReconnectListener interface {
	OnReconnect(session Session)
}

SessionPauseListener is the listener interface of a session reconnect event

type SessionResumeListener

type SessionResumeListener interface {
	OnResume(session Session)
}

SessionResumeListener is the listener interface of a session resume event

type SessionStartListener

type SessionStartListener interface {
	OnStart(session Session)
}

SessionStartListener is the listener interface of a session start event

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

type SizeFunc interface {
	fmt.Stringer
	// Name() returns the function name: "min", "max", "clamp", "sum", "sub", "mul", or "div"
	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", and "div" functions are available.

func ClampSize

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 argument types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func DivSize

func DivSize(arg0, arg1 any) SizeFunc

DivSize creates a SizeUnit function that calculates the result of dividing the arguments (arg1 / arg2). Valid argument 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

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

MaxSize creates a SizeUnit function that calculates the maximum argument. Valid argument types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc

func MinSize

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

MinSize creates a SizeUnit function that calculates the minimum argument. Valid argument types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func MulSize

func MulSize(arg0, arg1 any) SizeFunc

MulSize creates a SizeUnit function that calculates the result of multiplying the arguments (arg1 * arg2). Valid argument 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

func SubSize(arg0, arg1 any) SizeFunc

SumSize creates a SizeUnit function that calculates the result of subtracting the arguments (arg1 - arg2). Valid argument types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

func SumSize

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

SumSize creates a SizeUnit function that calculates the sum of arguments. Valid argument types are SizeUnit, SizeFunc and a string which is a text description of SizeUnit or SizeFunc.

type SizeUnit

type SizeUnit struct {
	Type     SizeUnitType
	Value    float64
	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(value float64) SizeUnit

Cm creates SizeUnit with SizeInCM type

func Em

func Em(value float64) SizeUnit

Em creates SizeUnit with SizeInEM type

func Ex

func Ex(value float64) SizeUnit

Ex creates SizeUnit with SizeInEX type

func Fr

func Fr(value float64) 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

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

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

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(value float64) SizeUnit

Inch creates SizeUnit with SizeInInch type

func Mm

func Mm(value float64) SizeUnit

Mm creates SizeUnit with SizeInMM type

func Pc

func Pc(value float64) SizeUnit

Pc creates SizeUnit with SizeInPc type

func Percent

func Percent(value float64) SizeUnit

Percent creates SizeUnit with SizeInDIP type

func Pt

func Pt(value float64) SizeUnit

Pt creates SizeUnit with SizeInPt type

func Px

func Px(value float64) 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
)

type StackLayout

type StackLayout interface {
	ViewsContainer
	Peek() View
	MoveToFront(view View) bool
	MoveToFrontByID(viewID string) bool
	Push(view View, animation int, onPushFinished func())
	Pop(animation int, onPopFinished func(View)) bool
}

StackLayout - list-container of 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) StackLayout

StackLayoutByID return a StackLayout with id equal to the argument of the function or nil if there is no such View or View is not StackLayout

type SvgImageView

type SvgImageView interface {
	View
}

SvgImageView - image View

func NewSvgImageView

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

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

type TableAllowCellSelection interface {
	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

type TableAllowRowSelection interface {
	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(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

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(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

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(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

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()
	ReloadCell(row, column int)
	CellFrame(row, column int) Frame
	// contains filtered or unexported methods
}

TableView - text View

func NewTableView

func NewTableView(session Session, params Params) TableView

NewTableView create new TableView object and return it

func TableViewByID

func TableViewByID(rootView View, id string) TableView

TableViewByID return a TableView with id equal to the argument of the function or nil if there is no such View or View is not TableView

type TabsLayout

type TabsLayout interface {
	ViewsContainer
	ListAdapter
}

TabsLayout - multi-tab container of 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) TabsLayout

TabsLayoutByID return a TabsLayout with id equal to the argument of the function or nil if there is no such View or View is not TabsLayout

type TextMetrics

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 - text 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) TextView

TextViewByID return a TextView with id equal to the argument of the function or nil if there is no such View or View is not TextView

type Theme

type Theme interface {
	fmt.Stringer
	Name() string
	Constant(tag string) (string, string)
	SetConstant(tag string, value, touchUIValue string)
	// ConstantTags returns the list of all available constants
	ConstantTags() []string
	Color(tag string) (string, string)
	SetColor(tag, color, darkUIColor string)
	// ColorTags returns the list of all available color constants
	ColorTags() []string
	Image(tag string) (string, string)
	SetImage(tag, image, darkUIImage string)
	// ImageConstantTags returns the list of all available image constants
	ImageConstantTags() []string
	Style(tag string) ViewStyle
	SetStyle(tag string, style ViewStyle)
	RemoveStyle(tag string)
	MediaStyle(tag string, params MediaStyleParams) ViewStyle
	SetMediaStyle(tag string, params MediaStyleParams, style ViewStyle)
	StyleTags() []string
	MediaStyles(tag string) []struct {
		Selectors string
		Params    MediaStyleParams
	}
	Append(anotherTheme Theme)
	// contains filtered or unexported methods
}

func CreateThemeFromText

func CreateThemeFromText(text string) (Theme, bool)

func NewTheme

func NewTheme(name string) Theme

type TimePicker

type TimePicker interface {
	View
}

TimePicker - TimePicker view

func NewTimePicker

func NewTimePicker(session Session, params Params) TimePicker

NewTimePicker create new TimePicker object and return it

func TimePickerByID

func TimePickerByID(rootView View, id string) TimePicker

TimePickerByID return a TimePicker with id equal to the argument of the function or nil if there is no such View or View is not TimePicker

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 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
}

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) VideoPlayer

VideoPlayerByID return a VideoPlayer with id equal to the argument of the function or nil if there is no such View or View is not VideoPlayer

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
	// 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 string, value any, animation Animation) bool
	// SetChangeListener set the function to track the change of the View property
	SetChangeListener(tag string, listener func(View, string))
	// HasFocus returns 'true' if the view has focus
	HasFocus() bool
	// contains filtered or unexported methods
}

View - 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) View

ViewByID return a View with id equal to the argument of the function or nil if there is no such View

type ViewBorder

type ViewBorder struct {
	Style int
	Color Color
	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 ViewFilter

type ViewFilter interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

ViewFilter 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

func GetBackdropFilter(view View, subviewID ...string) ViewFilter

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) ViewFilter

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 NewViewFilter

func NewViewFilter(params Params) ViewFilter

NewViewFilter creates the new ViewFilter

type ViewOutline

type ViewOutline struct {
	Style int
	Color Color
	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 ViewShadow

type ViewShadow interface {
	Properties
	fmt.Stringer
	// contains filtered or unexported methods
}

ViewShadow contains attributes of the view shadow

func GetTextShadows

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

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 GetViewShadows

func GetViewShadows(view View, subviewID ...string) []ViewShadow

GetViewShadows 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 NewInsetViewShadow

func NewInsetViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, color Color) ViewShadow

NewInsetViewShadow create the new inset shadow for a view. Arguments: offsetX, offsetY - x and y offset of the shadow blurRadius - the blur radius of the shadow spreadRadius - the spread radius of the shadow color - the color of the shadow

func NewShadowWithParams

func NewShadowWithParams(params Params) ViewShadow

NewShadowWithParams create the new shadow for a view.

func NewTextShadow

func NewTextShadow(offsetX, offsetY, blurRadius SizeUnit, color Color) ViewShadow

NewTextShadow create the new text shadow. Arguments: offsetX, offsetY - x and y offset of the shadow blurRadius - the blur radius of the shadow color - the color of the shadow

func NewViewShadow

func NewViewShadow(offsetX, offsetY, blurRadius, spreadRadius SizeUnit, color Color) ViewShadow

NewViewShadow create the new shadow for a view. Arguments: offsetX, offsetY - x and y offset of the shadow blurRadius - the blur radius of the shadow spreadRadius - the spread radius of the shadow color - the color of the shadow

type ViewStyle

type ViewStyle interface {
	Properties

	// Transition returns the transition animation of the property. Returns nil is there is no transition animation.
	Transition(tag string) Animation
	// Transitions returns the map of transition animations. The result is always non-nil.
	Transitions() map[string]Animation
	// 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 string, animation Animation)
	// 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
}

ViewsContainer - mutable list-container of Views

func ViewsContainerByID

func ViewsContainerByID(rootView View, id string) ViewsContainer

ViewsContainerByID return a ViewsContainer with id equal to the argument of the function or nil if there is no such View or View is not ViewsContainer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL