Please enable JavaScript to view this site.

KOL/MCK - User Guide

label        label_effect

 

So one of the simplest objects of this kind is label. Label constructor:

 

NewLabel(Parent, s) - returns a pointer to the created object of the PControl type, which in the constructor receives the visual and behavioral features necessary for the label, and sets the passed parameter as the text (Caption) of the label. Almost all constructors of visual elements on a form (and this one as well) have a Parent parameter of the PControl type, which indicates which window object is the parent of the object created by this constructor.

 

To a large extent, the label in KOL is similar to the TLabel class in the VCL, but there is an important "but": in KOL, the label is a window object. There is also a graphical label, but it will be discussed later, along with all the other graphical (windowless) controls. In addition to the above general properties, methods and events, the label actually has nothing more and there is nothing that could be called characteristic only of the label. If it differs from its other TControl neighbors in any way, it is its behavior. namely: the label cannot have the input focus, the tab order (TabStop, TabOrder), so the keyboard keypress events do not make sense for it.

 

There is an additional restriction introduced solely for the convenience of manipulating objects at the design stage. The label, like many "leaf" controls, cannot become a parent for other visual objects *. If any window controls could become the parents of any visual objects, then when dropping controls from the component ruler onto the form, you would have to aim very carefully, looking for a place for a new child object. Now, in many cases, it is enough to get somewhere inside the future parent. Of course, when writing code manually (even in MCK), no one bothers to create controls, the parent of which is a label or a button.

 

There are two other flavors of window labels in KOL. Constructor:

 

NewWordWrapLabel(Parent, s) - creates a label with text wrapped by words when the text reaches the right border of the label. With the help of such a label, it is convenient to make multi-line explanatory inscriptions and messages on the form. There is a small peculiarity of using the AutoSize method for a label with word-by-word breaks: when automatically resizing it, it never changes its width, but only its height (this has nothing to do with alignment with the Align property, it is only about automatically adjusting the object's size to the content, in this case - for multi-line text).

 

Constructor:

 

NewLabelEffect(Parent, s, shadowdeep) - Creates a custom label with additional visual effects. The text in such a label can have a shadow that is drawn at a specified offset. The color of the shadow text uses the (optional) Color2 property of the TControl object. The most important feature of this label is that it is the only one capable of correctly displaying text in a font that has a non-zero rotation angle (FontOrientation) when rendering its content on its own. You can even animate the rotation of the text using this label (see the ADV demo application).

Note that the label must use a True Type font for the text to rotate. This applies not only to "labels with effects", but also drawing on the canvas with the changed FontOrientation property for the font.

 

Additional properties for controlling text label with effects in TControl:

 

ShadowDeep - shadow depth in pixels (can be negative or zero). Initially set as a parameter to the NewLabelEffect constructor;

 

TKOLLabel and TKOLLabelEffect mirrors are available for Cue and Cue Effects for use in MCK projects. There is no separate mirror for a “word wrap” label, the same TKOLLabel is used, you just need to set the wordWrap property to true using the Object Inspector.

 

KOL / MCK User Guide - Created by Carl Peeraer - Diamant Soft, based on the work of Vladimir Kladov - Artwerp.be

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC