Daikon Forge GUI  v1.0.16
Daikon Forge user interface library for Unity
 All Classes Functions Variables Enumerations Enumerator Properties Events Pages
dfControl Class Reference

Base class for all GUI controls. Provides common functionality, event handling, and properties for all user interface controls. More...

Inheritance diagram for dfControl:
IDFControlHost dfCheckbox dfDragHandle dfInteractiveBase dfLabel dfPanel dfProgressBar dfResizeHandle dfRichTextLabel dfScrollbar dfScrollPanel dfSlider dfSprite dfTabContainer dfTabstrip dfTextureSprite

Detailed Description

Base class for all GUI controls. Provides common functionality, event handling, and properties for all user interface controls.

Control Position and Relative Coordinates

DF-GUI uses a parent-relative coordinate system where the origin (0,0) is at the upper left corner of the parent container, the horizontal axis increases to the right, and the vertical axis increases in the downward direction.

For example, a control whose dfControl.RelativePosition value is set to (10,15) will be located ten pixels to the right and fifteen pixels down from the upper left corner of its container (or the upper-left corner of the screen if the control has no parent container).

Note that the value of the dfControl.RelativePosition and dfControl.Size properties are assumed to represent pixels.

Control Events

Control events in DF-GUI have been designed so that they can be used in different ways depending on the needs of your game.

Direct events

Each control exposes a number of .NET events which can be subscribed to using standard .NET event subscription semantics. For example, a script that wishes to be notified whenever a dfLabel control named health has its Text property changed might attach an event handler to the dfLabel.TextChanged event as follows:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Scratchpad : MonoBehaviour 
{
    public dfLabel health;
    public void Start()
    {
        health.TextChanged += new PropertyChangedEventHandler<string>( health_TextChanged );
    }
    void health_TextChanged( dfControl control, string value )
    {
        Debug.Log( "Health changed" );
    }
}

Reflection-based events

A script component which is attached to the same this.gameObject as a control component can also subscribe to events using a reflection-based model which involves creating an appropriately-named method for the desired event which follows a specific pattern.

Such methods must be named On{XXX}, where {XXX} represents the name of the desired event. For example, a script wishing to be notified of a Click event occuring would define an event handler method as follows:

public void OnClick( dfControl control, dfMouseEventArgs args )
{
    Debug.Log( "My control was clicked" );
}

In the above example, the method's name indicates that it should be called when the Click event occurs, and the parameter list matches the MouseEventHandler signature specified by the Click event.

Event handlers specified in this manner also have the option of omitting all parameters. If only the fact that the control was clicked were important, and the parameters are not needed by the script, the above method could alternately be defined as:

public void OnClick()
{
    Debug.Log( "My control was clicked" );
}

Note that either all parameters must be included, or no parameters must be included. It is not possible to only define only a subset of the defined parameters.

Event Bubbling

Many of the events raised by a dfControl instance will "bubble" up the control hierarchy. This means that the event will first be processed by the control that raises the event, then that control's parent, then the control's parent's parent, and so on all the way up the control hierarchy.

Specifically, any event whose method signature includes a dfControlEventArgs parameter (or any subclass of dfControlEventArgs such as dfMouseEventArgs or dfDragEventArgs) will bubble up the hierarchy.

For these events, the original source of the event can be determined by the value of the dfControlEventArgs.Source property. Whether the event has already been handled can be determined by the value of the dfControlEventArgs.Used property.

Event handlers as coroutines

Your event handlers can also be called as a coroutine, so that when the desired event is raised, your code can perform long-running asynchronous operations.

In order to function as a coroutine, your event handler must return an IEnumerator object and use the yield keyword within the method body, like the following example:

public IEnumerator OnClick( dfControl control, dfMouseEventArgs mouseEvent )
{
    Debug.Log( "OnClick() started" );
    yield return new WaitForSeconds( 2 );
    Debug.Log( "OnClick() over" );
}

Nested Classes

class  AnchorLayout
 Implements basic Anchor Layout - Allows the control to "anchor" each edge to the corresponding edge of its container such that the control resizes properly when its container is resized. More...
 
class  SignalCache
 

Public Member Functions

