Base class of widget. More...
Public Member Functions | |
Widget () | |
Constructor. | |
void | Dispose () |
Frees the unmanaged resources held by this widget and child widgets. | |
virtual void | SetPosition (float x, float y) |
Sets the position in the parent coordinate system. | |
virtual void | SetSize (float width, float height) |
Sets the size. | |
void | SetFocus (bool active) |
Places focus on self. | |
virtual bool | HitTest (Vector2 screenPoint) |
Obtains whether this widget hits with the specified coordinates. | |
Vector2 | ConvertScreenToLocal (Vector2 screenPoint) |
Converts the specified coordinates from the screen coordinate system to the local coordinate system. | |
Vector2 | ConvertScreenToLocal (float screenX, float screenY) |
Converts the specified coordinates from the screen coordinate system to the local coordinate system. | |
Vector2 | ConvertLocalToScreen (Vector2 localPoint) |
Converts the specified coordinates from the local coordinate system to the screen coordinate system. | |
Vector2 | ConvertLocalToScreen (float localX, float localY) |
Converts the specified coordinates from the local coordinate system to the screen coordinate system. | |
Vector2 | ConvertLocalToOtherWidget (Vector2 localPoint, Widget targetWidget) |
Converts the specified coordinates from the local coordinate system of itself to the local coordinate system of another widget. | |
Vector2 | ConvertLocalToOtherWidget (float x, float y, Widget targetWidget) |
Converts the specified coordinates from the local coordinate system of itself to the local coordinate system of another widget. | |
void | RenderToTexture (Texture2D texture) |
Renders to the texture. | |
void | RenderToTexture (Texture2D texture, Matrix4 transform) |
Renders to the texture. | |
void | RenderToFrameBuffer (FrameBuffer frameBuffer) |
Renders to the frame buffer. | |
void | RenderToFrameBuffer (FrameBuffer frameBuffer, Matrix4 transform) |
Renders to the frame buffer. | |
bool | AddGestureDetector (GestureDetector gestureDetector) |
Adds a gesture detection mechanism. | |
bool | RemoveGestureDetector (GestureDetector gestureDetector) |
Deletes the gesture detection mechanism. | |
override string | ToString () |
Returns a character string. | |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Frees the unmanaged resources held by this widget and child widgets. | |
virtual void | DisposeSelf () |
Frees the unmanaged resources held by this widget. | |
void | AddChildFirst (Widget child) |
Adds the child widget to the beginning. | |
void | AddChildLast (Widget child) |
Adds the child widget to the end. | |
void | InsertChildBefore (Widget child, Widget nextChild) |
Inserts it immediately in front of the specified child widget. | |
void | InsertChildAfter (Widget child, Widget prevChild) |
Inserts it immediately after the specified child widget. | |
void | RemoveChild (Widget child) |
Deletes the specified child widget. | |
virtual internal void | OnTouchEvent (TouchEventCollection touchEvents) |
Touch event handler. | |
virtual internal void | OnKeyEvent (KeyEvent keyEvent) |
Key event handler. | |
virtual internal void | OnPreviewKeyEvent (KeyEvent keyEvent) |
Advance key event handler. | |
internal Widget | SearchNextFocus (FourWayDirection direction) |
Searches for the widget in focus next. | |
internal Widget | SearchNextFocusFromChild (FourWayDirection direction, Widget currentFocusWidget) |
Searches for the widget in focus next from among own child widgets (including descendants) | |
virtual internal void | OnMotionEvent (MotionEvent motionEvent) |
Motion event handler. | |
virtual internal void | OnResetState () |
Status reset handler. | |
virtual void | OnUpdate (float elapsedTime) |
Update processing. | |
virtual internal void | Render () |
Renders a scene graph. | |
internal void | ResetState (bool includeSelf) |
Resets the status of all widgets for under self. | |
virtual internal void | SetupFinalAlpha () |
Calculates the final alpha value. | |
internal virtual void | OnFocusChanged (FocusChangedEventArgs args) |
Called when this widget obtains or loses focus. | |
virtual void | OnPressStateChanged (PressStateChangedEventArgs e) |
Called when the press status changes. | |
Properties | |
String | Name [get, set] |
Obtains and sets the name of the widget. | |
internal RootUIElement | RootUIElement [get] |
Obtains the root of the element tree. | |
virtual float | X [get, set] |
Obtains and sets the X coordinate in the parent coordinate system. | |
virtual float | Y [get, set] |
Obtains and sets the Y coordinate in the parent coordinate system. | |
virtual float | Width [get, set] |
Obtains and sets the width. | |
virtual float | Height [get, set] |
Obtains and sets the height. | |
virtual Matrix4 | Transform3D [get, set] |
Obtains and sets the transformation matrix to the parent coordinate system. | |
virtual float | Alpha [get, set] |
Obtains and sets the transparency. | |
virtual PivotType | PivotType [get, set] |
Obtains and sets the origin of the widget. | |
virtual bool | ZSort [get, set] |
Obtains and sets whether to Z sort. | |
virtual float | ZSortOffset [get, set] |
Obtains and sets the Z-sort offset. | |
virtual Anchors | Anchors [get, set] |
Obtains and sets the area to fix when resizing the parent. | |
virtual bool | Visible [get, set] |
Obtains and sets whether to display. | |
virtual bool | TouchResponse [get, set] |
Obtains and sets whether to respond to the touch event including the child widget. | |
internal bool | Clip [get, set] |
Obtains and sets whether to clip the child element (Widget, UIElement). | |
internal bool | HookChildTouchEvent [get, set] |
Obtains and sets whether to hook the touch event of the child widget. | |
Widget | Parent [get] |
Obtains the parent widget. | |
IEnumerable< Widget > | Children [get] |
Obtains the child widget. | |
bool | Focused [get] |
Obtains whether the focus is currently placed on self. | |
Matrix4 | LocalToWorld [get] |
Obtains the matrix to be converted from the local coordinate system to the world coordinate system. | |
virtual bool | PriorityHit [get, set] |
Obtains and sets whether to prioritize and respond to a touch. | |
virtual bool | Focusable [get, set] |
Obtains and sets whether to set the focus. | |
virtual FocusCustomSettings | FocusCustomSettings [get, set] |
Obtains and sets the focus setting information. | |
FocusStyle | FocusStyle [get, set] |
Obtains and sets the focus display style. | |
bool | Pressable [get, set] |
Obtains and sets whether it can be pressed by a touch or key. | |
virtual PressState | PressState [get, set] |
Obtains and sets the status for whether or not this widget is pressed. | |
PressStateTouchLeaveBehavior | TouchLeaveBehavior [get, set] |
Obtains and sets the behavior of the press status when the touch is moved from the inside of the area to the outside. | |
virtual bool | Enabled [get, set] |
Obtains and sets whether to enable the feature. | |
Events | |
EventHandler< TouchEventArgs > | TouchEventReceived |
Handler called when a touch event is received. | |
EventHandler< KeyEventArgs > | KeyEventReceived |
Handler called when a key event is received. | |
EventHandler< KeyEventArgs > | PreviewKeyEventReceived |
Handler called when an advance key event is received. | |
EventHandler< MotionEventArgs > | MotionEventReceived |
Handler called when a motion event is received. | |
EventHandler < FocusChangedEventArgs > | FocusChanged |
Event called when this widget obtains or loses focus. |
Base class of widget.
void AddChildFirst | ( | Widget | child | ) | [protected] |
Adds the child widget to the beginning.
child | Child widget to be added |
Moves it to the beginning if it has already been added.
Reimplemented in ContainerWidget, LiveScrollPanel, LiveSpringPanel, and ScrollPanel.
void AddChildLast | ( | Widget | child | ) | [protected] |
Adds the child widget to the end.
child | Child widget to be added |
Moves it to the end if it has already been added.
Reimplemented in ContainerWidget, LiveScrollPanel, LiveSpringPanel, and ScrollPanel.
bool AddGestureDetector | ( | GestureDetector | gestureDetector | ) |
Adds a gesture detection mechanism.
gestureDetector | Gesture detection mechanism |
ArgumentNullException | GestureDetector is null |
Converts the specified coordinates from the local coordinate system of itself to the local coordinate system of another widget.
targetWidget | Conversion destination widget |
localPoint | Self local coordinate system coordinates |
Converts the specified coordinates from the local coordinate system of itself to the local coordinate system of another widget.
targetWidget | Conversion destination widget |
x | Self local coordinate system coordinate X |
y | Self local coordinate system coordinate Y |
Converts the specified coordinates from the local coordinate system to the screen coordinate system.
localPoint | Local coordinate system coordinates |
Vector2 ConvertLocalToScreen | ( | float | localX, |
float | localY | ||
) |
Converts the specified coordinates from the local coordinate system to the screen coordinate system.
localX | Local coordinate system coordinate X |
localY | Local coordinate system coordinate Y |
Converts the specified coordinates from the screen coordinate system to the local coordinate system.
screenPoint | Screen coordinate system coordinates |
Vector2 ConvertScreenToLocal | ( | float | screenX, |
float | screenY | ||
) |
Converts the specified coordinates from the screen coordinate system to the local coordinate system.
screenX | Screen coordinate system coordinate X |
screenY | Screen coordinate system coordinate Y |
virtual void Dispose | ( | bool | disposing | ) | [protected, virtual] |
Frees the unmanaged resources held by this widget and child widgets.
Deletes itself from a parent widget and recursively calls DisposeSelf() for child widgets. When implementing Dispose with a derivative class, override DisposeSelf().
disposing | true when called from Dispose() |
void Dispose | ( | ) |
Frees the unmanaged resources held by this widget and child widgets.
Recursively frees this widget and all widgets in and below its tree as well as all UIElements that belong to the RootUIElement tree of each. Once Dispose() has been called for a widget, it cannot be reused. If widgets/UIElements that do not belong to a tree and other objects that require Dispose have been created with widget derivative classes, DisposeSelf() must be overridden and Dispose must be called for them.
virtual void DisposeSelf | ( | ) | [protected, virtual] |
Frees the unmanaged resources held by this widget.
This method is recursively called from Dispose() for the child widgets. If widgets/UIElements that do not belong to a tree and other objects that require Dispose have been created with widget derivative classes, this method must be overridden and Dispose must be called for them.
Reimplemented in BusyIndicator, Button, CheckBox, Dialog, EditableText, Label, ListPanelItem, LiveFlipPanel, LiveScrollPanel, MessageDialog, PagePanel, PopupList, ProgressBar, ScrollBar, Slider, and UIAnimationPlayer.
virtual bool HitTest | ( | Vector2 | screenPoint | ) | [virtual] |
Obtains whether this widget hits with the specified coordinates.
screenPoint | Position in the screen coordinate system |
Reimplemented in DatePicker, RootWidget, and TimePicker.
Inserts it immediately after the specified child widget.
child | Child widget to be inserted |
prevChild | Child widget immediately in front of the inserted child widget |
Moves it immediately after the specified child widget if it has already been added.
Reimplemented in ContainerWidget, LiveScrollPanel, LiveSpringPanel, and ScrollPanel.
Inserts it immediately in front of the specified child widget.
child | Child widget to be inserted |
nextChild | Child widget immediately after the inserted child widget |
Moves it immediately in front of the specified child widget if it has already been added.
Reimplemented in ContainerWidget, LiveScrollPanel, LiveSpringPanel, and ScrollPanel.
virtual internal void OnKeyEvent | ( | KeyEvent | keyEvent | ) | [protected, virtual] |
Key event handler.
keyEvent | Key event |
virtual internal void OnMotionEvent | ( | MotionEvent | motionEvent | ) | [protected, virtual] |
virtual void OnPressStateChanged | ( | PressStateChangedEventArgs | e | ) | [protected, virtual] |
Called when the press status changes.
e | Event argument |
Reimplemented in Button, CheckBox, EditableText, ListPanelItem, and PopupList.
virtual internal void OnPreviewKeyEvent | ( | KeyEvent | keyEvent | ) | [protected, virtual] |
Advance key event handler.
keyEvent | Key event |
Reimplemented in GridListPanel, ListPanel, LiveListPanel, PagePanel, ScrollPanel, and Slider.
virtual internal void OnTouchEvent | ( | TouchEventCollection | touchEvents | ) | [protected, virtual] |
Touch event handler.
touchEvents | Touch event |
Reimplemented in GridListPanel, ListPanel, LiveFlipPanel, LiveListPanel, LiveScrollPanel, LiveSphere, PagePanel, Panel, and ScrollPanel.
virtual void OnUpdate | ( | float | elapsedTime | ) | [protected, virtual] |
Update processing.
elapsedTime | Elapsed time from previous update (ms) |
Reimplemented in AnimationImageBox, Button, EditableText, GridListPanel, ListPanel, LiveFlipPanel, LiveJumpPanel, LiveListPanel, LiveScrollPanel, LiveSphere, LiveSpringPanel, PagePanel, ProgressBar, and ScrollPanel.
void RemoveChild | ( | Widget | child | ) | [protected] |
Deletes the specified child widget.
child | Child widget to be deleted |
Reimplemented in ContainerWidget, LiveScrollPanel, LiveSpringPanel, and ScrollPanel.
bool RemoveGestureDetector | ( | GestureDetector | gestureDetector | ) |
Deletes the gesture detection mechanism.
gestureDetector | Gesture detection mechanism |
ArgumentNullException | GestureDetector is null |
void RenderToFrameBuffer | ( | FrameBuffer | frameBuffer | ) |
Renders to the frame buffer.
frameBuffer | FrameBuffer |
void RenderToFrameBuffer | ( | FrameBuffer | frameBuffer, |
Matrix4 | transform | ||
) |
Renders to the frame buffer.
frameBuffer | FrameBuffer |
transform | Conversion matrix |
void RenderToTexture | ( | Texture2D | texture | ) |
Renders to the texture.
texture | 2D texture |
Renders to the texture.
texture | 2D texture |
transform | Conversion matrix |
internal void ResetState | ( | bool | includeSelf | ) | [protected] |
Resets the status of all widgets for under self.
includeSelf | If self is reset, then true. If self is not reset, then false. |
internal Widget SearchNextFocus | ( | FourWayDirection | direction | ) | [protected] |
Searches for the widget in focus next.
direction | Direction of directional buttons |
internal Widget SearchNextFocusFromChild | ( | FourWayDirection | direction, |
Widget | currentFocusWidget | ||
) | [protected] |
Searches for the widget in focus next from among own child widgets (including descendants)
Self is excluded from the search target.
direction | Direction of directional buttons |
currentFocusWidget | Widget currently in focus |
void SetFocus | ( | bool | active | ) |
Places focus on self.
active | true: Enables focus false: Keeps the status |
Sets the focus regardless of the Focusable, Visible, and Enabled properties and whether it is within the display range. If an affiliated scene is not the target focus scene, focus does not become active even when active is set to true.
virtual void SetPosition | ( | float | x, |
float | y | ||
) | [virtual] |
Sets the position in the parent coordinate system.
x | X coordinate in the parent coordinate system |
y | Y coordinate in the parent coordinate system |
virtual void SetSize | ( | float | width, |
float | height | ||
) | [virtual] |
override string ToString | ( | ) |
Returns a character string.
virtual float Alpha [get, set] |
Obtains and sets the transparency.
(0 - 1) Multiplies the transparency by all child widgets and displays it.
IEnumerable<Widget> Children [get, protected] |
Obtains the child widget.
Returns the enumerator that repetitively handles the collection.
Reimplemented in ContainerWidget, LiveScrollPanel, and ScrollPanel.
internal bool Clip [get, set, protected] |
virtual bool Focusable [get, set] |
Obtains and sets whether to set the focus.
If the child widget is true, the child widget may have focus even when the parent widget is false.
Reimplemented in PagePanel, and ScrollPanel.
String Name [get, set] |
Obtains and sets the name of the widget.
This property can be used arbitrarily with applications.
Obtains and sets the origin of the widget.
The point that serves as the center when moving, rotating, and scaling.
PressStateTouchLeaveBehavior TouchLeaveBehavior [get, set, protected] |
Obtains and sets the behavior of the press status when the touch is moved from the inside of the area to the outside.
This value is enabled only when the Pressable property is true.