Component
Description
- Derived from
-
Disposable abstract
IInputConsumer
IUpdateableFrameTime
IGraphicsComponent
IRenderable2D
IScrollable
IHelpProvider
ILocalizable - Extended by
-
Choice sealed
Container
DocumentView sealed
ImageView sealed
PushButton abstract
ScrollBar sealed
Slider sealed
TextComponent abstract
Base class for all user interface components.
The visual style settings of a component are stored in a separate Stylesheet object, which may be accessed via Stylesheet.
Localized text labels of components are stored as visual styles (see Style.Label) in the stylesheets, using custom StyleClass values. As result, the lookup of localized text labels will cascade along the chain of parent components.
The default layout settings of a component are defined by LayoutDefault. Subclasses may override it, in order to define custom default layout settings. If they do so, the class documentation should list these values.
Public / Attributes
IsVisible
Is this component currently visible?
A component is visible if its state is not ComponentState.Hidden and its parent is also visible.
LayoutDefault
Returns the default Layout settings that are recommended for this component.
Subclasses may override this method, in order to define custom default layout settings. If they do so, the documentation of the declaring class should list these values.
The default implementation returns Layout.Default.
- See also
LayoutGrow
Defines how the layout grid column resp. row in the components parent container grows.
- See also
LayoutShrink
Defines how the layout grid column resp. row in the components parent container grows.
- See also
ParentCorners
Returns the corners that this component shares with the client area of its parent container.
ParentEdges
Returns the edges that this component shares with the client area of its parent container.
Stylesheet
The stylesheet object to use for this user interface element.
The Style class provides pre-defined stylesheet properties, which are used by the built-in GUI components. Client code may define any number of additional stylesheet properties, for use in custom GUI components. To access the stylesheet property values of a component, use the Get
, Set
and Unset
methods of the StyleProperty class.
Protected / Methods
ActionClick
The action click has been performed.
The default implementation simply calls ActionNotify.
- See also
ComputeLayoutBaseline
Computes the actual layout baseline of this component.
The default implementation returns the current value of Style.Baseline, which defaults to 0
, i.e. no baseline. Subclasses may return a different value.
Subclasses must call InvalidateLayout with LayoutAction.ComputeLayoutGridExtend to notify when ComputeLayoutBaseline returns a different value.
ComputeLayoutMargin
Computes the actual margin of this component.
The default implementation returns LayoutMargin. Subclasses can perform additional computations here.
Subclasses must call InvalidateLayout with LayoutAction.ComputeLayoutGridExtend to notify when ComputeLayoutMargin returns a different value.
ComputeLayoutSize
Computes the actual requested layout size of this component.
During layout computations, the ComputeLayoutSize will always be called first, so subclasses may compute and store information here and rely on that information later.
The default implementation returns the maximum of LayoutSize and the current value of the Style.Size style (which defaults to Vec2I.Zero) and adds the horizontal and vertical padding. Subclasses can perform additional computations here.
Subclasses must call InvalidateLayout with LayoutAction.ComputeLayoutGridExtend to notify when ComputeLayoutSize returns a different value.
ConsumeMouse
Processes the given input event.
The default implementation calls IFocusable.Focus if focusable (see Focusable) when pressing the left mouse button.
DoStylesheetApply
Applies the current stylesheet settings to this component.
Implementing methods should query fetch style property values and store them somewhere for using them later quickly.
All graphics resources that are acquired during DoStylesheetApply must be properly disposed in IGraphicsComponent.GraphicsDetach.
OnFocusChanged
This method is called when this component has lost or gained the input focus.
Depending on the value of IsFocussed when this method is called, the following holds true:
true
: the component has gained input focus.
false
: the component has gained input focus.