dfControl AddControl (Type controlType)
 Creates a new dfControl instance of the specified type and adds it as a child of this instance More...
 
void AddControl (dfControl child)
 Adds the child control to the list of child controls for this instance More...
 
AddControl< T > ()
 Creates a new dfControl instance of the specified type and adds it as a child of this instance More...
 
dfControl AddPrefab (GameObject prefab)
 Instantiates a new instance of the specified prefab and adds it to the control hierarchy More...
 
virtual void BringToFront ()
 Brings this control to the front so that it appears in front of all other controls within the same container More...
 
virtual Vector2 CalculateMinimumSize ()
 Used during layout to determine the effective minimum size of the control, which may be different than that specified by the MinimumSize property. More...
 
int CompareTo (dfControl other)
 Used to compare dfControl instances in order to sort them according to ZOrder value. More...
 
bool Contains (dfControl child)
 Retrieves a value indicating whether the specified control is a child of this control. More...
 
void Disable ()
 Disables the control. Bindable alternative to setting IsEnabled = false More...
 
void DoClick ()
 Simulates the user clicking on the control More...
 
void Enable ()
 Enable the control. Bindable alternative to setting IsEnabled = true More...
 
dfControl Find (string controlName)
 Performs a breadth-first search for a dfControl instance with the same name as the controlName argument. This search is case-sensitive. More...
 
Find< T > (string controlName)
 Performs a breadth-first search for a dfControl instance with the same name as the controlName argument and which is of the specified Type. This search is case-sensitive. More...
 
void Focus ()
 Sets the global input focus to this object More...
 
Vector3 GetAbsolutePosition ()
 Returns the control's absolute position relative to the dfGUIManager instance that is hosting the control More...
 
Bounds GetBounds ()
 Returns the axis-aligned bounding box enclosing this dfControl More...
 
Camera GetCamera ()
 Returns a reference to the UnityEngine.Camera that is responsible for rendering this dfControl More...
 
Vector3 GetCenter ()
 Returns a UnityEngine.Vector3 representing the global coordinates of the dfControl's center More...
 
Vector3[] GetCorners ()
 Returns an array of Vector3 values corresponding to the global positions of this object's bounding box. The corners are specified in the following order: Top Left, Top Right, Bottom Left, Bottom Right More...
 
Vector2 GetHitPosition (Ray ray)
 Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the ray argument. More...
 
bool GetHitPosition (Ray ray, out Vector2 position)
 Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the position argument. More...
 
bool GetHitPosition (Ray ray, out Vector2 position, bool clamp)
 Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the position argument. More...
 
dfGUIManager GetManager ()
 Returns a reference to the dfGUIManager instance that is responsible for rendering the control More...
 
dfControl GetRootContainer ()
 Returns a reference to the top-most container for this control More...
 
Rect GetScreenRect ()
 Returns the Screen-based coordinates containing this control More...
 
void Hide ()
 Hide the control. Bindable alternative to setting IsVisible = false More...
 
bool HitTest (Ray ray)
 Returns TRUE if the indicated ray intersects the control, and FALSE otherwise More...
 
virtual void Invalidate ()
 Called when the control needs to rebuild its render information More...
 
void Localize ()
 Causes the control to use localized data for its (class-specific) properties. More...
 
void MakePixelPerfect ()
 Causes this control to textAlign its Position and Size properties so that they lie exactly on pixel boundaries More...
 
void MakePixelPerfect (bool recursive)
 Causes this control to textAlign its Position and Size properties so that they lie exactly on pixel boundaries More...
 
void PerformLayout ()
 Causes this control to update its layout More...
 
float PixelsToUnits ()
 Returns a number representing the conversion of World Units to pixels, used to convert a dfControl's "pixel-based" position and location properties into world units for rendering and raycasting purposes. More...
 
void RebuildControlOrder ()
 Removes any gaps in the ZOrder of child controls and sorts the Controls collection according to ZOrder More...
 
void RemoveControl (dfControl child)
 Removes the indicated control from the list of child controls for this instance More...
 
void ResetLayout ()
 Causes the control to reset all layout information More...
 
void ResetLayout (bool recursive, bool force)
 Causes the control to reset all layout information More...
 
