Reference for the Mosaic class Views::Frame

Views::Frame
AlphaBlended
Animated
Bitmap
Color
ColorBL
ColorBR
ColorTL
ColorTR
Edges
Embedded
Endless
FrameNumber
NoEdgesLimit
OnFinished
Opacity
Visible
StartAnimation
StopAnimation
Core::RectView
Bounds
Core::View
Layout
Owner
StackingPriority
ArrangeView()
ChangeViewState()
CursorHitTest()
Draw()
GetExtent()
GetRoot()
HandleEvent()
MoveView()

SEE ALSO

Using the Frame view to display rectangular borders composed of bitmaps.

The class Views::Frame provides a kind of view specialized to draw free scalable frames by composing them of bitmap segments. These segments are used to draw the frame's corners, to fill its edges and to fill its interior area. The bitmap has thus to contain nine equal segments arranged in three rows and three columns. The top-left segment e.g. is used to draw the top-left corner of the frame. In contrast, the top-middle segment corresponds to the frame's top edge. If the edge is wider than the segment, multiple copies of the segment are used to fill the entire edge. In this manner the entire frame is composed by simply copying bitmap segments. It's up to you to provide suitable bitmaps. The only thing you have to take in account when designing them is, that their size have to be a multiple of 3.

The bitmap is determined by the property Bitmap. In case of a multi-frame bitmap the desired frame can be selected by the property FrameNumber. Please don't confuse these multi-frame bitmaps with the frames described above. Multi-frame bitmaps, which are able to be animated can be controlled by the properties Animated and Endless. Alternatively, the animation can be controlled by sending signals to the slot methods StartAnimation and StopAnimation.

The position and the size of the area to draw the frame is determined by the property Bounds. The properties Color, ColorTL, ColorTR, ColorBL and ColorBR can be used to tint the frame or to modulate its transparency. For each view's corner different color can be set, so the frame can be shown with fancy color or opacity gradients. The particular effect of the colors depends on the type of the bitmap used to compose the frame:

With the properties Edges and NoEdgesLimit you can individually configure which edges of the frame view are displayed.

The visibility of the frame is controlled by the properties Visible, AlphaBlended, Opacity 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.

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 bool Animated = false;

The property 'Animated' determines whether the view may play animated bitmaps. Assigning the value 'true' to this property can cause the view to re-start the animated bitmap with the frame specified in the property FrameNumber. The value 'false' in contrast stops the running animated bitmap at its current position. The animation can also be controlled by sending signals to the slot methods StartAnimation and StopAnimation. Animated bitmaps are a special kind of bitmaps containing short video sequences. The animation can work with an animated bitmap only. See Resources::Bitmap.

property Resources::Bitmap Bitmap = null;

The property 'Bitmap' refers to the bitmap object to display in this view. If the bitmap consists of more than one frame, the desired frame number can be determined by the property FrameNumber. If the bitmap is animated, the animation will start if the property Animated is 'true'.

Please note, this bitmap is used to display free scalable frames by composing them of bitmap segments. These segments are used to draw the frame's corners, to fill its edges and to fill its interior area. The bitmap has thus to contain nine equal segments arranged in three rows and three columns. The top-left segment e.g. is used to draw the top-left corner of the frame. In contrast, the top-middle segment corresponds to the frame's top edge. If the edge is wider than the segment, multiple copies of the segment are used to fill the entire edge. In this manner the entire frame is composed by simply copying bitmap segments. It's up to you to provide suitable bitmaps. The only thing you have to take in account when designing them is, that their size have to be a multiple of 3.

property color Color = #FFFFFFFF;

The property 'Color' controls the color of the entire frame. Changes of this property will be immediately reflected in the properties ColorTL, ColorTR, ColorBL and ColorBR. Thus this property is useful if no gradients are desired.

The effect of this color value depends on the type of the bitmap specified in the Bitmap property:

property color ColorBL = #FFFFFFFF;

The property 'ColorBL' stores the color at the bottom-left corner of the view's Bounds area. The effect of this color value depends on the type of the bitmap specified in the Bitmap property:

property color ColorBR = #FFFFFFFF;

The property 'ColorBR' stores the color at the bottom-right corner of the view's Bounds area. The effect of this color value depends on the type of the bitmap specified in the Bitmap property:

property color ColorTL = #FFFFFFFF;

The property 'ColorTL' stores the color at the top-left corner of the view's Bounds area. The effect of this color value depends on the type of the bitmap specified in the Bitmap property:

property color ColorTR = #FFFFFFFF;

The property 'ColorTR' stores the color at the top-right corner of the view's Bounds area. The effect of this color value depends on the type of the bitmap specified in the Bitmap property:

property Graphics::Edges Edges = Graphics::Edges[Bottom, Interior, Left, Right, Top];

The property 'Edges' determines which edges of the frame should be drawn and which should be omitted.

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 bool Endless = true;

The property 'Endless' determines whether the view should play the animated bitmap endlessly. If this property is 'false', the animation will run only once after it has been started. If it is 'true' the animated bitmap will re-start automatically with the frame specified in the property FrameNumber.

property int32 FrameNumber = 0;

The property 'FrameNumber' determines the bitmap frame to display in this view. Each bitmap consists of either one or more frames (images). The first frame has the number 0, the second frame has the number 1, and so far. Bitmaps containing more than one frame are called multi-frame bitmaps. See Resources::Bitmap.

Changes of this property cause the view to switch the shown frame. If the desired frame is not available in the bitmap, no bitmap is shown. Additionally, the value stored in this property determines the frame to start an animation of an animated bitmap. The animation is controlled by the property Animated.

property point NoEdgesLimit = <0,0>;

The property 'NoEdgesLimit' determines the maximum size of the view up to which the edges deactivated explicitly in the property Edges are not displayed. For example, if you disable in the property Edges the 'Right' edge and you configure the property 'NoEdgesLimit' to the value <200,0>, the right edge will be invisible as long as the view is narrower than the specified width 200. Starting with 200 pixel width, the view displays again the right edge although it is deactivated in the Edges property.

The size constraints can be configured individually for the width and height of the view. If the corresponding value is 0 (zero), no limitation is applied. The property is typically useful to display resizable vertical/horizontal gauge bars.

property slot OnFinished = null;

The property 'OnFinished' can refer to a slot method, which should be invoked when the animation is done. It's up to you to provide the slot method and to fill it with the desired behavior. It makes possible to chain animations together, so the finish of one animation can trigger another animation. To do this simply assign the StartAnimation slot method of the one view to the OnFinished property of the other view.

property int32 Opacity = 255;

The property 'Opacity' controls the translucence of the view. This property can take values in range of 0 .. 255. If the value is 255, the view will appear with its full opacity. The value equal to zero results in a fully transparent view. Other values in the range 1 .. 254 show a semitransparent views.

slot StartAnimation;

The slot method 'StartAnimation' re-starts the animated bitmap if a signal is sent to this slot method. The animation will start with the frame specified in the property FrameNumber. Animated bitmaps are a special kind of bitmaps containing short video sequences. The method has no effect if the bitmap can't be animated. See Resources::Bitmap.

slot StopAnimation;

The slot method 'StopAnimation' stops the running animated bitmap if a signal is sent to this slot method. This causes the animation to pause at its current position. Animated bitmaps are a special kind of bitmaps containing short video sequences. See Resources::Bitmap.

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.