Class Widget
The base class of every user interface element.
Assembly: Ritchie.Toolbox.dll
public abstract class Widget : IFontFamilyProvider, IInspectable
Constructors
Declaration
Properties
Declaration
public Widget.BackgroundStyleProperties BackgroundStyle { get; set; }
Property Value
Declaration
public int ChildCount { get; }
Property Value
Declaration
protected IOrderedCollection<Widget> Children { get; }
Property Value
Declaration
public bool ClipSelf { get; set; }
Property Value
ClippedContentArea
Declaration
public LayoutRect? ClippedContentArea { get; }
Property Value
Declaration
public ClippingMode ClippingMode { get; set; }
Property Value
Declaration
public float ComputedOpacity { get; }
Property Value
Declaration
public Point ComputedPositionOffset { get; }
Property Value
Declaration
public Matrix ComputedTransformMatrix { get; }
Property Value
Declaration
public bool Enabled { get; set; }
Property Value
Declaration
public virtual GuiManager? GuiManager { get; }
Property Value
Declaration
public bool HierarchyEnabled { get; }
Property Value
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Declaration
public bool IsChildFocused { get; }
Property Value
Declaration
public bool IsFocused { get; }
Property Value
Declaration
public bool IsLayoutValid { get; }
Property Value
Declaration
public bool IsVisible { get; }
Property Value
Declaration
public LayoutRect LayoutArea { get; }
Property Value
Declaration
public Widget LayoutRoot { get; protected set; }
Property Value
Declaration
public Padding Margin { get; set; }
Property Value
Declaration
public int MaximumHeight { get; set; }
Property Value
Declaration
public Point MaximumSize { get; set; }
Property Value
Declaration
public int MaximumWidth { get; set; }
Property Value
Declaration
public int MinimumHeight { get; set; }
Property Value
Declaration
public Point MinimumSize { get; set; }
Property Value
Declaration
public int MinimumWidth { get; set; }
Property Value
Declaration
public Padding Padding { get; set; }
Property Value
Declaration
public LayoutRect PaintArea { get; }
Property Value
Declaration
public Widget? Parent { get; }
Property Value
PopoverContent
Declaration
public PopoverContent? PopoverContent { get; set; }
Property Value
Declaration
public PopoverLocationPreference PopoverLocation { get; set; }
Property Value
Declaration
public Point PositionOffset { get; set; }
Property Value
Declaration
public IWidgetEffect? RenderEffect { get; set; }
Property Value
Declaration
public float RenderOpacity { get; set; }
Property Value
Declaration
public Widget? Root { get; }
Property Value
Declaration
public Quaternion Rotation { get; set; }
Property Value
| Type |
Description |
| Quaternion |
|
Declaration
public Vector3 Scale { get; set; }
Property Value
Declaration
public ulong UniqueId { get; }
Property Value
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Declaration
public Visibility Visibility { get; set; }
Property Value
Declaration
public IVisualStyle? VisualStyleOverride { get; set; }
Property Value
Methods
ArrangeChildren(IGuiContext, LayoutRect)
Declaration
protected virtual void ArrangeChildren(IGuiContext context, LayoutRect availableSpace)
Parameters
Declaration
protected virtual void BeforeRender()
Declaration
public bool BelongsToParent(Widget widget)
Parameters
| Type |
Name |
Description |
| Widget |
widget |
|
Returns
Declaration
public bool ContainsChild(Widget? widget)
Parameters
| Type |
Name |
Description |
| Widget |
widget |
|
Returns
Declaration
public IEnumerable<Widget> EnumerateChildren()
Returns
GetCachedContentSize(Point)
Declaration
public Point GetCachedContentSize(Point availableSize)
Parameters
| Type |
Name |
Description |
| Point |
availableSize |
|
Returns
GetContentSize(Point)
Declaration
protected virtual Point GetContentSize(Point availableSize)
Parameters
| Type |
Name |
Description |
| Point |
availableSize |
|
Returns
Declaration
public T GetCustomProperties<T>() where T : CustomPropertyObject
Returns
Type Parameters
Declaration
public T GetCustomProperty<T>() where T : struct
Returns
Type Parameters
GetFont(PresetFontFamily)
Declaration
public IFontFamily GetFont(PresetFontFamily family)
Parameters
Returns
GetTextColor(ref Color, Color?)
Declaration
protected bool GetTextColor(ref Color color, Color? fallbackColor = null)
Parameters
| Type |
Name |
Description |
| Color |
color |
|
| Color? |
fallbackColor |
|
Returns
Declaration
protected void GetThemeProperties<TThemeProperties>(ref TThemeProperties properties, InvalidationMode invalidationMode = InvalidationMode.LayoutAndGeometry) where TThemeProperties : struct
Parameters
| Type |
Name |
Description |
| TThemeProperties |
properties |
|
| InvalidationMode |
invalidationMode |
|
Type Parameters
| Name |
Description |
| TThemeProperties |
|
Walks up the widget tree from this widget to the top-level, returning
the first visual style override that isn't null. If no widgets in the
path override the global visual style, then null will be returned.
Declaration
public IVisualStyle? GetVisualStyleOverride()
Returns
| Type |
Description |
| IVisualStyle |
The visual style override for this widget or one of its parents, or null if there are no overriding widgets.
|
Declaration
Declaration
public virtual void Inspect(IInspector inspector)
Parameters
Declaration
public void Invalidate(InvalidationMode invalidationMode)
Parameters
Declaration
public void InvalidateClipping(bool recursive = false)
Parameters
| Type |
Name |
Description |
| bool |
recursive |
|
Declaration
public void InvalidateGeometry(bool invalidateChildren = false)
Parameters
| Type |
Name |
Description |
| bool |
invalidateChildren |
|
Declaration
public void InvalidateLayout()
Declaration
public void InvalidateOwnLayout()
Declaration
public bool IsInsideClipRegion(Point point)
Parameters
| Type |
Name |
Description |
| Point |
point |
|
Returns
Declaration
protected virtual void RebuildClippingZone(GeometryHelper geometry)
Parameters
Declaration
protected virtual void RebuildGeometry(GeometryHelper geometry)
Parameters
Send a signal of type TSignal from this widget.
Declaration
protected bool SendSignal<TSignal>(TSignal signal, SignalDirection direction = SignalDirection.Up)
Parameters
| Type |
Name |
Description |
| TSignal |
signal |
The signal to send.
|
| SignalDirection |
direction |
A value indicating where to send the signal.
|
Returns
| Type |
Description |
| bool |
True if the signal was handled, false otherwise.
|
Type Parameters
| Name |
Description |
| TSignal |
The type of signal to send.
|
Declaration
public void SetCustomProperty<T>(T newValue) where T : struct
Parameters
| Type |
Name |
Description |
| T |
newValue |
|
Type Parameters
Declaration
protected virtual bool ShouldRenderChild(Widget childWidget)
Parameters
| Type |
Name |
Description |
| Widget |
childWidget |
|
Returns
UpdateLayout(IGuiContext, LayoutRect)
Declaration
public void UpdateLayout(IGuiContext context, LayoutRect availableSpace)
Parameters
Events
Declaration
public static event Action<Widget, LayoutRect>? WidgetRepainting
Event Type
Implements
Extension Methods