void ResumeLayout ()
 Resumes usual layout logic More...
 
virtual void SendToBack ()
 Sends this control to the back so that it appears behind all other controls within the same container More...
 
void Show ()
 Show the control. Bindable alternative to setting IsVisible = true More...
 
void SuspendLayout ()
 Temporarily suspends the layout logic for the control More...
 
void Unfocus ()
 Removes global input focus from this object More...
 

Public Attributes

int zindex = int.MaxValue
 

Static Public Attributes

static readonly dfList< dfControlActiveInstances = new dfList<dfControl>()
 

Protected Member Functions

virtual void OnControlClippingChanged ()
 
virtual void OnRebuildRenderData ()
 Called by the dfControl class during rendering to allow any derived classes to rebuild the renderData buffer. More...
 
virtual void OnTabKeyPressed (dfKeyEventArgs args)
 
void raiseMouseDownEvent (dfMouseEventArgs args)
 
void raiseMouseMoveEvent (dfMouseEventArgs args)
 
void raiseMouseWheelEvent (dfMouseEventArgs args)
 
void raiseSizeChangedEvent ()
 

Properties

bool AllowSignalEvents [get, set]
 Gets or sets a value indicating whether this control can use Signal() to call event handlers via reflection. Defaults to TRUE. More...
 
dfAnchorStyle Anchor [get, set]
 Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. More...
 
bool AutoFocus [get, set]
 Gets or sets whether the control will automatically be focused when enabled or shown More...
 
bool ClipChildren [get, set]
 Indicates whether child controls will be clipped to the bounds of this control More...
 
Color32 Color [get, set]
 Gets or sets the color of the control More...
 
virtual bool ContainsFocus [get]
 Gets a value indicating whether the control, or one of its child controls, currently has the input focus. More...
 
bool ContainsMouse [get]
 Returns TRUE when the mouse is contained within the bounds of the control More...
 
dfList< dfControlControls [get]
 Gets the collection of controls contained within the control More...
 
UnityColor32 DisabledColor [get, set]
 Gets or sets the color that will be used when this control is disabled More...
 
dfGUIManager GUIManager [get]
 Returns a reference to the dfGUIManager instance responsible for rendering this dfControl More...
 
virtual bool HasFocus [get]
 Gets a value indicating whether the control has user input focus. More...
 
float Height [get, set]
 Gets or sets the height of the control in pixels More...
 
Vector2 HotZoneScale [get, set]
 Gets or sets the size (as a multiplier) of the "hot zone" around the control More...
 
bool IsEnabled [get, set]
 Gets or sets a value indicating whether the control can respond to user interaction. More...
 
virtual bool IsInteractive [get, set]
 Gets/Sets a value indicating whether the control is user-interactive, ie: Whether the control responds to user input. This flag controls whether the control has an current BoxCollider, because there are real performance implications for having a collider on a large number of controls that will never process user input. More...
 
bool IsLayoutSuspended [get]
 Returns a value indicating whether the dfControl's layout engine is currently suspended More...
 
bool IsLocalized [get, set]
 Gets or sets a value indicating whether this controls should use localized versions of its (class-specific) properties More...
 
bool IsPerformingLayout [get]
 Returns TRUE if the control is currently performing a layout operation and FALSE otherwise More...
 
bool IsVisible [get, set]
 Gets or sets a value indicating whether the control and all its child controls are displayed. More...
 
Vector2 MaximumSize [get, set]
 Gets or sets the maximum allowed size of the control More...
 
Vector2 MinimumSize [get, set]
 Gets or sets the minimum allowed size of the control More...
 
float Opacity [get, set]
 Gets or sets the opacity level of the control More...
 
dfControl Parent [get]
 Gets the parent container of the control More...
 
dfPivotPoint Pivot [get, set]
 Gets or sets the Pivot Point of the control More...
 
Vector3 Position [get, set]
 Gets or sets the local position of the upper-left corner of the control relative to its container's pivot point More...
 
Vector3 RelativePosition [get, set]
 Returns the relative coordinates of the upper-left corner of the control relative to the upper-left corner of the parent control, expressed in "screen space" coordinates (left-top origin): x increases right, y increases down More...
 
