Control Effects

From Morfikwiki.com

Jump to: navigation, search

Morfik AppsBuilder offers a wide variety of special formatting effects that can be applied not only to bands and containers, but also to controls.

Contents

[edit] Sample of the Available Effects

Morfik effects can be used to create interesting design elements which will enrich you application or website's interface. The following pictures show some controls in their plain form and with one or more effects applied to them.

Figure 1 - This picture shows a plain container and the same container with the rounded corners and outer shadow effects applied to it.


Figure 2 - This picture shows a plain button and the same button with the rounded corners, inner shadow and reflection effects applied to it.

Several effects can be combined in the same control to create a totally new visual experience in your website. The Figure 3 shows a set of buttons such as the one seen in Figure 2, but with several effects applied to them in order to define a new look.

Figure 3 - This picture shows a set of three buttons which have had some effects applied to them in order to present the appearance of an interrelated set of options.

Note that in Figure 3 the buttons have had different but symmetrical effects applied to them in order to give the impression of being a single strip of controls with rounded corners on both sides.

Figure 4 - This picture shows a a container with the Gradient, Corners and Shadow effects applied and several controls. The view on the left is from the Form designer and the one on the right from a browser. Some of the TextLabel controls inside the container have the Antialiasing effect applied to them.


Figure 5 - This picture shows a a container with the Gradient, Corners and Shadow effects applied and several Buttons. The buttons have different variations of the Corners effect applied as to give the impression of continuous set.

[edit] Types of Effects Available

The following effects are available to be applied to different types of controls. Each control has a different set of effects that can be applied to it, according to how they are used in an application.

[edit] Combining Effects

All of these effects can be effectively combined in the same control (according to which ones are available for a specific control) in order to achieve a desired result. If fact, it is quite frequently the case of some controls. Button controls for example frequently have the Gradient and Corners effects applied to them. Figures 4 and 5 show good examples of combining the Gradient, Corners and Shadow effects in Container controls.

[edit] Applying effects to dynamically created controls

Morfik effects are determined at compile time and the corresponding images are generated at that point. This means that you cannot just have these effects applied to a control you create dynamically at runtime. You can, however, copy the background image of a pre-existing control to another control. The following code snippet shows how this can be achieved.


Procedure Content.Button1Click(Event: TDOMEvent);
Var
    cnt : Container;
Begin
    cnt := Container.Create('NewButton', Self);
    cnt.Attrs.Left := 100;
    cnt.Attrs.Top  := 100;
    cnt.Attrs.Height := Container1.Height;
    cnt.Attrs.Width := Container1.Width;
    cnt.Attrs.Background.Assign(Container1.Attrs.Background);
    cnt.CreateDomObject;
End;

[edit] See Also

[edit] Related Video

Personal tools