Skip to content

Mojo app view

mojo:mojo.app.View

Class View#

The View class.

Fields
Activated Invoked when a view becomes visible and active.
Deactivated Invoked when a view is no longer visible or active.
Constructors
New
Properties
AcceptsKeyEvents Whether the view accepts key events.
AcceptsMouseEvents Whether the view accepts mouse events.
Active View active state. (read only)
Bounds (read only)
ClipRect View clip rect. (read only)
Container (read only)
Enabled View enabled state.
Frame View frame rect.
Gravity Gravity for floating views.
Height Height of the view content rect. (read only)
Layout Layout mode.
LocalMatrix (read only)
MaxSize Maximum view size.
MinSize Minimum view size.
MouseLocation Mouse location relative to the view. (read only)
Offset
Parent The parent view of this view. (read only)
Rect View content rect. (read only)
RenderBounds (read only)
RenderMatrix (read only)
RenderRect (read only)
RenderStyle View render style. (read only)
Style View style.
StyleState View style state.
Visible View visibility state.
Width Width of the view content rect. (read only)
Window The Window this view is attached to, if any. (read only)
Methods
AddChildView Adds a child view to this view.
FindViewAtWindowPoint
GetStyle Gets a style.
InvalidateStyle
IsChildOf Checks if the view is a child of another view.
MakeKeyView Makes this view the key view.
MeasureLayoutSize
RemoveChildView Removes a child view from this view.
RequestRender
SendKeyEvent Sends a key event to the view.
SendMouseEvent Sends a mouse event to the view.
TransformPointFromView Transforms a point from another view.
TransformPointToView Transforms a point to another view.
TransformRectFromView Transforms a rect from another view.
TransformRectToView Transforms a rect to another view.
TransformWindowPointToView Transforms a point in window coordinates to view coordinates.
ValidateStyle
Protected properties
LayoutSize MeasuredSize plus the current RenderStyle bounds size. (read only)
MeasuredSize The last size returned by OnMeasure. (read only)
MouseDown the status of the main mouse button. (read only)
MouseFX Mouse X position (from 0 to 1). (read only)
MouseFY Mouse Y position (from 0 to 1). (read only)
MouseX Mouse X position in the view. (read only)
MouseY Mouse Y position in the view. (read only)
StyleBounds The current RenderStyle bounds rect. (read only)
Protected methods
Measure
Measure2
OnKeyChar Keyboard char event handler.
OnKeyDown Keyboard down event handler.
OnKeyEvent Keyboard event handler.
OnKeyRepeat Keyboard repeat event handler.
OnKeyUp Keyboard up event handler.
OnKeyViewChanged Called when the key view changes.
OnLayout Called during layout when the view needs to update its child views.
OnMeasure Called during layout to measure the view.
OnMeasure2
OnMouseClick MouseClick event handler.
OnMouseDoubleClick MouseDoubleClick event handler.
OnMouseDown MouseDown event handler.
OnMouseEnter MouseEnter event handler.
OnMouseEvent Mouse event handler.
OnMouseLeave MouseLeave event handler.
OnMouseMove MouseMove event handler.
OnMouseRightClick MouseRightClick event handler.
OnMouseUp MouseUp event handler.
OnMouseWheel Mouse wheel event handler.
OnRender Called when the view needs to render itself.
OnThemeChanged Called during layout if theme has changed.
OnValidateStyle Called during layout if Style or StyleState have changed.
Render
SetWindow
UpdateActive
UpdateLayout