int RenderOrder [get]
 Returns the order in which this dfControl will be rendered. More...
 
Vector2 Size [get, set]
 Gets or sets the size (in pixels) of the control More...
 
int TabIndex [get, set]
 Gets or sets the tab order of the control within its container. Set this value to -1 to remove this control from the tab order. More...
 
object Tag [get, set]
 Can be used to store additional data about the control instance More...
 
string Tooltip [get, set]
 The tooltip to be displayed to the user when the mouse hovers over the control. Currently not used directly by this library. More...
 
float Width [get, set]
 Gets or sets the width of the control in pixels More...
 
int ZOrder [get, set]
 Gets/Sets a value indicating the rendering order of this control More...
 

Events

PropertyChangedEventHandler
< dfAnchorStyle
AnchorChanged
 Occurs when the control's Anchor property value changes More...
 
MouseEventHandler Click
 Occurs when the control is clicked by the mouse More...
 
PropertyChangedEventHandler
< Color32 > 
ColorChanged
 Occurs when the control's Color value changes More...
 
ChildControlEventHandler ControlAdded
 Occurs when a control is added to the Controls collection More...
 
PropertyChangedEventHandler< bool > ControlClippingChanged
 Raised whenever the clipping state of the control is changed, such as when the control is moved from within the active clipping region to outside of the clipping region, or vice versa. More...
 
PropertyChangedEventHandler< bool > ControlHidden
 Occurs when a control's IsVisible property is changed to FALSE. This event does not bubble up the control hierarchy. More...
 
ChildControlEventHandler ControlRemoved
 Occurs when a control is removed from the Controls collection More...
 
PropertyChangedEventHandler< bool > ControlShown
 Occurs when a control's IsVisible property is changed to TRUE. This event does not bubble up the control hierarchy. More...
 
MouseEventHandler DoubleClick
 Occurs when the control is double clicked by the mouse More...
 
DragEventHandler DragDrop
 Occurs when a drag-and-drop operation is completed More...
 
DragEventHandler DragEnd
 Occurs (on the source dfControl) when a drag-and-drop operation has ended More...
 
DragEventHandler DragEnter
 Occurs when an object is dragged into the control's bounds More...
 
DragEventHandler DragLeave
 Occurs when an object is dragged out of the control's bounds More...
 
DragEventHandler DragOver
 Occurs when an object is dragged over the control's bounds More...
 
DragEventHandler DragStart
 Occurs (on the source dfControl) when a drag-and-drop operation is starting More...
 
FocusEventHandler EnterFocus
 Occurs when the control or any of its child controls receives input focus More...
 
FocusEventHandler GotFocus
 Occurs when the control receives input focus More...
 
PropertyChangedEventHandler< bool > IsEnabledChanged
 Occurs when the control's Enabled property value changes More...
 
PropertyChangedEventHandler< bool > IsVisibleChanged
 Occurs when the control's Visible property changes More...
 
KeyPressHandler KeyDown
 Occurs when the user presses a key while the control has input focus More...
 
KeyPressHandler KeyPress
 Occurs when the user presses a key while the control has input focus More...
 
KeyPressHandler KeyUp
 Occurs when the user releases a key while the control has input focus More...
 
FocusEventHandler LeaveFocus
 Occurs when the control and all of its child controls lose input focus More...
 
FocusEventHandler LostFocus
 Occurs when the control loses input focus More...
 
MouseEventHandler MouseDown
 Occurs when the mouse pointer is over the control and a mouse button is pressed More...
 
MouseEventHandler MouseEnter
 Occurs when the mouse pointer enters the control More...
 
MouseEventHandler MouseHover
 Occurs when the mouse pointer rests on the control More...
 
MouseEventHandler MouseLeave
 Occurs when the mouse pointer leaves the control More...
 
MouseEventHandler MouseMove
 Occurs when the mouse pointer is moved over the control More...
 
MouseEventHandler MouseUp
 Occurs when a mouse button had previously been pressed on a control and a mouse button is released while the pointer is still over the control More...
 
MouseEventHandler MouseWheel
 Occurs when the mouse wheel moves while the control has focus More...
 
ControlMultiTouchEventHandler MultiTouch
 Occurs when more than one Touch is active for the control More...
 
