Reference for the Mosaic class Views::Shadow

Views::Shadow
AlphaBlended
BlurRadius
Color
Embedded
Offset
Radius
RadiusBL
RadiusBR
RadiusTL
RadiusTR
Visible
Core::RectView
Bounds
Core::View
Layout
Owner
StackingPriority
AdjustDrawingArea()
ArrangeView()
ChangeViewState()
CursorHitTest()
Draw()
GetClipping()
GetExtent()
GetRoot()
HandleEvent()
MoveView()

SEE ALSO

Using the Shadow view to display blurred rectangular areas with solid color.

The class Views::Shadow provides a kind of view specialized to draw a rectangular shadow. The position and the size of the shadow are determined by the property Bounds. The corners of the displayed shadow can be rounded. For this purpose the property Radius can be used. Alternatively, the rounding for the corners can be configured individually by using the properties RadiusTL, RadiusTR, RadiusBR and RadiusBL.

The color to draw the shadow is defined by the property Color. The shadow may appear blurred at its edges. For this purpose the property BlurRadius is available. With the property Offset additional displacement for the shadow can be determined.

The visibility of the shadow is controlled by the properties Visible, AlphaBlended and Embedded. In particular the property Embedded can determine whether the corresponding view is limited (== embedded) to the boundary of a sibling Core::Outline view or not. The embedding of views within a Core::Outline allows a kind of sub-groups within the GUI component itself. Very useful for any kind of scrollable lists, menus, etc.

Please note, except the WebGL platform, the implementation uses a box blur algorithm without involving any GPU to perform the blur operation. This guarantees similar results on all target systems with the blur radius not being restricted to any discrete value. In case of the WebGL platform, the blur effect is performed natively using functionality available in the WebBrowser. The blur effect on a WebGL platform may differ therefore. Furthermore, the results on WebGL platform may differ depending on the used WebBrowser.

property bool AlphaBlended = true;

The property 'AlphaBlended' determines the drawing mode for the view. Views with disabled alpha-blending will override the affected screen areas. If this mode is enabled, the pixel of the view are combined with the origin screen content by alpha-blending.

property int32 BlurRadius = 4;

The property 'BlurRadius' determines the intensity of the blur filter effect to apply on the shadow. The value is expressed in pixel and its valid range is 0..64. Applying a blur filter enlarges the resulting shadow causing the shadow to appear outside the view's area determined originally by Bounds property.

property color Color = #000000FF;

The property 'Color' determines the color to render the shadow. Please note, if BlurRadius is greater than 0 the edges of the shadow will appear blurred. This means, the pixel at the edges will be displayed with the 'Color' value being modulated in its opacity according to the specified BlurRadius.

property bool Embedded = false;

The property 'Embedded' controls how the view should appear and behave within its superior Owner. If this property == 'true', the affected view will be embedded (limited) to the boundary of a preceding Core::Outline sibling view. This is as if the view had been embedded within this outline. Beside the appearance limitation of the outline boundary, the outline also provides more sophisticated arrangement mechanisms and the content scrolling. It is therefore useful to create scrollable menus or lists.

If this property is 'false', the view is considered as a regular view of its Owner - it doesn't belong to any outline.

property point Offset = <0,0>;

The property 'Offset' determines the displacement of the shadow expressed in pixel. If 'Offset' is <0,0> the shadow appears without any displacement surrounding the view's area symmetrically.

property int32 Radius = 0;

The property 'Radius' determines the radius for all four corners of a rounded shadow. If the value is equal or less than 0, no rounded corners are displayed resulting in an ordinary rectangle with sharp corners as shape for the shadow. Please note, the resulting radius is limited to half the shortest edge of the view.

This property is useful to configure all four corners at once so all of them are equally rounded. To configure individual radius for the corners use the properties RadiusTL, RadiusTR, RadiusBR and RadiusBL.

property int32 RadiusBL = 0;

The property 'RadiusBL' determines an individual radius for the bottom-left corner of a rounded shadow. If the value is equal or less than 0, the bottom-left corner is not rounded unless there is a value specified in the common property Radius.

Please note, if there is also a value specified in the property Radius, the resulting radius for the bottom-left corner is the sum of the values found in the property Radius and in the property RadiusBL. Furthermore, the resulting radius is limited to half the shortest edge of the view.

property int32 RadiusBR = 0;

The property 'RadiusBR' determines an individual radius for the bottom-right corner of a rounded shadow. If the value is equal or less than 0, the bottom-right corner is not rounded unless there is a value specified in the common property Radius.

Please note, if there is also a value specified in the property Radius, the resulting radius for the bottom-right corner is the sum of the values found in the property Radius and in the property RadiusBR. Furthermore, the resulting radius is limited to half the shortest edge of the view.

property int32 RadiusTL = 0;

The property 'RadiusTL' determines an individual radius for the top-left corner of a rounded shadow. If the value is equal or less than 0, the top-left corner is not rounded unless there is a value specified in the common property Radius.

Please note, if there is also a value specified in the property Radius, the resulting radius for the top-left corner is the sum of the values found in the property Radius and in the property RadiusTL. Furthermore, the resulting radius is limited to half the shortest edge of the view.

property int32 RadiusTR = 0;

The property 'RadiusTR' determines an individual radius for the top-right corner of a rounded shadow. If the value is equal or less than 0, the top-right corner is not rounded unless there is a value specified in the common property Radius.

Please note, if there is also a value specified in the property Radius, the resulting radius for the top-right corner is the sum of the values found in the property Radius and in the property RadiusTR. Furthermore, the resulting radius is limited to half the shortest edge of the view.

property bool Visible = true;

The property 'Visible' determines the visibility state of the view. Invisible views will not appear on the screen. Whether a view is really visible depends on the visibility of its Owner and the position of the view within the owners boundary area.