IWidget
Description
Base interface for general-purpose application widgets.
Usually, an IApplication hosts one or more IWidget objects. Application input events are forwarded to widgets unmodified, i.e. the widget is responsible for translating them to its Bounds as necessary (e.g. using a BoundedInput object). Widgets are not required to limit their rendering to their bounds.
The ILocalizable.Localize2 will store the given labels in an own set that belongs to the widget. The ILocalizable.Localize1 method will delegate to the attached widget GUI (see IWidgetGuiConsumer.WidgetGuiAttach), if a label is not present in that set.
- See also
Extensions
Render2DWithSetup
Calls IRenderable2D.Render2D of this IWidget after having performed the necessary setup.
The setup involves these steps:
-
Call IBeginEnd.Begin on g in.
-
Set Graphics.Bounds of g in to IWidget.ActualBounds.
-
Delegate to IRenderable2D.Render2D of this widget, passing g in.
-
Call IBeginEnd.End on g in.
ToApplication
Wraps this IWidget in a IApplication object.
This widget must already be in the state LifecycleState.Initialized when this method is called, i.e. the caller is responsible for calling IWidgetSettings.Initialize.