ControlCallbackHandler MultiTouchEnd
 Occurs when a touch is lifted and there is only one Touch now active for the control More...
 
PropertyChangedEventHandler
< float > 
OpacityChanged
 Occurs when the control's Opacity property value changes More...
 
PropertyChangedEventHandler
< dfPivotPoint
PivotChanged
 Occurs when the control's Pivot property value changes More...
 
PropertyChangedEventHandler
< Vector2 > 
PositionChanged
 Occurs when the control's Position property is changed More...
 
PropertyChangedEventHandler
< Vector2 > 
SizeChanged
 Occurs when the control's Size propert is changed More...
 
PropertyChangedEventHandler< int > TabIndexChanged
 Occurs when the control's TabIndex property is changed More...
 
PropertyChangedEventHandler< int > ZOrderChanged
 Occurs when the control's ZOrder property value changes More...
 

Member Function Documentation

dfControl dfControl.AddControl ( Type  controlType)

Creates a new dfControl instance of the specified type and adds it as a child of this instance

Parameters
controlTypeThe type of control to be created
Returns
A reference to the newly-created control instance

Implements IDFControlHost.

void dfControl.AddControl ( dfControl  child)

Adds the child control to the list of child controls for this instance

Parameters
childThe dfControl instance to add to the list of child controls

Implements IDFControlHost.

Creates a new dfControl instance of the specified type and adds it as a child of this instance

Template Parameters
TThe type of control to be created
Returns
A reference to the newly-created control instance

Implements IDFControlHost.

Type Constraints
T :dfControl 
dfControl dfControl.AddPrefab ( GameObject  prefab)

Instantiates a new instance of the specified prefab and adds it to the control hierarchy

Parameters
prefab
Returns

Implements IDFControlHost.

virtual void dfControl.BringToFront ( )
virtual

Brings this control to the front so that it appears in front of all other controls within the same container

virtual Vector2 dfControl.CalculateMinimumSize ( )
virtual

Used during layout to determine the effective minimum size of the control, which may be different than that specified by the MinimumSize property.

Returns
A Vector2 value that represents the minimum control size

Reimplemented in dfLabel, dfScrollbar, dfSprite, and dfInteractiveBase.

int dfControl.CompareTo ( dfControl  other)

Used to compare dfControl instances in order to sort them according to ZOrder value.

Parameters
otherThe other dfControl instance to compare against
Returns
A signed number indicating the relative values of this instance and value: Less than zero if this instance has a lower ZOrder value than other , greater than zero if this instance has a higher ZOrder value than other , and zero if both instances have the same ZOrder value
bool dfControl.Contains ( dfControl  child)

Retrieves a value indicating whether the specified control is a child of this control.

Parameters
childThe dfControl to evaluate
Returns
TRUE if the specified control is a child of the control and FALSE otherwise
void dfControl.Disable ( )

Disables the control. Bindable alternative to setting IsEnabled = false

void dfControl.DoClick ( )

Simulates the user clicking on the control

void dfControl.Enable ( )

Enable the control. Bindable alternative to setting IsEnabled = true

dfControl dfControl.Find ( string  controlName)

Performs a breadth-first search for a dfControl instance with the same name as the controlName argument. This search is case-sensitive.

Parameters
controlNameThe name of the dfControl you wish to find
Returns
TRUE if the dfControl was located, FALSE otherwise
T dfControl.Find< T > ( string  controlName)

Performs a breadth-first search for a dfControl instance with the same name as the controlName argument and which is of the specified Type. This search is case-sensitive.

Template Parameters
TThe Type of control to find (must derive from dfControl)
Parameters
controlNameThe name of the dfControl you wish to find
Returns
TRUE if the dfControl was located, FALSE otherwise
Type Constraints
T :dfControl 
void dfControl.Focus ( )

Sets the global input focus to this object

Vector3 dfControl.GetAbsolutePosition ( )

Returns the control's absolute position relative to the dfGUIManager instance that is hosting the control

Returns
Bounds dfControl.GetBounds ( )

Returns the axis-aligned bounding box enclosing this dfControl

Camera dfControl.GetCamera ( )

