Please enable JavaScript to view this site.

KOL/MCK - User Guide

Align - "alignment" of the window object on the parent window. The values ​​are the same as in the VCL for the Align property available in the VCL for some window object classes. The main difference from VCL is that in KOL it is possible to align almost all types of "controls" (perhaps with a few exceptions, namely: it is undesirable to try to align the combo box in height, as this can lead to unpleasant consequences in Windows 9x). If an alignment is specified that is not equal to caNone, then some of the characteristics of the bounding rectangle (below) cannot be changed and is controlled by the alignment (for example, if the window is aligned to the left - caLeft, then it is possible to change only the window width, but not the height and not the coordinate of the upper left corner );

SetAlign(align) is a "pass-through" method that sets the Align property and returns a pointer to the window object itself. "Through" methods are convenient to use when creating window objects, for example:

NewButton (Panel1, 'Button1') .SetAlign (caLeft) .OnClick: = Click1;

 

BoundsRect - a rectangle that sets (and returns) the coordinates of the window object relative to the parent window (or relative to the entire screen - for top-level windows, i.e. for the form and applet); There are also properties for separately accessing / changing each of the window coordinates in terms of "top-left corner position" / "width" / "height":

 

Left - left coordinate of the window;

Top - the top coordinate of the window;

Width - window width;

Height - window height;

 

ControlRect - the same as BoundsRect, but calculated by the stored coordinates, and not by calling the API;

Position - coordinates of the upper left corner of the window as a point (TPoint);

ControlAtPos(X, Y, IgnoreDisabled) - determines which (child) visual object is located at the given coordinates;

OnMove - an event triggered when the coordinates change (when the window moves on the screen);

Dragging - checks if the object window is currently being "dragged" with the mouse (true after calling DragStartEx);

DragStart - starts "dragging" the object window (control or form) with the mouse. Dragging ends when the user releases the left mouse button (if at the time of the method call the left mouse button is not pressed, then dragging does not start);

DragStartEx - similar to the previous one, but to stop dragging from the program it is required (and possibly) to call the DragStopEx procedure;

PlaceRight - "through" method that places the current object to the right of the previous one in the list (at a distance specified by the property parent);

PlaceDown - "through" method, placing the object below the previous one, the left coordinate is set to the leftmost accessible position (Border + Margin of the parent), and the top coordinate is provided below the bottom edge of all previous visual objects;

PlaceUnder - the "pass-through" method, which places the object directly under the previous one (ignoring all the others previously placed);

Border - short integer (from –128 to +127) specifying the width of the parent window border. This property is used both for alignment purposes and for the above PlaceXXXX placement functions - to ensure the distance between the visual objects child with respect to this control. That is, unlike VCL, when aligning child visual objects, the space specified by the parent's Border property is provided between them. (See also the properties of MarginXXXX);

MarginTop - a short integer that specifies the additional distance (added with Border) from the top edge of the client part of the parent window to the first child window, when it is automatically placed (for example, when aligning child visual objects using the Align property). This number can be negative;

MarginBottom - similar to MarginTop, but sets an additional distance from the bottom edge of the parent visual object;

MarginLeft - similar to MargintTop, but for the left edge of the parent window;

MarginRight - similar to MarginTop, but for the right edge of the parent object;

SetSize(W, H) - "through" method, allows you to set a new window size (if W or H does not exceed zero, the corresponding size does not change);

Size(W, H) - similar to the previous one, but automatically resizes the parent window accordingly (and all parent windows - recursively);

AutoSize(on) - enables or disables automatic resizing of the window to its contents (unlike VCL, such automatic resizing in KOL takes place not only for the "label" TLabel, as in VCL, but for a slightly larger number of visual objects - buttons, check boxes and radio boxes, for example);

IsAutoSize - checks if automatic resizing is enabled for the object;

CanResize - sets whether the window can be resized (not only by the user with the mouse or from the window's system menu, but any API call will not be able to resize the window for which the CanResize property is set to false: you should be careful and set this value to false only after how the window is already sized). The MCK mirror of the form (class TKOLForm) has a corresponding design-time property CanResize, setting which to false will add false to the form's CanResize property in the form initialization code - after the form's dimensions are determined;

MinHeight - minimum window height;

MinWidth - minimum window width;

MaxHeight - maximum window height;

MaxWidth - maximum window width;

OnResize - an event triggered when the object window resizes, for any reason;

AnchorRight - setting this property to true results in the position of the right edge of the visual object being snapped to the size of the parent "control";

AnchorBottom - similar to the previous one, but snaps the bottom edge of the object to the height of the parent;

AnchorTop - similar to the previous ones, but anchors the window to the top edge of the parent;
AnchorLeft - the same, but snapping occurs to the left edge of the parent window;

Anchors(L, T, R, B) - "pass-through" method that allows you to set anchor AnchorLeft, AnchorTop, AnchorRight or AnchorBottom in one call;

ClientRect - returns the coordinates of the client side of the window. Because the result is returned in the coordinates of the client-side itself, then for all window objects, except for "graphic" ones, the Left and Top fields of the returned rectangle are always equal to 0;

ClientWidth - the width of the client side of the window (including it can be changed through this properties: the width of the entire window will be changed accordingly);

ClientHeight - similar to the previous property, the height of the client area of ​​the window;

SetClientSize(W, H) - similar to SetSize, but resizes in terms of the client side of the window;

Client2Screen(P) - translates the coordinates of a point from the client coordinate system to coordinates on the screen;

Screen2Client(P) - back to the Client2Screen method, for the specified coordinates on the screen, returns the client coordinates of the point.

 

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