forked from mbk-lab/rui_orig
2
0
Fork 0

Updated comments

This commit is contained in:
anoshenko 2021-11-04 21:13:34 +03:00
parent 04bbd47f66
commit d254664655
14 changed files with 101 additions and 71 deletions

View File

@ -634,8 +634,8 @@ func (view *viewData) getTransitions() Params {
} }
// SetAnimated sets the property with name "tag" of the "rootView" subview with "viewID" id by value. Result: // SetAnimated sets the property with name "tag" of the "rootView" subview with "viewID" id by value. Result:
// true - success, // true - success,
// false - error (incompatible type or invalid format of a string value, see AppLog). // false - error (incompatible type or invalid format of a string value, see AppLog).
func SetAnimated(rootView View, viewID, tag string, value interface{}, animation Animation) bool { func SetAnimated(rootView View, viewID, tag string, value interface{}, animation Animation) bool {
if view := ViewByID(rootView, viewID); view != nil { if view := ViewByID(rootView, viewID); view != nil {
return view.SetAnimated(tag, value, animation) return view.SetAnimated(tag, value, animation)

View File

@ -3,21 +3,21 @@ package rui
import "strings" import "strings"
const ( const (
// TransitionRunEvent is the constant for "transition-run-event" property tag // TransitionRunEvent is the constant for "transition-run-event" property tag.
// The "transition-run-event" is fired when a transition is first created, // The "transition-run-event" is fired when a transition is first created,
// i.e. before any transition delay has begun. // i.e. before any transition delay has begun.
TransitionRunEvent = "transition-run-event" TransitionRunEvent = "transition-run-event"
// TransitionStartEvent is the constant for "transition-end-event" property tag // TransitionStartEvent is the constant for "transition-end-event" property tag.
// The "transition-start-event" is fired when a transition has actually started, // The "transition-start-event" is fired when a transition has actually started,
// i.e., after "delay" has ended. // i.e., after "delay" has ended.
TransitionStartEvent = "transition-start-event" TransitionStartEvent = "transition-start-event"
// TransitionEndEvent is the constant for "transition-end-event" property tag // TransitionEndEvent is the constant for "transition-end-event" property tag.
// The "transition-end-event" is fired when a transition has completed. // The "transition-end-event" is fired when a transition has completed.
TransitionEndEvent = "transition-end-event" TransitionEndEvent = "transition-end-event"
// TransitionCancelEvent is the constant for "transition-cancel-event" property tag // 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: // The "transition-cancel-event" is fired when a transition is cancelled. The transition is cancelled when:
// * A new property transition has begun. // * A new property transition has begun.
// * The "visibility" property is set to "gone". // * The "visibility" property is set to "gone".

View File

@ -19,29 +19,29 @@ const (
// DoubleLine constant specifies the border/line as a double solid line // DoubleLine constant specifies the border/line as a double solid line
WavyLine = 5 WavyLine = 5
// LeftStyle is the constant for "left-style" property tag // LeftStyle is the constant for "left-style" property tag.
LeftStyle = "left-style" LeftStyle = "left-style"
// RightStyle is the constant for "-right-style" property tag // RightStyle is the constant for "-right-style" property tag.
RightStyle = "right-style" RightStyle = "right-style"
// TopStyle is the constant for "top-style" property tag // TopStyle is the constant for "top-style" property tag.
TopStyle = "top-style" TopStyle = "top-style"
// BottomStyle is the constant for "bottom-style" property tag // BottomStyle is the constant for "bottom-style" property tag.
BottomStyle = "bottom-style" BottomStyle = "bottom-style"
// LeftWidth is the constant for "left-width" property tag // LeftWidth is the constant for "left-width" property tag.
LeftWidth = "left-width" LeftWidth = "left-width"
// RightWidth is the constant for "-right-width" property tag // RightWidth is the constant for "-right-width" property tag.
RightWidth = "right-width" RightWidth = "right-width"
// TopWidth is the constant for "top-width" property tag // TopWidth is the constant for "top-width" property tag.
TopWidth = "top-width" TopWidth = "top-width"
// BottomWidth is the constant for "bottom-width" property tag // BottomWidth is the constant for "bottom-width" property tag.
BottomWidth = "bottom-width" BottomWidth = "bottom-width"
// LeftColor is the constant for "left-color" property tag // LeftColor is the constant for "left-color" property tag.
LeftColor = "left-color" LeftColor = "left-color"
// RightColor is the constant for "-right-color" property tag // RightColor is the constant for "-right-color" property tag.
RightColor = "right-color" RightColor = "right-color"
// TopColor is the constant for "top-color" property tag // TopColor is the constant for "top-color" property tag.
TopColor = "top-color" TopColor = "top-color"
// BottomColor is the constant for "bottom-color" property tag // BottomColor is the constant for "bottom-color" property tag.
BottomColor = "bottom-color" BottomColor = "bottom-color"
) )

View File

@ -3,16 +3,20 @@ package rui
import "strings" import "strings"
const ( const (
// FocusEvent is the constant for "focus-event" property tag // FocusEvent is the constant for "focus-event" property tag.
// The "focus-event" event occurs when the View takes input focus. // The "focus-event" event occurs when the View takes input focus.
// The main listener format: func(View). // The main listener format:
// The additional listener format: func(). // func(View).
// The additional listener format:
// func().
FocusEvent = "focus-event" FocusEvent = "focus-event"
// LostFocusEvent is the constant for "lost-focus-event" property tag // LostFocusEvent is the constant for "lost-focus-event" property tag.
// The "lost-focus-event" event occurs when the View lost input focus. // The "lost-focus-event" event occurs when the View lost input focus.
// The main listener format: func(View). // The main listener format:
// The additional listener format: func(). // func(View).
// The additional listener format:
// func().
LostFocusEvent = "lost-focus-event" LostFocusEvent = "lost-focus-event"
) )

View File

@ -5,14 +5,18 @@ import "strings"
const ( const (
// KeyDown is the constant for "key-down-event" property tag. // KeyDown is the constant for "key-down-event" property tag.
// The "key-down-event" event is fired when a key is pressed. // The "key-down-event" event is fired when a key is pressed.
// The main listener format: func(View, KeyEvent). // The main listener format:
// The additional listener formats: func(KeyEvent), func(View), and func(). // func(View, KeyEvent).
// The additional listener formats:
// func(KeyEvent), func(View), and func().
KeyDownEvent = "key-down-event" KeyDownEvent = "key-down-event"
// KeyPp is the constant for "key-up-event" property tag // KeyPp is the constant for "key-up-event" property tag.
// The "key-up-event" event is fired when a key is released. // The "key-up-event" event is fired when a key is released.
// The main listener format: func(View, KeyEvent). // The main listener format:
// The additional listener formats: func(KeyEvent), func(View), and func(). // func(View, KeyEvent).
// The additional listener formats:
// func(KeyEvent), func(View), and func().
KeyUpEvent = "key-up-event" KeyUpEvent = "key-up-event"
) )

View File

@ -19,13 +19,13 @@ const (
// The "list-item-checked" event occurs when a list item checkbox becomes checked/unchecked. // 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. // The main listener format: func(ListView, []int), where the second argument is the array of checked item indexes.
ListItemCheckedEvent = "list-item-checked" ListItemCheckedEvent = "list-item-checked"
// ListItemStyle is the constant for "list-item-style" property tag // ListItemStyle is the constant for "list-item-style" property tag.
// The "list-item-style" string property defines the style of an unselected item // The "list-item-style" string property defines the style of an unselected item
ListItemStyle = "list-item-style" ListItemStyle = "list-item-style"
// CurrentStyle is the constant for "current-style" property tag // 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. // The "current-style" string property defines the style of the selected item when the ListView is focused.
CurrentStyle = "current-style" CurrentStyle = "current-style"
// CurrentInactiveStyle is the constant for "current-inactive-style" property tag // 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. // The "current-inactive-style" string property defines the style of the selected item when the ListView is unfocused.
CurrentInactiveStyle = "current-inactive-style" CurrentInactiveStyle = "current-inactive-style"
) )

View File

@ -6,38 +6,48 @@ import (
) )
const ( const (
// ClickEvent is the constant for "click-event" property tag // ClickEvent is the constant for "click-event" property tag.
// The "click-event" event occurs when the user clicks on the View. // The "click-event" event occurs when the user clicks on the View.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
ClickEvent = "click-event" ClickEvent = "click-event"
// DoubleClickEvent is the constant for "double-click-event" property tag // 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 "double-click-event" event occurs when the user double clicks on the View.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
DoubleClickEvent = "double-click-event" DoubleClickEvent = "double-click-event"
// MouseDown is the constant for "mouse-down" property tag. // 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 // The "mouse-down" event is fired at a View when a pointing device button is pressed
// while the pointer is inside the view. // while the pointer is inside the view.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
MouseDown = "mouse-down" MouseDown = "mouse-down"
// MouseUp is the constant for "mouse-up" property tag. // 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 // 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. // or trackpad) is released while the pointer is located inside it.
// "mouse-up" events are the counterpoint to "mouse-down" events. // "mouse-up" events are the counterpoint to "mouse-down" events.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
MouseUp = "mouse-up" MouseUp = "mouse-up"
// MouseMove is the constant for "mouse-move" property tag. // 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 // 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. // while the cursor's hotspot is inside it.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
MouseMove = "mouse-move" MouseMove = "mouse-move"
// MouseOut is the constant for "mouse-out" property tag. // MouseOut is the constant for "mouse-out" property tag.
@ -45,19 +55,29 @@ const (
// the cursor so that it is no longer contained within the view or one of its children. // 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, // "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. // because the child view obscures the visible area of the view.
// The main listener format: func(View, MouseEvent). // The main listener format:
// The additional listener formats: func(MouseEvent), func(View), and func(). // 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" MouseOut = "mouse-out"
// MouseOver is the constant for "mouse-over" property tag. // 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) // 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. // is used to move the cursor onto the view or one of its child views.
// The main listener formats: func(View, MouseEvent). // The main listener formats:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
MouseOver = "mouse-over" MouseOver = "mouse-over"
// ContextMenuEvent is the constant for "context-menu-event" property tag // 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 "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 main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
ContextMenuEvent = "context-menu-event" ContextMenuEvent = "context-menu-event"
// PrimaryMouseButton is a number of the main pressed button, usually the left button or the un-initialized state // PrimaryMouseButton is a number of the main pressed button, usually the left button or the un-initialized state

View File

@ -273,8 +273,8 @@ func (picker *numberPickerData) handleCommand(self View, command string, data Da
} }
// GetNumberPickerType returns the type of NumberPicker subview. Valid values: // GetNumberPickerType returns the type of NumberPicker subview. Valid values:
// NumberEditor (0) - NumberPicker is presented by editor (default type) // NumberEditor (0) - NumberPicker is presented by editor (default type);
// NumberSlider (1) - NumberPicker is presented by slider // NumberSlider (1) - NumberPicker is presented by slider.
// If the second argument (subviewID) is "" then a value from the first argument (view) is returned. // If the second argument (subviewID) is "" then a value from the first argument (view) is returned.
func GetNumberPickerType(view View, subviewID string) int { func GetNumberPickerType(view View, subviewID string) int {
if subviewID != "" { if subviewID != "" {

View File

@ -97,11 +97,9 @@ const (
// at <br>, and as necessary to fill line boxes. // at <br>, and as necessary to fill line boxes.
WhiteSpacePreLine = 4 WhiteSpacePreLine = 4
// WhiteSpaceBreakSpaces - the behavior is identical to that of WhiteSpacePreWrap, except that: // 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. // * 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, // * A line breaking opportunity exists after every preserved white space character, including between white space characters.
// including between white space characters. // * Such preserved spaces take up space and do not hang, and thus affect the boxs intrinsic sizes (min-content size and max-content size).
// * Such preserved spaces take up space and do not hang, and thus affect the boxs intrinsic sizes
// (min-content size and max-content size).
WhiteSpaceBreakSpaces = 5 WhiteSpaceBreakSpaces = 5
// WordBreakNormal - use the default line break rule. // WordBreakNormal - use the default line break rule.

View File

@ -1,9 +1,11 @@
package rui package rui
// ResizeEvent is the constant for "resize-event" property tag // ResizeEvent is the constant for "resize-event" property tag.
// The "resize-event" is fired when the view changes its size. // The "resize-event" is fired when the view changes its size.
// The main listener format: func(View, Frame). // The main listener format:
// The additional listener formats: func(Frame), func(View), and func(). // func(View, Frame).
// The additional listener formats:
// func(Frame), func(View), and func().
const ResizeEvent = "resize-event" const ResizeEvent = "resize-event"
func (view *viewData) onResize(self View, x, y, width, height float64) { func (view *viewData) onResize(self View, x, y, width, height float64) {

View File

@ -2,10 +2,12 @@ package rui
import "fmt" import "fmt"
// ScrollEvent is the constant for "scroll-event" property tag // ScrollEvent is the constant for "scroll-event" property tag.
// The "resize-event" is fired when the content of the view is scrolled. // The "resize-event" is fired when the content of the view is scrolled.
// The main listener format: func(View, Frame). // The main listener format:
// The additional listener formats: func(Frame), func(View), and func(). // func(View, Frame).
// The additional listener formats:
// func(Frame), func(View), and func().
const ScrollEvent = "scroll-event" const ScrollEvent = "scroll-event"
func (view *viewData) onScroll(self View, x, y, width, height float64) { func (view *viewData) onScroll(self View, x, y, width, height float64) {

View File

@ -48,10 +48,10 @@ type TabsLayout interface {
// SetCurrent set the index of active tab // SetCurrent set the index of active tab
SetCurrent(current int) SetCurrent(current int)
// TabsLocation return the location of tabs. It returns one of the following values: HiddenTabs (0), // TabsLocation return the location of tabs. It returns one of the following values: HiddenTabs (0),
// TopTabs (1), BottomTabs (2), LeftTabs (3), RightTabs (4), LeftListTabs (5), RightListTabs (6) // TopTabs (1), BottomTabs (2), LeftTabs (3), RightTabs (4), LeftListTabs (5), RightListTabs (6)
tabsLocation() int tabsLocation() int
// TabsLocation set the location of tabs. Valid values: HiddenTabs (0), TopTabs (1), // TabsLocation set the location of tabs. Valid values: HiddenTabs (0), TopTabs (1),
// BottomTabs (2), LeftTabs (3), RightTabs (4), LeftListTabs (5), RightListTabs (6) // BottomTabs (2), LeftTabs (3), RightTabs (4), LeftListTabs (5), RightListTabs (6)
SetTabsLocation(location int) SetTabsLocation(location int)
// TabStyle() return styles of tab in the passive and the active state // TabStyle() return styles of tab in the passive and the active state
TabStyle() (string, string) TabStyle() (string, string)

View File

@ -27,11 +27,11 @@ type polygonClip struct {
} }
// InsetClip creates a rectangle View clipping area. // InsetClip creates a rectangle View clipping area.
// top - offset from the top border of a View; // top - offset from the top border of a View;
// right - offset from the right border of a View; // right - offset from the right border of a View;
// bottom - offset from the bottom border of a View; // bottom - offset from the bottom border of a View;
// left - offset from the left 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 // radius - corner radius, pass nil if you don't need to round corners
func InsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShape { func InsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShape {
clip := new(insetClip) clip := new(insetClip)
clip.init() clip.init()

View File

@ -20,8 +20,8 @@ const (
PerspectiveOriginY = "perspective-origin-y" PerspectiveOriginY = "perspective-origin-y"
// BackfaceVisible is the name of the bool property that sets whether the back face of an element is // 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: // visible when turned towards the user. Values:
// true - the back face is visible when turned towards the user (default value). // 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. // false - the back face is hidden, effectively making the element invisible when turned away from the user.
BackfaceVisible = "backface-visibility" BackfaceVisible = "backface-visibility"
// OriginX is the name of the SizeUnit property that determines the x-coordinate of the point around which // OriginX is the name of the SizeUnit property that determines the x-coordinate of the point around which
// a view transformation is applied. // a view transformation is applied.