Returns a reference to the UnityEngine.Camera that is responsible for rendering this dfControl

Vector3 dfControl.GetCenter ( )

Returns a UnityEngine.Vector3 representing the global coordinates of the dfControl's center

Vector3 [] dfControl.GetCorners ( )

Returns an array of Vector3 values corresponding to the global positions of this object's bounding box. The corners are specified in the following order: Top Left, Top Right, Bottom Left, Bottom Right

Vector2 dfControl.GetHitPosition ( Ray  ray)

Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the ray argument.

bool dfControl.GetHitPosition ( Ray  ray,
out Vector2  position 
)

Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the position argument.

bool dfControl.GetHitPosition ( Ray  ray,
out Vector2  position,
bool  clamp 
)

Returns the relative position in screen coordinates (X increases to the right, Y increases downward, top-left origin) of the point where the ray intersects this control. Returns TRUE if the ray intersects the control and assigns the relative hit location to the position argument.

dfGUIManager dfControl.GetManager ( )

Returns a reference to the dfGUIManager instance that is responsible for rendering the control

dfControl dfControl.GetRootContainer ( )

Returns a reference to the top-most container for this control

Rect dfControl.GetScreenRect ( )

Returns the Screen-based coordinates containing this control

void dfControl.Hide ( )

Hide the control. Bindable alternative to setting IsVisible = false

bool dfControl.HitTest ( Ray  ray)

Returns TRUE if the indicated ray intersects the control, and FALSE otherwise

virtual void dfControl.Invalidate ( )
virtual

Called when the control needs to rebuild its render information

Reimplemented in dfLabel, dfButton, and dfRichTextLabel.

void dfControl.Localize ( )

Causes the control to use localized data for its (class-specific) properties.

void dfControl.MakePixelPerfect ( )

Causes this control to textAlign its Position and Size properties so that they lie exactly on pixel boundaries

void dfControl.MakePixelPerfect ( bool  recursive)

Causes this control to textAlign its Position and Size properties so that they lie exactly on pixel boundaries

virtual void dfControl.OnControlClippingChanged ( )
protectedvirtual
virtual void dfControl.OnRebuildRenderData ( )
protectedvirtual

Called by the dfControl class during rendering to allow any derived classes to rebuild the renderData buffer.

Reimplemented in dfScrollPanel, dfSlider, dfScrollbar, dfTabstrip, dfProgressBar, dfTextureSprite, dfSprite, dfTabContainer, dfPanel, dfResizeHandle, dfTiledSprite, dfSlicedSprite, and dfRadialSprite.

virtual void dfControl.OnTabKeyPressed ( dfKeyEventArgs  args)
protectedvirtual

Reimplemented in dfTextbox.

void dfControl.PerformLayout ( )

Causes this control to update its layout

float dfControl.PixelsToUnits ( )

Returns a number representing the conversion of World Units to pixels, used to convert a dfControl's "pixel-based" position and location properties into world units for rendering and raycasting purposes.

void dfControl.raiseMouseDownEvent ( dfMouseEventArgs  args)
protected
void dfControl.raiseMouseMoveEvent ( dfMouseEventArgs  args)
protected
void dfControl.raiseMouseWheelEvent ( dfMouseEventArgs  args)
protected
void dfControl.raiseSizeChangedEvent ( )
protected
void dfControl.RebuildControlOrder ( )

Removes any gaps in the ZOrder of child controls and sorts the Controls collection according to ZOrder

void dfControl.RemoveControl ( dfControl  child)

Removes the indicated control from the list of child controls for this instance

Parameters
childThe control to remove from the list of child controls
void dfControl.ResetLayout ( )

Causes the control to reset all layout information

Parameters
recursiveSet to TRUE if the layout information should be reset recursively
forceSet to TRUE to force the layout, even if SuspendLayout has been set to TRUE
void dfControl.ResetLayout ( bool  recursive,
bool  force 
)

Causes the control to reset all layout information

Parameters
recursiveSet to TRUE if the layout information should be reset recursively
forceSet to TRUE to force the layout, even if SuspendLayout has been set to TRUE
void dfControl.ResumeLayout ( )

Resumes usual layout logic

virtual void dfControl.SendToBack ( )
virtual

Sends this control to the back so that it appears behind all other controls within the same container

void dfControl.Show ( )

Show the control. Bindable alternative to setting IsVisible = true

void dfControl.SuspendLayout ( )

Temporarily suspends the layout logic for the control

void dfControl.Unfocus ( )

Removes global input focus from this object

Property Documentation

bool dfControl.AllowSignalEvents
getset

Gets or sets a value indicating whether this control can use Signal() to call event handlers via reflection. Defaults to TRUE.

dfAnchorStyle dfControl.Anchor
getset

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.

bool dfControl.AutoFocus
getset

Gets or sets whether the control will automatically be focused when enabled or shown

bool dfControl.ClipChildren
getset

Indicates whether child controls will be clipped to the bounds of this control

Color32 dfControl.Color
getset

Gets or sets the color of the control

virtual bool dfControl.ContainsFocus
get

Gets a value indicating whether the control, or one of its child controls, currently has the input focus.

bool dfControl.ContainsMouse
get

Returns TRUE when the mouse is contained within the bounds of the control

dfList<dfControl> dfControl.Controls
get

Gets the collection of controls contained within the control

UnityColor32 dfControl.DisabledColor
getset

Gets or sets the color that will be used when this control is disabled

dfGUIManager dfControl.GUIManager
get

Returns a reference to the dfGUIManager instance responsible for rendering this dfControl

virtual bool dfControl.HasFocus
get

Gets a value indicating whether the control has user input focus.

float dfControl.Height
getset

Gets or sets the height of the control in pixels

Vector2 dfControl.HotZoneScale
getset

Gets or sets the size (as a multiplier) of the "hot zone" around the control

bool dfControl.IsEnabled
getset

Gets or sets a value indicating whether the control can respond to user interaction.

virtual bool dfControl.IsInteractive
getset

Gets/Sets a value indicating whether the control is user-interactive, ie: Whether the control responds to user input. This flag controls whether the control has an current BoxCollider, because there are real performance implications for having a collider on a large number of controls that will never process user input.

bool dfControl.IsLayoutSuspended
getprotected

Returns a value indicating whether the dfControl's layout engine is currently suspended

bool dfControl.IsLocalized
getset

Gets or sets a value indicating whether this controls should use localized versions of its (class-specific) properties

bool dfControl.IsPerformingLayout
getprotected

Returns TRUE if the control is currently performing a layout operation and FALSE otherwise

bool dfControl.IsVisible
getset

Gets or sets a value indicating whether the control and all its child controls are displayed.

Vector2 dfControl.MaximumSize
getset

Gets or sets the maximum allowed size of the control

Vector2 dfControl.MinimumSize
getset

Gets or sets the minimum allowed size of the control

float dfControl.Opacity
getset

Gets or sets the opacity level of the control

dfControl dfControl.Parent
get

Gets the parent container of the control

dfPivotPoint dfControl.Pivot
getset

Gets or sets the Pivot Point of the control

Vector3 dfControl.Position
getset

Gets or sets the local position of the upper-left corner of the control relative to its container's pivot point

Vector3 dfControl.RelativePosition
getset

Returns the relative coordinates of the upper-left corner of the control relative to the upper-left corner of the parent control, expressed in "screen space" coordinates (left-top origin): x increases right, y increases down

int dfControl.RenderOrder
get

Returns the order in which this dfControl will be rendered.

Vector2 dfControl.Size
getset

Gets or sets the size (in pixels) of the control

int dfControl.TabIndex
getset

Gets or sets the tab order of the control within its container. Set this value to -1 to remove this control from the tab order.

object dfControl.Tag
getset

Can be used to store additional data about the control instance

string dfControl.Tooltip
getset

The tooltip to be displayed to the user when the mouse hovers over the control. Currently not used directly by this library.

float dfControl.Width
getset

Gets or sets the width of the control in pixels

int dfControl.ZOrder
getset

Gets/Sets a value indicating the rendering order of this control

Event Documentation

PropertyChangedEventHandler<dfAnchorStyle> dfControl.AnchorChanged

Occurs when the control's Anchor property value changes

MouseEventHandler dfControl.Click

Occurs when the control is clicked by the mouse

PropertyChangedEventHandler<Color32> dfControl.ColorChanged

Occurs when the control's Color value changes

ChildControlEventHandler dfControl.ControlAdded

Occurs when a control is added to the Controls collection

PropertyChangedEventHandler<bool> dfControl.ControlClippingChanged

Raised whenever the clipping state of the control is changed, such as when the control is moved from within the active clipping region to outside of the clipping region, or vice versa.

PropertyChangedEventHandler<bool> dfControl.ControlHidden

Occurs when a control's IsVisible property is changed to FALSE. This event does not bubble up the control hierarchy.

ChildControlEventHandler dfControl.ControlRemoved

Occurs when a control is removed from the Controls collection

PropertyChangedEventHandler<bool> dfControl.ControlShown

Occurs when a control's IsVisible property is changed to TRUE. This event does not bubble up the control hierarchy.

MouseEventHandler dfControl.DoubleClick

Occurs when the control is double clicked by the mouse

DragEventHandler dfControl.DragDrop

Occurs when a drag-and-drop operation is completed

DragEventHandler dfControl.DragEnd

Occurs (on the source dfControl) when a drag-and-drop operation has ended

DragEventHandler dfControl.DragEnter

Occurs when an object is dragged into the control's bounds

DragEventHandler dfControl.DragLeave

Occurs when an object is dragged out of the control's bounds

DragEventHandler dfControl.DragOver

Occurs when an object is dragged over the control's bounds

DragEventHandler dfControl.DragStart

Occurs (on the source dfControl) when a drag-and-drop operation is starting

FocusEventHandler dfControl.EnterFocus

Occurs when the control or any of its child controls receives input focus

FocusEventHandler dfControl.GotFocus

Occurs when the control receives input focus

PropertyChangedEventHandler<bool> dfControl.IsEnabledChanged

Occurs when the control's Enabled property value changes

PropertyChangedEventHandler<bool> dfControl.IsVisibleChanged

Occurs when the control's Visible property changes

KeyPressHandler dfControl.KeyDown

Occurs when the user presses a key while the control has input focus

KeyPressHandler dfControl.KeyPress

Occurs when the user presses a key while the control has input focus

KeyPressHandler dfControl.KeyUp

Occurs when the user releases a key while the control has input focus

FocusEventHandler dfControl.LeaveFocus

Occurs when the control and all of its child controls lose input focus

FocusEventHandler dfControl.LostFocus

Occurs when the control loses input focus

MouseEventHandler dfControl.MouseDown

Occurs when the mouse pointer is over the control and a mouse button is pressed

MouseEventHandler dfControl.MouseEnter

Occurs when the mouse pointer enters the control

MouseEventHandler dfControl.MouseHover

Occurs when the mouse pointer rests on the control

MouseEventHandler dfControl.MouseLeave

Occurs when the mouse pointer leaves the control

MouseEventHandler dfControl.MouseMove

Occurs when the mouse pointer is moved over the control

MouseEventHandler dfControl.MouseUp

Occurs when a mouse button had previously been pressed on a control and a mouse button is released while the pointer is still over the control

MouseEventHandler dfControl.MouseWheel

Occurs when the mouse wheel moves while the control has focus

ControlMultiTouchEventHandler dfControl.MultiTouch

Occurs when more than one Touch is active for the control

ControlCallbackHandler dfControl.MultiTouchEnd

Occurs when a touch is lifted and there is only one Touch now active for the control

PropertyChangedEventHandler<float> dfControl.OpacityChanged

Occurs when the control's Opacity property value changes

PropertyChangedEventHandler<dfPivotPoint> dfControl.PivotChanged

Occurs when the control's Pivot property value changes

PropertyChangedEventHandler<Vector2> dfControl.PositionChanged

Occurs when the control's Position property is changed

PropertyChangedEventHandler<Vector2> dfControl.SizeChanged

Occurs when the control's Size propert is changed

PropertyChangedEventHandler<int> dfControl.TabIndexChanged

Occurs when the control's TabIndex property is changed

PropertyChangedEventHandler<int> dfControl.ZOrderChanged

Occurs when the control's ZOrder property value changes