Please enable JavaScript to view this site.

KOL/MCK - User Guide

TControl( unit KOL.pas ) TObj _TObj

TControl = object( TObj )

 

TControl is the basic visual object of KOL. And now, all visual objects have the same type PControl, differing only in "constructor", which during creating of object adjusts it so it can play role of desired control. Idea of encapsulating of all visual objects having the most common set of properties, is belonging to Vladimir Kladov, (C) 2000.

Since all visual objects are represented in KOL by this single object type, not all methods, properties and events defined in TControl, are applicable to different visual objects. See also notes about certain control kinds, located together with its constructing functions definitions.

 

type PControl = ^ TControl;

Type of pointer to TControl visual object. All constructing functions New[ControlName] are returning pointer of this type. Do not forget about some difference of using objects from using classes. Identifier Self for methods of object is not of pointer type, and to pass pointer to Self, it is necessary to pass @Self instead. At the same time, to use pointer to object in 'WITH' operator, it is necessary to apply suffix '^' to pointer to get know to compiler, what do You want.

 

type TWindowFunc = function( Sender: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean;

Event type to define custom extended message handlers (as pointers to procedure entry points). Such handlers are usually defined like add-ons, extending behaviour of certain controls and attached using AttachProc method of TControl. If the handler detects, that it is necessary to stop further message processing, it should return True.

 

type TMouseButton =( mbNone, mbLeft, mbRight, mbMiddle );

Available mouse buttons. mbNone is useful to get know, that there were no mouse buttons pressed.

 

type TMouseEventData = packed Record

Record to pass it to mouse handling routines, assigned to OnMouseXXXX events.

 

Button: TMouseButton;


 

StopHandling: Boolean;

Set it to True in OnMouseXXXX event handler to

 

R1, R2: Byte;

Not used

 

Shift : DWORD;

HiWord( Shift ) = zDelta in WM_MOUSEWHEEL

 

X, Y : SmallInt;


end;

 

type TOnMouse = procedure( Sender: PControl; var Mouse: TMouseEventData ) of object;

Common mouse handling event type.

 

type TOnKey = procedure( Sender: PControl; var Key: Longint; Shift: DWORD ) of object;

Key events. Shift is a combination of flags MK_SHIFT, MK_CONTROL, MK_ALT. (See GetShiftState funtion).

 

type TOnChar = procedure( Sender: PControl; var Key: KOLChar; Shift: DWORD ) of object;

Char event. Shift is a combination of flags MK_SHIFT, MK_CONTROL, MK_ALT.

 

type TTabKey =( tkTab, tkLeftRight, tkUpDown, tkPageUpPageDn );

Available tabulating key groups.

 

type TTabKeys = Set of TTabKey;

Set of tabulating key groups, allowed to be used in with a control (are installed by TControl.LookTabKey property).

 

type TOnMessage = function( var Msg: TMsg; var Rslt: Integer ): Boolean of object;

Event type for events, which allows to extend behaviour of windowed controls descendants using add-ons.

 

type TOnEventAccept = procedure( Sender: PObj; var Accept: Boolean ) of object;

Event type for OnClose event.

 

type TCloseQueryReason =( qClose, qShutdown, qLogoff );

Request reason type to call OnClose and OnQueryEndSession.

 

type TWindowState =( wsNormal, wsMinimized, wsMaximized );

Avalable states of TControl's window object.

 

type TOnSplit = function( Sender: PControl; NewSize1, NewSize2: Integer ): Boolean of object;

Event type for OnSplit event handler, designed specially for splitter control. Event handler must return True to accept new size of previous (to splitter) control and new size of the rest of client area of parent.

 

type TTreeViewOption =( tvoNoLines, tvoLinesRoot, tvoNoButtons, tvoEditLabels, tvoHideSel, tvoDragDrop, tvoNoTooltips, tvoCheckBoxes, tvoTrackSelect, tvoSingleExpand, tvoInfoTip, tvoFullRowSelect, tvoNoScroll, tvoNonEvenHeight );

Tree view options.

 

type TTreeViewOptions = set of TTreeViewOption;

Set of tree view options.

 

type TOnTVBeginDrag = procedure( Sender: PControl; Item: THandle ) of object;

Event type for OnTVBeginDrag event (defined for tree view control).

 

type TOnTVBeginEdit = function( Sender: PControl; Item: THandle ): Boolean of object;

Event type for OnTVBeginEdit event (for tree view control).

 

type TOnTVEndEdit = function( Sender: PControl; Item: THandle; const NewTxt: KOL_String ): Boolean of object;

Event type for TOnTVEndEdit event.

 

type TOnTVExpanding = function( Sender: PControl; Item: THandle; Expand: Boolean ): Boolean of object;

Event type for TOnTVExpanding event.

 

type TOnTVExpanded = procedure( Sender: PControl; Item: THandle; Expand: Boolean ) of object;

Event type for OnTVExpanded event.

 

type TOnTVDelete = procedure( Sender: PControl; Item: THandle ) of object;

Event type for OnTVDelete event.

 

type TOnTVSelChanging = function( Sender: PControl; oldItem, newItem: THandle ): Boolean of object;

When the handler returns False, selection is not changed.

 

type TOnDrag = function( Sender: PControl; ScrX, ScrY: Integer; var CursorShape: Integer; var Stop: Boolean ): Boolean of object;

Event, called during dragging operation (it is initiated with method Drag, where callback function of type TOnDrag is passed as a parameter). Callback function receives Stop parameter True, when operation is finishing. Otherwise, it can set it to True to force finishing the operation (in such case, returning False means cancelling drag operation, True - successful drag and in this last case callback is no more called). During the operation, when input Stop value is False, callback function can control Cursor shape, and return True, if the operation can be finished successfully at the given ScrX, ScrY position. ScrX, ScrY are screen coordinates of the mouse cursor.

 

type TCreateParams = packed record

Record to pass it through CreateSubClass method.

 

Caption: PKOLChar;


 

Style: cardinal;


 

ExStyle: cardinal;


 

X, Y: Integer;


 

Width, Height: Integer;


 

WndParent: HWnd;


 

Param: Pointer;


 

WindowClass: TWndClass;


 

WinClassName: array[0.array.63] of KOLChar;


end;

 

type TTextAlign =( taLeft, taRight, taCenter );

Text alignments available.

 

type TRichTextAlign =( raLeft, raRight, raCenter, raJustify, raInterLetter, raScaled, raGlyphs, raSnapGrid );

Text alignment styles, available for RichEdit control.

 

type TVerticalAlign =( vaTop, vaCenter, vaBottom );

Vertical alignments available.

 

type TControlAlign =( caNone, caLeft, caTop, caRight, caBottom, caClient );

Control alignments available.

 

type TBitBtnOption =( bboImageList, bboNoBorder, bboNoCaption, bboFixed, bboFocusRect );

Options available for NewBitBtn.

 

type TBitBtnOptions = set of TBitBtnOption;

Set of options, available for NewBitBtn.

 

type TGlyphLayout =( glyphLeft, glyphTop, glyphRight, glyphBottom, glyphOver );

Layout of glyph (for NewBitBtn). Layout glyphOver means that text is drawn over glyph.

 

type TOnBitBtnDraw = function( Sender: PControl; BtnState: Integer ): Boolean of object;

Event type for TControl.OnBitBtnDraw event (which is called just before drawing the BitBtn). If handler returns True, there are no drawing occure. BtnState, passed to a handler, determines current button state and can be following: 0 - not pressed, 1 - pressed, 2 - disabled, 3 - focused. Value 4 is reserved for highlight state (then mouse is over it), but highlighting is provided only if property Flat is set to True (or one of events OnMouseEnter / OnMouseLeave is assigned to something).

 

type TListViewStyle =( lvsIcon, lvsSmallIcon, lvsList, lvsDetail, lvsDetailNoHeader );

Styles of view for ListView control (see NewListVew).

 

type TListViewItemStates = ( lvisFocus, lvisSelect, lvisBlend, lvisHighlight );

 

type TListViewItemState = Set of TListViewItemStates;

 

type TOnEditLVItem = function( Sender: PControl; Idx, Col: Integer; NewText: PKOL_Char ): Boolean of object;

Event type for OnEndEditLVItem. Return True in handler to accept new text value.

 

type TOnDeleteLVItem = procedure( Sender: PControl; Idx: Integer ) of object;

Event type for OnDeleteLVItem event.

 

type TOnLVData = procedure( Sender: PControl; Idx, SubItem: Integer; var Txt: KOL_String; var ImgIdx: Integer; var State: DWORD; var Store: Boolean ) of object;

Event type for OnLVData event. Used to provide virtual list view control (i.e. having lvoOwnerData style) with actual data on request. Use parameter Store as a flag if control should store obtained data by itself or not.

 

type TOnCompareLVItems = function( Sender: PControl; Idx1, Idx2: Integer ): Integer of object;

Event type to compare two items of the list view (while sorting it).

 

type TOnLVColumnClick = procedure( Sender: PControl; Idx: Integer ) of object;

Event type for OnColumnClick event.

 

type TOnLVStateChange = procedure( Sender: PControl; IdxFrom, IdxTo: Integer; OldState, NewState: DWORD ) of object;

Event type for OnLVStateChange event, called in responce to select/unselect a single item or items range in list view control).

 

type TOnLVCustomDraw = function( Sender: PControl; DC: HDC; Stage: DWORD; ItemIdx, SubItemIdx: Integer; const Rect: TRect; ItemState: TDrawState; var TextColor, BackColor: TColor ): DWORD of object;

Event type for OnLVCustomDraw event.

 

type TWherePosLVItem = ( lvwpOnIcon, lvwpOnLabel, lvwpOnStateIcon, lvwpOnColumn, lvwpOnItem );

 

type TEdgeStyle =( esRaised, esLowered, esNone, esTransparent, esSolid );

Edge styles (for panel - see NewPanel). esTransparent and esSolid - special styles equivalent to esNone except GRushControls are used via USE_GRUSH symbol (ToGRush.pas)

 

type TGradientStyle =( gsVertical, gsHorizontal, gsRectangle, gsElliptic, gsRombic, gsTopToBottom, gsBottomToTop );

Gradient fill styles. See also TGradientLayout.

 

type TGradientLayout =( glTopLeft, glTop, glTopRight, glLeft, glCenter, glRight, glBottomLeft, glBottom, glBottomRight );

Position of starting line / point for gradient filling. Depending on TGradientStyle, means either position of first line of first rectangle (ellipse) to be expanded in a loop to fit entire gradient panel area.

 

type TProgressbarOption =( pboVertical, pboSmooth );

Options for progress bar.

 

type TProgressbarOptions = set of TProgressbarOption;

Set of options available for progress bar.

 

type TEditOption =( eoNoHScroll, eoNoVScroll, eoLowercase, eoMultiline, eoNoHideSel, eoOemConvert, eoPassword, eoReadonly, eoUpperCase, eoWantReturn, eoWantTab, eoNumber );

Available edit options.

Please note, that eoWantTab option just removes TAB key from a list of keys available to tabulate from the edit control. To provide insertion of tabulating key, do so in TControl.OnChar event handler. Sorry for inconvenience, but this is because such behavior is not must in all cases. See also TControl.EditTabChar property.

 

type TEditOptions = Set of TEditOption;

Set of available edit options.

 

type TRichFmtArea =( raSelection, raWord, raAll );

Characters formatting area for RichEdit.

 

type TRETextFormat =( reRTF, reText, rePlainRTF, reRTFNoObjs, rePlainRTFNoObjs, reTextized, reUnicode, reTextUnicode );

Available formats for transfer RichEdit text using property TControl.RE_Text.

 

reRTF

- normal rich text (no transformations)

reText

- plain text only (without OLE objects)

reTextized

- plain text with text representation of COM objects

rePlainRTF

- reRTF without language-specific keywords

reRTFNoObjs

- reRTF without OLE objects

rePlainRTFNoObjs

- rePlainRTF without OLE objects

reUnicode

- stream is 2-byte Unicode characters rather then 1-byte Ansi

 

type TRichUnderline =( ruSingle, ruWord, ruDouble, ruDotted, ruDash, ruDashDot, ruDashDotDot, ruWave, ruThick, ruHairLine );

Rich text exteded underline styles (available only for RichEdit v2.0, and even for RichEdit v2.0 additional styles can not displayed - but ruDotted under Windows2000 is working).

 

type TRichTextSizes =( rtsNoUseCRLF, rtsNoPrecise, rtsClose, rtsBytes );

Options to calculate size of rich text. Available only for RichEdit2.0 or higher.

 

type TRichTextSize = set of TRichTextSizes;

Set of all available optioins to calculate rich text size using property TControl.RE_TextSize[ options ].

 

type TRichNumbering =( rnNone, rnBullets, rnArabic, rnLLetter, rnULetter, rnLRoman, rnURoman );

Advanced numbering styles for paragraph (RichEdit).

 

rnNone

- no numbering

rnBullets

- bullets only

rnArabic

- 1, 2, 3, 4, ...

rnLLetter

- a, b, c, d, ...

rnULetter

- A, B, C, D, ...

rnLRoman

- i, ii, iii, iv, ...

rnURoman

- I, II, III, IV, ...

rnNoNumber

- do not show any numbers (but numbering is taking place).

 

type TRichNumBrackets =( rnbRight, rnbBoth, rnbPeriod, rnbPlain, rnbNoNumber );

Brackets around number:

 

rnbRight

- 1) 2) 3)     - this is default !

rnbBoth

- (1) (2) (3)

rnbPeriod

- 1. 2. 3.

rnbPlain

- 1 2 3

 

type TBorderEdge =( beLeft, beTop, beRight, beBottom );

Borders of rectangle.

 

type TOnTestMouseOver = function( Sender: PControl ): Boolean of object;

Event type for TControl.OnTestMouseOver event. The handler should return True, if it detects if the mouse is over control.

 

type TDrawStates =( odsSelected, odsGrayed, odsDisabled, odsChecked, odsFocused, odsDefault, odsHotlist, odsInactive, odsNoAccel, odsNoFocusRect, ods400reserved, ods800reserved, odsComboboxEdit, odsMarked, odsIndeterminate );

Possible draw states.

 

odsSelected

- The menu item's status is selected.

odsGrayed

- The item is to be grayed. This bit is used only in a menu.

odsDisabled

- The item is to be drawn as disabled.

odsChecked

- The menu item is to be checked. This bit is used only in a menu.

odsFocused

- The item has the keyboard focus.

odsDefault

- The item is the default item.

odsHotList

- Windows 98, Windows 2000: The item is being hot-tracked, that is, the item will be highlighted when the mouse is on the item.

odsInactive

- Windows 98, Windows 2000: The item is inactive and the window associated with the menu is inactive.

odsNoAccel

- Windows 2000: The control is drawn without the keyboard accelerator cues.

odsNoFocusRect

- Windows 2000: The control is drawn without focus indicator cues.

odsComboboxEdit

- The drawing takes place in the selection field (edit control) of an owner-drawn combo box.

odsMarked

- for Common controls only. The item is marked. The meaning of this is up to the implementation.

odsIndeterminate

- for Common Controls only. The item is in an indeterminate state.

 

type TDrawState = Set of TDrawStates;

Set of possible draw states.

 

type TOnDrawItem = function( Sender: PObj; DC: HDC; const Rect: TRect; ItemIdx: Integer; DrawAction: TDrawAction; ItemState: TDrawState ): Boolean of object;

Event type for OnDrawItem event (applied to list box, combo box, list view).

 

type TOnMeasureItem = function( Sender: PObj; Idx: Integer ): Integer of object;

Event type for OnMeasureItem event. The event handler must return height of list box item as a result.

 

type TListOption =( loNoHideScroll, loNoExtendSel, loMultiColumn, loMultiSelect, loNoIntegralHeight, loNoSel, loSort, loTabstops, loNoStrings, loNoData, loOwnerDrawFixed, loOwnerDrawVariable, loHScroll );

Options for ListBox (see NewListbox). To use loHScroll, you also have to send LB_SETHORIZONTALEXTENT with a maximum width of a line in pixels (wParam)!

 

type TListOptions = Set of TListOption;

Set of available options for Listbox.

 

type TComboOption =( coReadOnly, coNoHScroll, coAlwaysVScroll, coLowerCase, coNoIntegralHeight, coOemConvert, coSort, coUpperCase, coOwnerDrawFixed, coOwnerDrawVariable, coSimple );

Options for combobox.

 

type TComboOptions = Set of TComboOption;

Set of options available for combobox.

 

type TToolbarOption =( tboTextRight, tboTextBottom, tboFlat, tboTransparent, tboWrapable, tboNoDivider, tbo3DBorder, tboCustomErase );

Toolbar options. When tboFlat is set and toolbar is placed onto panel, set its property Transparent to TRUE to provide its correct view.

 

type TToolbarOptions = Set of TToolbarOption;

Set of toolbar options.

 

type TOnToolbarButtonClick = procedure( Sender: PControl; BtnID: Integer ) of object;

Special event type to handle separate toolbar buttons click events.

 

type TOnTBCustomDraw = function( Sender: PControl; var NMCD: TNMTBCustomDraw ): Integer of object;

Event type for OnTBCustomDraw event.

 

type TTabControlOption =( tcoButtons, tcoFixedWidth, tcoFocusTabs, tcoIconLeft, tcoLabelLeft, tcoMultiline, tcoMultiselect, tcoFitRows, tcoScrollOpposite, tcoBottom, tcoVertical, tcoFlat, tcoHotTrack, tcoBorder, tcoOwnerDrawFixed );

Options, available for TabControl.

 

type TTabControlOptions = set of TTabControlOption;

Set of options, available for TAbControl during its creation (by NewTabControl function).

 

type TDateTimePickerOption =( dtpoTime, dtpoDateLong, dtpoUpDown, dtpoRightAlign, dtpoShowNone, dtpoParseInput );

 

type TDateTimePickerOptions = set of TDateTimePickerOption;

 

function GetShiftState: DWORD;

Returns shift state.

 

 

TControl properties

 

property Parent: PControl;

Parent of TParent object. Also must be of TParent type or derived from TParent.

 

property Enabled: Boolean;

Enabled usually used to decide if control can get keyboard focus or been clicked by mouse.

 

property Visible: Boolean;

Obvious.

 

property ToBeVisible: Boolean;  

Returns True, if a control is supposed to be visible when its form is showing.

 

property CreateVisible: Boolean;

False by default. If You want your form to be created visible and flick due creation, set it to True. This does not affect size of executable anyway.

 

property BoundsRect: TRect;

Bounding rectangle of the visual. Coordinates are relative to top left corner of parent's ClientRect, or to top left corner of screen (for TForm).

 

property Left: Integer;

Left horizontal position.

 

property Top: Integer;

Top vertical position.

 

property Width: Integer;

Width of TVisual object.

 

property Height: Integer;

Height of TVisual object.

 

property Position: TPoint;

Represents top left position of the object. See also BoundsRect.

 

property MinWidth: SmallInt;

Minimal width constraint.

 

property MinHeight: SmallInt;

Minimal height constraint.

 

property MaxWidth: SmallInt;

Maximal width constraint.

 

property MaxHeight: SmallInt;

Maximal height constraint.

 

property ClientWidth: Integer;

Obvious. Accessing this property, program forces window latent creation.

 

property ClientHeight: Integer;

Obvious. Accessing this property, program forces window latent creation.

 

property Windowed: Boolean;

Constantly returns True, if object is windowed (i.e. owns correspondent window handle). Otherwise, returns False.

By now, all the controls are windowed (there are no controls in KOL, which are emulating window, acually belonging to Parent - like TGraphicControl in VCL).

Writing of this property provided only for internal purposes, do not change it directly unless you understand well what you do.

 

property ChildCount: Integer;  

Returns number of commonly accessed child objects.

 

property Children[ Idx: Integer ]: PControl;    

Child items of TVisual object. Property is reintroduced here to separate access to always visible Children[] from restricted a bit Members[].

 

property WindowedParent: PControl;      

Returns nearest windowed parent, the same as Parent.

 

property ActiveControl: PControl;

 

property Handle: HWnd;  

Returns descriptor of system window object. If window is not yet created, 0 is returned. To allocate handle, call CreateWindow method.

 

property ParentWindow: HWnd;    

Returns handle of parent window (not TControl object, but system window object handle).

 

property ClsStyle: DWord;

 

Window class style. Available styles are:

CS_BYTEALIGNCLIENT

Aligns the window's client area on the byte boundary (in the x direction) to enhance performance during drawing operations.

CS_BYTEALIGNWINDOW

Aligns a window on a byte boundary (in the x direction).

CS_CLASSDC

Allocates one device context to be shared by all windows in the class.

CS_DBLCLKS

Sends double-click messages to the window procedure when the user double-clicks the mouse while the cursor is within a window belonging to the class.

CS_GLOBALCLASS

Allows an application to create a window of the class regardless of the value of the hInstance parameter.

You can create a global class by creating the window class in a dynamic-link library (DLL) and listing the name of the DLL in the registry under specific keys.

CS_HREDRAW

Redraws the entire window if a movement or size adjustment changes the width of the client area.

CS_NOCLOSE

Disables the Close command on the System menu.

CS_OWNDC

Allocates a unique device context for each window in the class.

CS_PARENTDC

Sets the clipping region of the child window to that of the parent window so that the child can draw on the parent.

CS_SAVEBITS

Saves, as a bitmap, the portion of the screen image obscured by a window. Windows uses the saved bitmap to re-create the screen image when the window is removed.

CS_VREDRAW

Redraws the entire window if a movement or size adjustment changes the height of the client area.

For more info, see Win32.hlp (keyword 'WndClass');

 

property Style: DWord;

Window styles. Available styles are:

 

WS_BORDER

Creates a window that has a thin-line border.

WS_CAPTION

Creates a window that has a title bar (includes the WS_BORDER style).

WS_CHILD

Creates a child window. This style cannot be used with the WS_POPUP style.

WS_CHILDWINDOW

Same as the WS_CHILD style.

WS_CLIPCHILDREN

Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.

WS_CLIPSIBLINGS

Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.

WS_DISABLED

Creates a window that is initially disabled. A disabled window cannot receive input from the user.

WS_DLGFRAME

Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.

WS_GROUP

Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.

WS_HSCROLL

Creates a window that has a horizontal scroll bar.

WS_ICONIC

Creates a window that is initially minimized. Same as the WS_MINIMIZE style.

WS_MAXIMIZE

Creates a window that is initially maximized.

WS_MAXIMIZEBOX

Creates a window that has a Maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

WS_MINIMIZE

Creates a window that is initially minimized. Same as the WS_ICONIC style.

WS_MINIMIZEBOX

Creates a window that has a Minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

WS_OVERLAPPED

Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.

WS_OVERLAPPEDWINDOW

Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.

WS_POPUP

Creates a pop-up window. This style cannot be used with the WS_CHILD style.

WS_POPUPWINDOW

Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.

WS_SIZEBOX

Creates a window that has a sizing border. Same as the WS_THICKFRAME style.

WS_SYSMENU

Creates a window that has a window-menu on its title bar. The WS_CAPTION style must also be specified.

WS_TABSTOP

Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.

WS_THICKFRAME

Creates a window that has a sizing border. Same as the WS_SIZEBOX style.

WS_TILED

Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.

WS_TILEDWINDOW

Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style.

WS_VISIBLE

Creates a window that is initially visible.

WS_VSCROLL

Creates a window that has a vertical scroll bar.

See also Win32.hlp (topic CreateWindow).

 

property ExStyle: DWord;

Extra window styles. Available flags are following:

 

WS_EX_ACCEPTFILES

Specifies that a window created with this style accepts drag-drop files.

WS_EX_APPWINDOW

Forces a top-level window onto the taskbar when the window is minimized.

WS_EX_CLIENTEDGE

Specifies that a window has a border with a sunken edge.

WS_EX_CONTEXTHELP

Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window.WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.

WS_EX_CONTROLPARENT

Allows the user to navigate among the child windows of the window by using the TAB key.

WS_EX_DLGMODALFRAME

Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.

WS_EX_LEFT

Window has generic "left-aligned" properties. This is the default.

WS_EX_LEFTSCROLLBAR

If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored and not treated as an error.

WS_EX_LTRREADING

The window text is displayed using Left to Right reading-order properties. This is the default.

WS_EX_MDICHILD

Creates an MDI child window.

WS_EX_NOPARENTNOTIFY

Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.

WS_EX_OVERLAPPEDWINDOW

Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.

WS_EX_PALETTEWINDOW

Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.

WS_EX_RIGHT

Window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading order alignment; otherwise, the style is ignored and not treated as an error.

WS_EX_RIGHTSCROLLBAR

Vertical scroll bar (if present) is to the right of the client area. This is the default.

WS_EX_RTLREADING

If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the window text is displayed using Right to Left reading-order properties. For other languages, the style is ignored and not treated as an error.

WS_EX_STATICEDGE

Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.

WS_EX_TOOLWINDOW

Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB.

WS_EX_TOPMOST

Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.

WS_EX_TRANSPARENT

Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated.

WS_EX_WINDOWEDGE

Specifies that a window has a border with a raised edge.

See also Win32.hlp (topic CreateWindowEx).

 

property Cursor: HCursor;

Current cursor. For most of controls, sets initially to IDC_ARROW. See also ScreenCursor.

 

property Icon: HIcon;

Icon. By default, icon of the Applet is used. To load icon from the resource, use IconLoad or IconLoadCursor method - this is more correct, because in such case a special flag is set to prevent attempts to destroy shared icon object in the destructor of the control.

 

property Menu: HMenu;

Menu (or ID of control - for standard GUI controls).

 

property HelpContext: Integer;

Help context.

 

property HelpPath: KOLString;

Property of a form or an Applet. Change it to provide custom path to WinHelp format help file. If HtmlHelp used, call global procedure AssignHtmlHelp instead.

 

property Caption: KOLString;

Caption of a window. For standard Windows buttons, labels and so on not a caption of a window, but text of the window.

 

property Text: KOLString;

The same as Caption. To make more convenient with Edit controls. For Rich Edit control, use property RE_Text.

 

property SelStart: Integer;

Start of selection (editbox - character position).

 

property SelLength: Integer;

Length of selection (editbox - number of characters selected, multiselect listbox or listview - number of items selected).

Note, that for combobox and single-select listbox it always returns 0 (though for single-select listview, returns 1, if there is an item selected).

It is possible to set SelLength only for memo and richedit controls.

 

property Selection: KOLString;

Selected text (editbox, richedit) as string. Can be useful to replace selection. For rich edit, use RE_Text[ reText, TRUE ], if you want to read correctly characters from another locale then ANSI only.

 

property CurIndex: Integer;

Index of current item (for listbox, combobox) or button index pressed or dropped down (for toolbar button, and only in appropriate event handler call).

You cannot use it to set or remove a selection in a multiple-selection list box, so you should set option loNoExtendSel to true.

In OnClick event handler, CurIndex has not yet changed for listbox or combobox. Use OnSelChange to respond to selection changes.

 

property Count: Integer;

Number of items (listbox, combobox, listview) or lines (multiline editbox, richedit control) or buttons (toolbar). It is possible to assign a value to this property only for listbox control with loNoData style and for list view control with lvoOwnerData style (virtual list box and list view).

 

property Items[ Idx: Integer ]: KOLString;

Obvious. Used with editboxes, listbox, combobox. With list view, use property LVItems instead.

 

property ItemSelected[ ItemIdx: Integer ]: Boolean;

Returns True, if a line (in editbox) or an item (in listbox, combobox, listview) is selected. Can be set only for listboxes. For listboxes, which are not multiselect, and for combo lists, it is possible only to set to True, to change selection.

 

property ItemData[ Idx: Integer ]: DWORD;

Access to user-defined data, associated with the item of a list box and combo box.

 

property DroppedWidth: Integer;

Allows to change width of dropped down items list for combobox (only!) control.

 

property DroppedDown: Boolean;

Dropped down state for combo box. Set it to TRUE or FALSE to change dropped down state.

 

property BitBtnDrawMnemonic: Boolean;

Set this property to TRUE to provide correct drawing of bit btn control caption with '&' characters (to remove such characters, and underline follow ones).

 

property TextShiftX: Integer;

Horizontal shift for bitbtn text when the bitbtn is pressed.

 

property TextShiftY: Integer;

Vertical shift for bitbtn text when the bitbtn is pressed.

 

property BitBtnImgIdx: Integer;

BitBtn image index for the first image in list view, used as bitbtn image. It is used only in case when BitBtn is created with bboImageList option.

 

property BitBtnImgList: THandle;

BitBtn Image list. Assign image list handle to change it.

 

property DefaultBtn: Boolean;

Set this property to true to make control clicked when ENTER key is pressed. This property uses OnMessage event of the parent form, storing it into fOldOnMessage field and calling in chain. So, assign default button after setting OnMessage event for the form.

 

property CancelBtn: Boolean;

Set this property to true to make control clicked when escape key is pressed. This property uses OnMessage event of the parent form, storing it into fOldOnMessage field and calling in chain. So, assign cancel button after setting OnMessage event for the form.

 

property IgnoreDefault: Boolean;

Change this property to TRUE to ignore default button reaction on press ENTER key when a focus is grabbed of the control. Default value is different for different controls. By default, DefaultBtn ignored in memo, richedit (even if read-only).

 

property Color: TColor;

Property Color is one of the most common for all visual elements (like form, control etc.) Please note, that standard GUI button can not change its color and the most characteristics of the Font. Also, standard button can not become Transparent. Use bitbtn for such purposes. Also, changing Color property for some kinds of control has no effect (rich edit, list view, tree view, etc.). To solve this, use native (for such controls) color property, or call Perform method with appropriate message to set the background color.

 

property Font: PGraphicTool;    

If the Font property is not accessed, correspondent TGraphicTool object is not created and its methods are not included into executable. Leaving properties Font and Brush untouched can economy executable size a lot.

 

property Brush: PGraphicTool;  

If not accessed, correspondent TGraphicTool object is not created and its methods are not referenced. See also note on Font property.

 

property Ctl3D: Boolean;

Inheritable from parent controls to child ones.

 

property ModalResult: Integer;

Modal result. Set it to value<>0 to stop modal dialog. By agreement, value 1 corresponds 'OK', 2 - 'Cancel'. But it is totally by decision of yours how to interpret this value.

 

property Modal: Boolean;    

TRUE, if the form is shown modal.

 

property ModalForm: PControl;

Form currently shown modal from this form or from Applet.

 

property WindowState: TWindowState;

Window state.

 

property Canvas: PCanvas;    

Placeholder for Canvas: PCanvas. But in KOL, it is possible to create applets without canvases at all. To do so, avoid using Canvas and use DC directly (which is passed in OnPaint event).

 

property IsApplet: Boolean;    

Returns true, if the control is created using NewApplet (or CreateApplet).

 

property IsForm: Boolean;      

Returns True, if the object is form window.

 

property IsMDIChild: Boolean;    

Returns TRUE, if the object is MDI child form. In such case, IsForm also returns TRUE.

 

property IsControl: Boolean;    

Returns True, is the control is control (not form or applet).

 

property IsButton: Boolean;  

Returns True, if the control is button-like or containing buttons (button, bitbtn, checkbox, radiobox, toolbar).

 

property HasBorder: Boolean;

Obvious. Form-aware.

 

property HasCaption: Boolean;

Obvious. Form-aware.

 

property CanResize: Boolean;

Obvious. Form-aware.

 

property StayOnTop: Boolean;

Obvious. Form-aware, but can be applied to controls.

 

property Border: ShortInt;

Distance between edges and child controls and between child controls by default (if methods PlaceRight, PlaceDown, PlaceUnder, ResizeParent, ResizeParentRight, ResizeParentBottom are called).

Originally was named Margin, now I recommend to use the name 'Border' to avoid confusion with MarginTop, MarginBottom, MarginLeft and MarginRight properties.

Initial value is always 2. Border property is used in realigning child controls (when its Align property is not caNone), and value of this property determines size of borders between edges of children and its parent and between aligned controls too.

See also properties MarginLeft, MarginRight, MarginTop, MarginBottom.

 

property Margin: ShortInt;

Old name for property Border.

 

property MarginTop: ShortInt;

Additional distance between true window client top and logical top of client rectangle. This value is added to Top of rectangle, returning by property ClientRect. Together with other margins and property Border, this property allows to change view of form for case, that Align property is used to align controls on parent (it is possible to provide some distance from child controls to its parent, and between child controls.

Originally this property was introduced to compensate incorrect ClientRect property, calculated for some types of controls.

See also properties Border, MarginBottom, MarginLeft, MarginRight.

 

property MarginBottom: ShortInt;

The same as MarginTop, but a distance between true window Bottom of client rectangle and logical bottom one. Take in attention, that this value should be POSITIVE to make logical bottom edge located above true edge.

See also properties Border, MarginTop, MarginLeft, MarginRight.

 

property MarginLeft: ShortInt;

The same as MarginTop, but a distance between true window Left of client rectangle and logical left edge.

See also properties Border, MarginTop, MarginRight, MarginBottom.

 

property MarginRight: ShortInt;

The same as MarginLeft, but a distance between true window Right of client rectangle and logical bottom one. Take in attention, that this value should be POSITIVE to make logical right edge located left of true edge.

See also properties Border, MarginTop, MarginLeft, MarginBottom.

 

property Tabstop: Boolean;

True, if control can be focused using tabulating between controls. Set it to False to make control unavailable for keyboard, but only for mouse.

 

property TabOrder: SmallInt;

Order of tabulating of controls. Initially, TabOrder is equal to creation order of controls. If TabOrder changed, TabOrder of all controls with not less value of one is shifted up. To place control before another, assign TabOrder of one to another. For example:

Button1.TabOrder := EditBox1.TabOrder;

In code above, Button1 is placed just before EditBox1 in tabulating order (value of TabOrder of EditBox1 is incremented, as well as for all follow controls).

 

property Focused: Boolean;

True, if the control is current on form (but check also, what form itself is focused). For form it is True, if the form is active (i.e. it is foreground and capture keyboard). Set this value to True to make control current and focused (if applicable).

 

property TextAlign: TTextAlign;

Text horizontal alignment. Applicable to labels, buttons, multi-line edit boxes, panels.

 

property VerticalAlign: TVerticalAlign;

Text vertical alignment. Applicable to buttons, labels and panels.

 

property WordWrap: Boolean;

TRUE, if this is a label, created using NewWordWrapLabel.

 

property ShadowDeep: Integer;

Deep of a shadow (for label effect only, created calling NewLabelEffect).

 

property CannotDoubleBuf: Boolean;

 

property DoubleBuffered: Boolean;

Set it to true for some controls, which are flickering in repainting (like label effect). Slow, and requires additional code. This property is inherited by all child controls.

Note: RichEdit control can not become DoubleBuffered.

 

property Transparent: Boolean;

Set it to true to get special effects. Transparency also uses DoubleBuffered and inherited by child controls.

Please note, that some controls can not be shown properly, when Transparent is set to True for it. If You want to make edit control transparent (e.g., over gradient filled panel), handle its OnChanged property and call there Invalidate to provide repainting of edit control content. Note also, that for RichEdit control property Transparent has no effect (as well as DoubleBuffered). But special property RE_Transparent is designed especially for RichEdit control (it works fine, but with great number of flicks while resizing of a control). Another note is about Edit control. To allow editing of transparent edit box, it is necessary to invalidate it for every pressed character. Or, use Ed_Transparent property instead.

 

property Ed_Transparent: Boolean;

Use this property for editbox to make it really Transparent. Remember, that though Transparent property is inherited by child controls from its parent, this is not so for Ed_Transparent. So, it is necessary to set Ed_Transparent to True for every edit control explicitly.

 

property AlphaBlend: Byte;

If assigned to 0..254, makes window (form or control) semi-transparent (Win2K only).

Depending on value assigned, it is possible to adjust transparency level ( 0 - totally transparent, 255 - totally opaque).

Note: from XP, any control can be alpha blended!

 

property LookTabKeys: TTabKeys;

Set of keys which can be used as tabulation keys in a control.

 

property SubClassName: KOLString;

Name of window class - unique for every window class in every run session of a program.

 

property CloseQueryReason: TCloseQueryReason;      

Reason why OnClose or OnQueryEndSession called.

 

property UpdateRgn: HRgn;    

A handle of update region. Valid only in OnPaint method. You can use it to improve painting (for speed), if necessary. When UpdateRgn is obtained in response to WM_PAINT message, value of the property EraseBackground is used to pass it to the API function GetUpdateRgn. If UpdateRgn = 0, this means that entire window should be repainted. Otherwise, You (e.g.) can check if the rectangle is in clipping region using API function RectInRegion.

 

property EraseBackground: Boolean;

This value is used to pass it to the API function GetUpdateRgn, when UpadateRgn property is obtained first in responce to WM_PAINT message. If EraseBackground is set to True, system is responsible for erasing background of update region before painting. If not (default), the entire region invalidated should be painted by your event handler.

 

property RightClick: Boolean;    

Use this property to determine which mouse button was clicked (applicable to toolbar in the OnClick event handler).

 

property MinSizePrev: Integer;

Minimal allowed (while dragging splitter) size of previous control for splitter (see NewSplitter).

 

property SplitMinSize1: Integer;

The same as MinSizePrev

 

property MinSizeNext: Integer;

Minimal allowed (while dragging splitter) size of the rest of parent of splitter or of SecondControl (see NewSplitter).

 

property SplitMinSize2: Integer;

The same as MinSizeNext.

 

property SecondControl: PControl;

Second control to check (while dragging splitter) if its size not less than SplitMinSize2 (see NewSplitter). By default, second control is not necessary, and needed only in rare case when SecondControl can not be determined automatically to restrict splitter right (bottom) position.

 

property Dragging: Boolean;      

True, if splitter control is dragging now by user with left mouse button. Also, this property can be used to detect if the control is dragging with mouse (after calling DragStartEx method).

 

property ThreeButtonPress: Boolean;      

GDK (*nix) only. TRUE, if 3 button press detected. Check this flag in OnMouseDblClk event handler. If 3rd button click is done for a short period of time after the double click, the control receives OnMouseDblClk the second time and this flag is set. (Applicable to the GDK and other Linux systems).

 

property MouseInControl: Boolean;    

This property can return True only if OnMouseEnter / OnMouseLeave event handlers are set for a control (or, for BitBtn, property Flat is set to True. Otherwise, False is returned always.

 

property Flat: Boolean;

Set it to True for BitBtn, to provide either flat border for a button or availability of "highlighting" (correspondent to glyph index 4).

Note: this can work incorrectly a bit under win95 without comctl32.dll updated. Therefore, application will launch. To enforce correct working even under Win95, use your own timer, which event handler checks for mouse over bitbtn control, e.g.:

 

    procedure TForm1.Timer1Timer(Sender: PObj);
    var P: TPoint;
    begin
      if not BitBtn1.MouseInControl then Exit;
      GetCursorPos( P );
      P := BitBtn1.Screen2Client( P );
      if not PtInRect( BitBtn1.ClientRect, P ) then
      begin
        BitBtn1.Flat := FALSE;
        BitBtn1.Flat := TRUE;
      end;
    end;

 

property RepeatInterval: Integer;

If this property is set to non-zero, it is interpreted (for BitBtn only) as an interval in milliseconds between repeat button down events, which are generated after first mouse or button click and until button is released. Though, if the button is pressed with keyboard (with space key), RepeatInterval value is ignored and frequency of repeatitive clicking is determined by user keyboard settings only.

 

property Progress: Integer index(( PBM_SETPOS or $8000 ) shl 16 ) or PBM_GETPOS;

Only for ProgressBar.

 

property MaxProgress: Integer index(( PBM_SETRANGE32 or $8000 ) shl 16 ) or PBM_GETRANGE;

Only for ProgressBar. 100 is the default value.

 

property ProgressColor: TColor;

Only for ProgressBar.

 

property ProgressBkColor: TColor;

Obsolete. Now the same as Color.

 

property StatusText[ Idx: Integer ]: KOLString;

Only for forms to set/retrieve status text to/from given status panel. Panels are enumerated from 0 to 254, 255 is to indicate simple status bar. Size grip in right bottom corner of status window is displayed only if form still CanResize.

When a status text is set first time, status bar window is created (always aligned to bottom), and form is resizing to preset client height. While status bar is showing, client height value is returned without height of status bar. To remove status bar, call RemoveStatus method for a form.

By default, text is left-aligned within the specified part of a status window. You can embed tab characters (#9) in the text to center or right-align it. Text to the right of a single tab character is centered, and text to the right of a second tab character is right-aligned.

If You use separate status bar onto several panels, these automatically align its widths to the same value (width divided to number of panels). To adjust status panel widths for every panel, use property StatusPanelRightX.

 

property SimpleStatusText: KOLString;

Only for forms to set/retrive status text to/from simple status bar. Size grip in right bottom corner of status window is displayed only if form CanResize.

When status text set first time, (simple) status bar window is created (always aligned to bottom), and form is resizing to preset client height. While status bar is showing, client height value is returned without height of status bar. To remove status bar, call RemoveStatus method for a form.

By default, text is left-aligned within the specified part of a status window. You can embed tab characters (#9) in the text to center or right-align it. Text to the right of a single tab character is centered, and text to the right of a second tab character is right-aligned.

 

property StatusCtl: PControl;    

Pointer to Status bar control. To "create" child controls on the status bar, first create it as a child of form, for instance, and then change its property Parent, e.g.:

 

var Progress1: PControl;
...
Progress1 := NewProgressBar( Form1 );
Progress1.Parent := Form1.StatusCtl;
(If you use MCK, code should be another a bit, and in this case it is possible to create and adjust the control at design-time, and at run-time change its parent control. E.g. (Progress1 is created at run-time here too):
Progress1 := NewProgressBar( Form );
Progress1.Parent := Form.StatusCtl;).

 

Do not forget to provide StatusCtl to be existing first (e.g. assign one-space string to SimpleStatusText property of the form, for MCK do so using Object Inspector). Please note that not only a form can have status bar but any other control too!

 

property SizeGrip: Boolean;

Size grip for status bar. Has effect only before creating window.

 

property StatusPanelRightX[ Idx: Integer ]: Integer;

Use this property to adjust status panel right edges (if the status bar is divided onto several subpanels). If the right edge for the last panel is set to -1 (by default) it is expanded to the right edge of a form window. Otherwise, status bar can be shorter then form width.

 

property StatusWindow: HWND;    

Provided for case if You want to use API direct message sending to status bar.

 

property Color1: TColor;

Top line color for GradientPanel.

 

property Color2: TColor;

Bottom line color for GradientPanel, or shadow color for LabelEffect. (If clNone, shadow color for LabelEffect is calculated as a mix bitween TextColor and clBlack).

 

property GradientStyle: TGradientStyle;

Styles other then gsVertical and gsHorizontal has effect only for gradient panel, created by NewGradientPanelEx.

 

property GradientLayout: TGradientLayout;

Has only effect for gradient panel, created by NewGradientPanelEx. Ignored for styles gsVertical and gsHorizontal.

 

property ImageListSmall: PImageList;

Image list with small icons used with List View control. If not set, last added (i.e. created with a control as an owner) image list with small icons is used.

 

property ImageListNormal: PImageList;

Image list with normal size icons used with List View control (or with icons for BitBtn, TreeView or TabControl). If not set, last added (i.e. created with a control as an owner) image list is used.

 

property ImageListState: PImageList;

Image list used as a state images list for ListView or TreeView control.

 

property Pages[ Idx: Integer ]: PControl;      

Returns controls, which can be used as parent for controls, placed on different pages of a tab control. Use it like in follows example: Label1 := NewLabel( TabControl1.Pages[ 0 ], 'Label1' ); To find number of pages available, check out Count property of the tab control. Pages are enumerated from 0 to Count - 1, as usual.

 

property TC_Pages[ Idx: Integer ]: PControl;      

The same as above.

 

property TC_Items[ Idx: Integer ]: KOLString;

Text, displayed on tab control tabs.

 

property TC_Images[ Idx: Integer ]: Integer;

Image index for a tab in tab control.

 

property TC_ItemRect[ Idx: Integer ]: TRect;  

Item rectangle for a tab in tab control.

 

property LVStyle: TListViewStyle;

ListView style of view. Can be changed at run time.

 

property LVOptions: TListViewOptions;

ListView options. Can be changed at run time.

 

property LVTextColor: TColor;

ListView text color. Use it instead of Font.Color.

 

property LVTextBkColor: TColor;

ListView background color for text.

 

property LVBkColor: TColor;

ListView background color. Use it instead of Color.

 

property LVColCount: Integer;    

ListView (additional) column count. Value 0 means that there are no columns (single item text / icon is used). If You want to provide several columns, first call LVColAdd to "insert" column 0, i.e. to provide header text for first column (with index 0). If there are no column, nothing will be shown in lvsDetail / lvsDetailNoHeader view style.

 

property LVColWidth[ Item: Integer ]: Integer;

Retrieves or changes column width. For lvsList view style, the same width is returned for all columns (ColIdx is ignored). It is possible to use special values to assign to a property:

LVSCW_AUTOSIZE - Automatically sizes the column

LVSCW_AUTOSIZE_USEHEADER - Automatically sizes the column to fit the header text

To set coumn width in lvsList view mode, column index must be -1 (and Width to set must be in range 0..32767 always).

 

property LVColText[ Idx: Integer ]: KOLString;

Allows to get/change column header text at run time.

 

property LVColAlign[ Idx: Integer ]: TTextAlign;

Column text aligning.

 

property LVColImage[ Idx: Integer ]: Integer;

Only starting from comctrl32.dll of version 4.70 (IE4+). Allows to set an image for list view column itself from the ImageListSmall.

 

property LVColOrder[ Idx: Integer ]: Integer;

Only starting from comctrl32.dll of version 4.70 (IE4+). Allows to set visual order of the list view column from the ImageListSmall. This value does not affect the index, by which the column is still accessible in the column array.

 

property LVCount: Integer;

Returns item count for ListView control. It is possible to use Count property instead when obtaining of item count is needed only. But this this property allows also to set actual count of list view items when a list view is virtual.

 

property LVCurItem: Integer;

Returns first selected item index in a list view. See also LVNextSelected, LVNextItem and LVFocusItem functions.

 

property LVFocusItem: Integer;    

Returns focused item index in a list view. See also LVCurItem.

 

property LVItemState[ Idx: Integer ]: TListViewItemState;

Access to list view item states set [lvisBlend, lvisHighlight, lvisFocus, lvisSelect]. When assign new value to the property, it is possible to use special index value -1 to change state for all items for a list view (but only when lvoMultiselect style is applied to the list view, otherwise index -1 is referring to the last item of the list view).

 

property LVItemIndent[ Idx: Integer ]: Integer;

Item indentation. Indentation is calculated as this value multiplied to image list ImgWidth value (Image list must be applied to list view). Note: indentation supported only if IE3.0 or higher installed.

 

property LVItemStateImgIdx[ Idx: Integer ]: Integer;

Access to state image of the item. Use index -1 to assign the same state image index to all items of the list view at once (fast). Option lvoCheckBoxes just means, that control itself creates special inner image list for two state images. Later it is possible to examine checked state for items or set checked state programmatically by changing LVItemStateImgIdx[ ] property. Value 1 corresponds to unchecked state, 2 to checked. Value 0 allows to remove checkbox at all. So, to check all added items by default (e.g.), do following:

 ListView1.LVItemStateImgIdx[ -1 ] := 2;

 

Use 1-based index of the image in image list ImageListState. Value 0 reserved to use as "no state image". Values 1..15 can be used only - this is the Windows restriction on state images.

 

property LVItemOverlayImgIdx[ Idx: Integer ]: Integer;

Access to overlay image of the item. Use index -1 to assign the same overlay image to all items of the list view at once (fast).

 

property LVItemData[ Idx: Integer ]: DWORD;

Access to user defined data, assiciated with the item of the list view.

 

property LVSelCount: Integer;    

Returns number of items selected in listview.

 

property LVItemImageIndex[ Idx: Integer ]: Integer;

Image index of items in listview. When an item is created (using LVItemAdd or LVItemInsert), image index 0 is set by default (not -1 like in VCL!).

 

property LVItems[ Idx, Col: Integer ]: KOLString;

Access to List View item text.

 

property LVItemPos[ Idx: Integer ]: TPoint;

Position of List View item (can be changed in icon or small icon view).

 

property LVTopItem: Integer;    

Returns index of topmost visible item of ListView in lvsList view style.

 

property LVPerPage: Integer;    

Returns the number of fully-visible items if successful. If the current view is icon or small icon view, the return value is the total number of items in the list view control.

 

property LVItemHeight: Integer;

 

property TVSelected: THandle;

Returns or sets currently selected item handle in tree view.

 

property TVDropHilighted: THandle;

Returns or sets item, which is currently highlighted as a drop target.

 

property TVDropHilited: THandle;

The same as TVDropHilighted.

 

property TVFirstVisible: THandle;

Returns or sets given item to top of tree view.

 

property TVIndent: Integer;

The amount, in pixels, that child items are indented relative to their parent items.

 

property TVVisibleCount: Integer;      

Returns number of fully (not partially) visible items in tree view.

 

property TVRoot: THandle;      

Returns handle of root item in tree view (or 0, if tree is empty).

 

property TVItemChild[ Item: THandle ]: THandle;      

Returns first child item for given one.

 

property TVItemHasChildren[ Item: THandle ]: Boolean;

TRUE, if an Item has children. Set this value to true if you want to force [+] sign appearing left from the node, even if there are no subnodes added to the node yet.

 

property TVItemChildCount[ Item: THandle ]: Integer;      

Returns number of node child items in tree view.

 

property TVItemNext[ Item: THandle ]: THandle;      

Returns next sibling item handle for given one (or 0, if passed item is the last child for its parent node).

 

property TVItemPrevious[ Item: THandle ]: THandle;    

Returns previous sibling item (or 0, if the is no such item).

 

property TVItemNextVisible[ Item: THandle ]: THandle;      

Returns next visible item (passed item must be visible too, to determine, if it is really visible, use property TVItemRect or TVItemVisible.

 

property TVItemPreviousVisible[ Item: THandle ]: THandle;      

Returns previous visible item.

 

property TVItemParent[ Item: THandle ]: THandle;    

Returns parent item for given one (or 0 for root item).

 

property TVItemText[ Item: THandle ]: KOLString;

Text of tree view item.

 

property TVItemRect[ Item: THandle; TextOnly: Boolean ]: TRect;      

Returns rectangle, occupied by an item in tree view.

 

property TVItemVisible[ Item: THandle ]: Boolean;

Returs True, if item is visible in tree view. It is also possible to assign True to this property to ensure that a tree view item is visible (if False is assigned, this does nothing).

 

property TVRightClickSelect: Boolean;

Set this property to True to allow change selection to an item, clicked with right mouse button.

 

property TVEditing: Boolean;      

Returns True, if tree view control is editing its item label.

 

property TVItemBold[ Item: THandle ]: Boolean;

True, if item is bold.

 

property TVItemCut[ Item: THandle ]: Boolean;

True, if item is selected as part of "cut and paste" operation.

 

property TVItemDropHighlighted[ Item: THandle ]: Boolean;

True, if item is selected as drop target.

 

property TVItemDropHilited[ Item: THandle ]: Boolean;

The same as TVItemDropHighlighted.

 

property TVItemExpanded[ Item: THandle ]: Boolean;      

True, if item's list of child items is currently expanded. To change expanded state, use method TVExpand.

 

property TVItemExpandedOnce[ Item: THandle ]: Boolean;    

True, if item's list of child items has been expanded at least once.

 

property TVItemSelected[ Item: THandle ]: Boolean;

True, if item is selected.

 

property TVItemImage[ Item: THandle ]: Integer;

Image index for an item of tree view. To tell that there are no image set, use index -2 (value -1 is reserved for callback image).

 

property TVItemSelImg[ Item: THandle ]: Integer;

Image index for an item of tree view in selected state. Use value -2 to provide no image, -1 used for callback image.

 

property TVItemOverlay[ Item: THandle ]: Integer;

Overlay image index for an item in tree view. Values 1..15 can be used only - this is the Windows restriction on overlay images.

 

property TVItemStateImg[ Item: THandle ]: Integer;

State image index for an item in tree view. Use 1-based index of the image in image list ImageListState. Value 0 reserved to use as "no state image".

 

property TVItemData[ Item: THandle ]: Pointer;

Stores any program-defined pointer with the item.

 

property TBCurItem: Integer;      

Same as CurItem.

 

property TBButtonCount: Integer;  

Returns count of buttons on toolbar. The same as Count.

 

property TBBtnImgWidth: Integer;

Custom toolbar buttons width. Set it before assigning buttons bitmap. Changing this property after assigning the bitmap has no effect.

 

property TBButtonEnabled[ BtnID: Integer ]: Boolean;

Obvious.

 

property TBButtonVisible[ BtnID: Integer ]: Boolean;

Allows to hide/show some of toolbar buttons.

 

property TBButtonChecked[ BtnID: Integer ]: Boolean;

Allows to determine 'checked' state of a button (e.g., radio-button), and to check it programmatically.

 

property TBButtonMarked[ BtnID: Integer ]: Boolean;

Returns True if toolbar button is marked (highlighted). Allows to highlight buttons assigning True to this value.

 

property TBButtonPressed[ BtnID: Integer ]: Boolean;

Allows to detrmine if toolbar button (given by its command ID) pressed, and press/unpress it programmatically.

 

property TBButtonText[ BtnID: Integer ]: KOLString;

Obtains toolbar button text and allows to change it. Be sure that text is not empty for all buttons, if You want for it to be shown (if at least one button has empty text, no text labels will be shown at all). At least set it to ' ' for buttons, which You do not want to show labels, if You want from other ones to have it.

 

property TBButtonImage[ BtnID: Integer ]: Integer;

Allows to access/change button image. Do not read this property for separator buttons, returning value is not proper. If you do not know, is the button a separator, using function below.

 

property TBButtonRect[ BtnID: Integer ]: TRect;

Obtains rectangle occupied by toolbar button in toolbar window. (It is not possible to obtain rectangle for buttons, currently not visible). See also function ToolbarButtonRect.

 

property TBButtonWidth[ BtnID: Integer ]: Integer;

Allows to obtain / change toolbar button width.

 

property TBButtonLParam[ const Idx: Integer ]: DWORD;

Allows to access/change LParam. Dufa

 

property TBButtonsMinWidth: Integer;

Allows to set minimal width for all toolbar buttons.

 

property TBButtonsMaxWidth: Integer;

Allows to set maximal width for all toolbar buttons.

 

property TBRows: Integer;

Returns number of rows for toolbar and allows to try to set desired number of rows (but system can set another number of rows in some cases). This property has no effect if tboWrapable style not present in Options when toolbar is created.

 

property DateTime: TDateTime;

DateTime for DateTimePicker control only.

 

property Date: TDateTime;

Date only for DateTimePicker control only.

 

property Time: TDateTime;

Time only for DateTimePicker control only.

 

property SystemTime: TSystemTime;

Date and Time as TSystemTime. When assing, use year 0 to set "no value".

 

property DateTimeRange: TDateTimeRange;

DateTimePicker range. If first date in the agrument assigned is NAN, minimum system allowed value is used as the left bound, and if the second is NAN, maximum system allowed is used as the right one.

 

property SBMin: Longint;

Minimum scrolling area position.

 

property SBMax: Longint;

Maximum scrolling area position (size of the text or image to be scrolling). For case when SCROLL_OLD defined, this value should be set as scrolling object size without SBPageSize.

 

property SBMinMax: TPoint;

The property to adjust SBMin and SBMax for a single call (set X to a minimum and Y to a maximum value).

 

property SBPosition: Integer;

Current scroll position. When set, should be between SBMin and SBMax - max(0, SBPageSize-1)

 

property SBPageSize: Integer;

 

property Checked: Boolean;

For checkbox and radiobox - if it is checked. Do not assign value for radiobox - use SetRadioChecked instead.

 

property Check3: TTriStateCheck;

State of checkbox with BS_AUTO3STATE style.

 

property CustomData: Pointer;

Can be used to exend the object when new type of control added. Memory, pointed by this pointer, released automatically in the destructor.

 

property CustomObj: PObj;

Can be used to exend the object when new type of control added. Object, pointed by this pointer, released automatically in the destructor.

 

property MDIClient: PControl;      

For MDI forms only: returns MDI client window control, containng all MDI children. Use this window to send specific messages to rule MDI children.

 

property LBTopIndex: Integer;

Index of the first visible item in a list box

 

property MaxTextSize: DWORD;

This property valid also for simple edit control, not only for RichEdit. But for usual edit control, maximum text size available is 32K. For RichEdit, limit is 4Gb. By default, RichEdit is limited to 32767 bytes (to set maximum size available to 2Gb, assign MaxInt value to a property). Also, to get current text size of RichEdit, use property TextSize or RE_TextSize[ ].

 

property TextSize: Integer;    

Common for edit and rich edit controls property, which returns size of text in edit control. Also, for any other control (or form, or applet window) returns size (in characters) of Caption or Text (what is, the same property actually).

 

property RE_TextSize[ Units: TRichTextSize ]: Integer;  

For RichEdit control, it returns text size, measured in desired units (rtsChars - characters, including OLE objects, counted as a single character; rtsBytes - presize length of text image (if it would be stored in file or stream). Please note, that for RichEdit1.0, only size in characters can be obtained.

 

property RE_CharFmtArea: TRichFmtArea;

By default, this property is raSelection. Changing it, You determine in for which area characters format is applyed, when changing character formatting properties below (not paragraph formatting).

 

property RE_CharFormat: TCharFormat;

In differ to follow properties, which allow to control certain formatting attributes, this property provides low level access for formatting current character area (see RE_CharFmtArea). It returns TCharFormat structure, filled in with formatting attributes, and by assigning another value to this property You can change desired attributes as You wish. Even if RichEdit1.0 is used, TCharFormat2 is returned (but extended fields are ignored for RichEdit1.0).

 

property RE_Font: PGraphicTool;

Font of the first character in current selection (when retrieve). When set (or subproperties of RE_Font are set), all font attributes are applied to entire area . To apply only needed attributes, use another properties: RE_FmtBold, RE_FmtItalic, RE_FmtStrikeout, RE_FmtUnderline, RE_FmtName, etc.

Note, that font size is measured in twips, which is about 1/10 of pixel.

 

property RE_FmtBold: Boolean;

Formatting flag. When retrieve, returns True, if fsBold style RE_Font.FontStyle is valid for a first character in the selection. When set, changes fsBold style (True - set, False - reset) for all characters in area .

 

property RE_FmtBoldValid: Boolean;  

property RE_FmtItalic: Boolean;

Formatting flag. Like RE_FmtBold, when retrieving, shows, is fsItalic style valid for the first character of the selection, and when set, changes only fsItalic style for an area .

 

property RE_FmtItalicValid: Boolean;  

property RE_FmtStrikeout: Boolean;

Formatting flag. Like RE_FmtBold, when retrieving, shows, is fsStrikeout style valid for the first selected character, and when set, changes only fsStrikeout style for an area .

 

property RE_FmtStrikeoutValid: Boolean;

 

property RE_FmtUnderline: Boolean;

Formatting flag. Like RE_FmtBold, when retrieving, shows, is fsUnderline style valid for the first selected character, and when set, changes fsUnderline style for an area .

 

property RE_FmtUnderlineValid: Boolean;  

 

property RE_FmtUnderlineStyle: TRichUnderline;

Extended underline style. To check, if this property is valid for entire selection, examine RE_FmtUnderlineValid value.

 

property RE_FmtProtected: Boolean;

Formatting flag. When retrieving, shows, is the first character of the selection is protected from changing it by user (True) or not (False). To get know, if retrived value is valid for entire selection, check the property RE_FmtProtectedValid. When set, makes all characters in area protected ( True) or not (False).

 

property RE_FmtProtectedValid: Boolean;    

True, if property RE_FmtProtected is valid for entire selection, when retrieving it.

 

property RE_FmtHidden: Boolean;

For RichEdit3.0, makes text hidden (not displayed).

 

property RE_FmtHiddenValid: Boolean;      

Returns True, if RE_FmtHidden style is valid for entire selection.

 

property RE_FmtLink: Boolean;

Returns True, if the first selected character is a part of link (URL).

 

property RE_FmtLinkValid: Boolean;

 

property RE_FmtFontSize: Integer index( 12 shl 16 ) or CFM_SIZE;

Formatting value: font size, in twips (1/1440 of an inch, or 1/20 of a printer's point, or about 1/10 of pixel). When retrieving, returns RE_Font.FontHeight. When set, changes font size for entire area (but does not change other font attributes).

 

property RE_FmtFontSizeValid: Boolean;  

Returns True, if property RE_FmtFontSize is valid for entire selection, when retrieving it.

 

property RE_FmtAutoBackColor: Boolean;

True, when automatic back color is used.

 

property RE_FmtAutoBackColorValid: Boolean;  

 

property RE_FmtFontColor: Integer index( 20 shl 16 ) or CFM_COLOR;

Formatting value (font color). When retrieving, returns RE_Font.Color. When set, changes font color for entire area (but does not change other font attributes).

 

property RE_FmtFontColorValid: Boolean;    

Returns True, if property RE_FmtFontColor valid for entire selection, when retrieving it.

 

property RE_FmtAutoColor: Boolean;

True, when automatic text color is used (in such case, RE_FmtFontColor assignment is ignored for current area).

 

property RE_FmtAutoColorValid: Boolean;

 

property RE_FmtBackColor: Integer index(( 64 + 32 ) shl 16 ) or CFM_BACKCOLOR;

Formatting value (back color). Only available for Rich Edit 2.0 and higher. When set, changes background color for entire area (but does not change other font attributes).

 

property RE_FmtBackColorValid: Boolean;

 

property RE_FmtFontOffset: Integer index( 16 shl 16 ) or CFM_OFFSET;

Formatting value (font vertical offset from baseline, positive values correspond to subscript). When retrieving, returns offset for first character in the selection. When set, changes font offset for entire area . To get know, is retrieved value valid for entire selction, check RE_FmtFontOffsetValid property.

 

property RE_FmtFontOffsetValid: Boolean;      

Returns True, if property RE_FmtFontOffset is valid for entire selection, when retrieving it.

 

property RE_FmtFontCharset: Integer index( 25 shl 16 ) or CFM_CHARSET;

Returns charset for first character in current selection, when retrieved (and to get know, if this value is valid for entire selection, check property RE_FmtFontCharsetValid). When set, changes charset for all characters in area , but does not alter other formatting attributes.

 

property RE_FmtFontCharsetValid: Boolean;      

Returns True, only if rerieved property RE_FmtFontCharset is valid for entire selection.

 

property RE_FmtFontName: KOLString;

Returns font face name for first character in the selection, when retrieved, and sets font name for entire area , wnen assigned to (without changing of other formatting attributes). To get know, if retrived font name valid for entire selection, examine property RE_FmtFontNameValid.

 

property RE_FmtFontNameValid: Boolean;    

Returns True, only if the font name is the same for entire selection, thus is, if rerieved property value RE_FmtFontName is valid for entire selection.

 

property RE_ParaFmt: TParaFormat;

Allows to retrieve or set paragraph formatting attributes for currently selected paragraph(s) in RichEdit control. See also following properties, which allow to do the same for certain paragraph format attributes separately.

 

property RE_TextAlign: TRichTextAlign;

Returns text alignment for current selection and allows to change it (without changing other formatting attributes).

 

property RE_TextAlignValid: Boolean;      

Returns True, if property RE_TextAlign is valid for entire selection. If False, it is concerning only start of selection.

 

property RE_Numbering: Boolean;

Returns True, if selected text is numbered (or has style of list with bullets). To get / change numbering style, see properties RE_NumStyle and RE_NumBrackets.

 

property RE_NumStyle: TRichNumbering;

Advanced numbering style, such as rnArabic etc. If You use it, do not change RE_Numbering property simultaneously - this can cause changing style to rnBullets only.

 

property RE_NumStart: Integer;

Starting number for advanced numbering style. If this property is not set, numbering is starting by default from 0. For rnLRoman and rnURoman this cause, that first item has no number to be shown (ancient Roman people did not invent '0').

 

property RE_NumBrackets: TRichNumBrackets;

Brackets style for advanced numbering. rnbPlain is default brackets style, and every time, when RE_NumStyle is changed, RE_NumBrackets is reset to rnbPlain.

 

property RE_NumTab: Integer;

Tab between start of number and start of paragraph text. If too small too view number, number is not displayed. (Default value seems to be sufficient though).

 

property RE_NumberingValid: Boolean;    

Returns True, if RE_Numbering, RE_NumStyle, RE_NumBrackets, RE_NumTab, RE_NumStart properties are valid for entire selection.

 

property RE_Level: Integer;      

Outline level (for numbering paragraphs?). Read only.

 

property RE_SpaceBefore: Integer;

Spacing before paragraph.

 

property RE_SpaceBeforeValid: Boolean;      

True, if RE_SpaceBefore value is valid for all selected paragraph (if False, this value is valid only for first paragraph.

 

property RE_SpaceAfter: Integer;

Spacing after paragraph.

 

property RE_SpaceAfterValid: Boolean;    

True, only if RE_SpaceAfter value is valid for all selected paragraphs.

 

property RE_LineSpacing: Integer;

Linespacing in paragraph (this value is based on RE_SpacingRule property).

 

property RE_SpacingRule: Integer;

Linespacing rule. Do not know what is it.

 

property RE_LineSpacingValid: Boolean;  

True, only if RE_LineSpacing and RE_SpacingRule values are valid for entire selection.

 

property RE_Indent: Integer index( 20 shl 16 ) or PFM_OFFSET;

Returns left indentation for paragraph in current selection and allows to change it (without changing other formatting attributes).

 

property RE_IndentValid: Boolean;  

Returns True, if RE_Indent property is valid for entire selection.

 

property RE_StartIndent: Integer index( 12 shl 16 ) or PFM_STARTINDENT;

Returns left indentation for first line in paragraph for current selection, and allows to change it (without changing other formatting attributes).

 

property RE_StartIndentValid: Boolean;  

Returns True, if property RE_StartIndent is valid for entire selection.

 

property RE_RightIndent: Integer index( 16 shl 16 ) or PFM_RIGHTINDENT;

Returns right indent for paragraph in current selection, and allow to change it (without changing other formatting attributes).

 

property RE_RightIndentValid: Boolean;  

Returns True, if property RE_RightIndent is valid for entire selection only.

 

property RE_TabCount: Integer;

Number of tab stops in current selection. This value can not be set greater then MAX_TAB_COUNT (32).

 

property RE_Tabs[ Idx: Integer ]: Integer;

Tab stops for RichEdit control.

 

property RE_TabsValid: Boolean;    

Returns True, if properties RE_Tabs[ ] and RE_TabCount are valid for entire selection.

 

property RE_AutoKeyboard: Boolean;

True if autokeyboard on (lovely "feature" of automatic switching keyboard language when caret is over another language text). For older RichEdit, is 'on' always, for newest - 'off' by default.

 

property RE_AutoFont: Boolean;

True if autofont on (automatic switching font when keyboard layout is changes). By default, is 'on' always. It is suggested to turn this option off for Unicode control.

 

property RE_AutoFontSizeAdjust: Boolean;

See IMF_AUTOFONTSIZEADJUST option in SDK: Font-bound font sizes are scaled from insertion point size according to script. For example, Asian fonts are slightly larger than Western ones. This option is turned on by default.

 

property RE_DualFont: Boolean;

See IMF_DUALFONT option in SDK: Sets the control to dual-font mode. Used for Asian language support. The control uses an English font for ASCII text and a Asian font for Asian text.

 

property RE_UIFonts: Boolean;

See IMF_UIFONTS option in SDK: Use user-interface default fonts. This option is turned off by default.

 

property RE_IMECancelComplete: Boolean;

See IMF_IMECANCELCOMPLETE option in SDK: This flag determines how the control uses the composition string of an IME if the user cancels it. If this flag is set, the control discards the composition string. If this flag is not set, the control uses the composition string as the result string.

 

property RE_IMEAlwaysSendNotify: Boolean;

See IMF_IMEALWAYSSENDNOTIFY option in SDK: Controls how Rich Edit notifies the client during IME composition:

0: No EN_CHANGED or EN_SELCHANGE notifications during undetermined state. Send notification when final string comes in. (default)

1: Send EN_CHANGED and EN_SELCHANGE events during undetermined state.

 

property RE_OverwriteMode: Boolean;

This property allows to control insert/overwrite mode. First, to examine, if insert or overwrite mode is current (but it is necessary either to access this property, at least once, immediately after creating RichEdit control, or to assign event OnRE_InsOvrMode_Change to your handler). Second, to set desired mode programmatically - by assigning value to this property (You also have to initialize monitoring procedure by either reading RE_OverwriteMode property or assigning handler to event OnRE_InsOvrMode_Change immediately following RichEdit control creation).

 

property RE_DisableOverwriteChange: Boolean;

It is possible to disable switching between "insert" and "overwrite" mode by user (therefore, event OnRE_InsOvrMode_Change continue works, but it just called when key INSERT is pressed, though RE_OverwriteMode property is not actually changed if switching is disabled).

 

property RE_Text[ Format: TRETextFormat; SelectionOnly: Boolean ]: KOLString;

This property allows to get / replace content of RichEdit control (entire text or selection only). Using different formats, it is possible to exclude or replace undesired formatting information (see TRETextFormat specification). To get or replace entire text in reText mode (plain text only), it is possible to use habitual for edit controls Text property.  

Note: it is possible to append text to the end of RichEdit control using method Add, but only if property RE_Text is accessed at least once:

RichEdit1.RE_Text[ reText, True ];

 

property RE_Error: Integer;    

Contains error code, if access to RE_Text failed.

 

property RE_AutoURLDetect: Boolean;

If set to True, automatically detects URLs (and highlights it with blue color, applying fsItalic and fsUnderline font styles (while typing and loading). Default value is False. Note: if event OnRE_URLClick or event OnRE_OverURL are set, property RE_AutoURLDetect is set to True automatically.

 

property RE_URL: PKOLChar;    

Detected URL (valid in OnRE_OverURL and OnRE_URLClick event handlers).

 

property RE_Transparent: Boolean;

Use this property to make richedit control transparent, instead of Ed_Transparent or Transparent. But do not place such transparent richedit control directly on form - it can be draw incorrectly when form is activated and rich editr control is not current active control. Use at least panel as a parent instead.

 

property RE_Zoom: TSmallPoint;

To set zooming for rich edit control (3.0 and above), pass X as numerator and Y as denominator. Resulting X/Y must be between 1/64 and 64.

 

property PropInt[ PropName: PKOLChar ]: Integer;

For any windowed control: use it to store desired property in window properties.

 

property Align: TControlAlign;

Align style of a control. If this property is not used in your application, there are no additional code added. Aligning of controls is made in KOL like in VCL. To align controls when initially create ones, use "transparent" function SetAlign ("transparent" means that it returns @Self as a result).

Note, that it is better not to align combobox caClient, caLeft or caRight (better way is to place a panel with Border = 0 and EdgeStyle = esNone, align it as desired and to place a combobox on it aligning caTop or caBottom). Otherwise, big problems could be under Win9x/Me, and some delay could occur under any other systems.

Do not attempt to align some kinds of controls (like combobox) caLeft or caRight, this can cause infinite recursion.

 

 

TControl methods

 

procedure Run( var AppletCtl: PControl );

Call this procedure to process messages loop of your program. Pass here pointer to applet button object (if You have created it - see NewApplet) or your main form object of type PControl (created using NewForm).

 

function FormGetIntParam: Integer;

Extracts the next integer parameter up to ',' or up to ';'

 

function FormGetColorParam: Integer;

Extracts the next integer parameter up to ',' or up to ';'

 

procedure FormGetStrParam;

Extracts the next string parameter up to ',' or up to ';' -> FormString

 

procedure FormCreateParameters( alphabet: PFormInitFuncArray; params: PAnsiChar );

Sets the initial alphabet and parameters with commands

 

procedure FormExecuteCommands( AForm: PControl; ControlPtrOffsets: PSmallIntArray );

Executes commands (with parameters) to the end or to ';'

 

procedure InitParented( AParent: PControl ); virtual;      

Initialization of visual object.

 

procedure InitOrthaned( AParentWnd: HWnd ); virtual;      

Initialization of visual object.

 

PROCEDURE InitParented( AParent: PControl; widget: PGtkWidget; need_eventbox: Boolean ); VIRTUAL;      

Initialization of visual object.

 

procedure DestroyChildren;    

Destroys children. Is called in destructor, and can be called in descending classes as earlier as needed to prevent problems of too late destroying of visuals.

Note: since v 2.40, used only for case when a symbol NOT_USE_AUTOFREE4CONTROLS is defined, otherwise all children are destroyed using common mechanism of Add2AutoFree.

 

function GetParentWnd( NeedHandle: Boolean ): HWnd;    

Returns handle of parent window.

 

function GetParentWindow: HWnd;      

 

procedure SetEnabled( Value: Boolean );      

Changes Enabled property value. Overriden here to change enabling status of a window.

 

function GetEnabled: Boolean;    

Returns True, if Enabled. Overriden here to obtain real window state.

 

procedure SetVisible( Value: Boolean );    

Sets Visible property value. Overriden here to change visibility of correspondent window.

 

procedure Set_Visible( Value: Boolean );    

 

function GetVisible: Boolean;    

Returns True, if correspondent window is Visible. Overriden to get visibility of real window, not just value stored in object.

 

function Get_Visible: Boolean;      

Returns True, if correspondent window is Visible, for forms and applet, or if fVisible flag is set, for controls.

 

procedure SetCtlColor( Value: TColor );    

Sets TControl's Color property value.

 

procedure SetBoundsRect( const Value: TRect );      

Sets BoudsRect property value.

 

function GetBoundsRect: TRect;      

Returns bounding rectangle.

 

function GetIcon: HIcon;    

Returns Icon property. By default, if it is not set, returns Icon property of an Applet.

 

procedure CreateSubclass( var Params: TCreateParams; ControlClassName: PKOLChar );      

Can be used in descending classes to subclass window with given standard Windows ControlClassName - must be called after creating Params but before CreateWindow. Usually it is called in overriden method CreateParams after calling of the inherited one.

 

procedure SetOnChar( const Value: TOnChar );

 

procedure SetOnDeadChar( const Value: TOnChar );

 

procedure SetOnKeyDown( const Value: TOnKey );

 

procedure SetOnKeyUp( const Value: TOnKey );

 

procedure SetHelpContext( Value: Integer );

 

procedure SetOnTVDelete( const Value: TOnTVDelete );

 

function DefaultBtnProc( var Msg: TMsg; var Rslt: Integer ): Boolean;      

 

constructor CreateParented( AParent: PControl );

Creates new instance of TControl object, calling InitParented

 

constructor CreateOrthaned( AParentWnd: HWnd );

Creates new instance of TControl object, calling InitOrthaned

 

CONSTRUCTOR CreateParented( AParent: PControl; widget: PGtkWidget; need_eventbox: Boolean );

Creates new instance of TControl object, calling InitParented

 

destructor Destroy; virtual;

Destroyes object. First of all, destructors for all children are called.

 

function GetWindowHandle: HWnd;

Returns window handle. If window is not yet created, method CreateWindow is called.

 

procedure CreateChildWindows;

Enumerates all children recursively and calls CreateWindow for all of these.

 

function ChildIndex( Child: PControl ): Integer;

Returns index of given child.

 

procedure MoveChild( Child: PControl; NewIdx: Integer );

Moves given Child into new position.

 

procedure EnableChildren( Enable, Recursive: Boolean );

Enables (Enable = TRUE) or disables (Enable = FALSE) all the children of the control. If Recursive = TRUE then all the children of all the children are enabled or disabled recursively.

 

function ClientRect: TRect;

Client rectangle of TControl. Contrary to VCL, for some classes (e.g. for graphic controls) can be relative not to itself, but to top left corner of the parent's ClientRect rectangle.

 

function ControlRect: TRect;

Absolute bounding rectangle relatively to nearest Windowed parent client rectangle (at least to a form, but usually to a Parent). Useful while drawing on device context, provided by such Windowed parent. For form itself is the same as BoundsRect.

 

function ControlAtPos( X, Y: Integer; IgnoreDisabled: Boolean ): PControl;

Searches control at the given position (relatively to top left corner of the ClientRect).

 

procedure Invalidate;

Invalidates rectangle, occupied by the visual (but only if Showing = True).

 

procedure InvalidateEx;

Invalidates the window and all its children.

 

procedure InvalidateNC( Recursive: Boolean );

Invalidates the window and all its children including non-client area.

 

procedure Update;

Updates control's window and calls Update for all child controls.

 

procedure BeginUpdate;

Call this method to stop visual updates of the control until correspondent EndUpdate called (pairs BeginUpdate - EndUpdate can be nested).

 

procedure EndUpdate;

See BeginUpdate.

 

function HandleAllocated: Boolean;

Returns True, if window handle is allocated. Has no sense for non-Windowed objects (but now, the KOL has no non-Windowed controls).

 

procedure PaintBackground( DC: HDC; Rect: PRect );

Is called to paint background in given rectangle. This method is filling clipped area of the Rect rectangle with Color, but only if global event Global_OnPaintBkgnd is not assigned. If assigned, this one is called instead here.

This method made public, so it can be called directly to fill some device context's rectangle. But remember, that independantly of Rect, top left corner of background piece will be located so, if drawing is occure into ControlRect rectangle.

 

function ParentForm: PControl;

Returns parent form for a control (of @Self for form itself.

 

function FormParentForm: PControl;

Returns parent form for a control (of @Self for form itself. For a frame, returns frame panel instead.

 

function MarkPanelAsForm: PControl;

Special function for MCK to mark panel as frame parent control.

 

function Client2Screen( const P: TPoint ): TPoint;

Converts the client coordinates of a specified point to screen coordinates.

 

function Screen2Client( const P: TPoint ): TPoint;

Converts screen coordinates of a specified point to client coordinates.

 

function CreateWindow: Boolean; virtual;

Creates correspondent window object. Returns True if success (if window is already created, False is returned). If applied to a form, all child controls also allocates handles that time.

Call this method to ensure, that a hanle is allocated for a form, an application button or a control. (It is not necessary to do so in the most cases, even if You plan to work with control's handle directly. But immediately after creating the object, if You want to pass its handle to API function, this can be helpful).

 

procedure Close;

Closes window. If a window is the main form, this closes application, terminating it. Also it is possible to call Close method for Applet window to stop application.

 

procedure CursorLoad( Inst: Integer; ResName: PKOLChar );

Loads Cursor from the resource. See also comments for Icon property.

 

procedure IconLoad( Inst: Integer; ResName: PKOLChar );

See Icon property.

 

procedure IconLoadCursor( Inst: Integer; ResName: PKOLChar );

Loads Icon from the cursor resource. See also Icon property.

 

function AssignHelpContext( Context: Integer ): PControl;

Assigns HelpContext and returns @ Self (can be used in initialization of a control in a chain of "transparent" calls).

 

procedure CallHelp( Context: Integer; CtxCtl: PControl );

Method of a form or Applet. Call it to show help with the given context ID. If the Context = 0, help contents is displayed. By default, WinHelp is used. To allow using HtmlHelp, call AssignHtmlHelp global function. When WinHelp used, HelpPath variable can be assigned directly. If HelpPath variable is not assigned, application name (and path) is used, with extension replaced to '.hlp'.

 

procedure SelectAll;

Makes all the text in editbox or RichEdit, or all items in listbox selected.

 

procedure ReplaceSelection( const Value: KOLString; aCanUndo: Boolean );

Replaces selection (in edit, RichEdit). Unlike assigning new value to Selection property, it is possible to specify, if operation can be undone.

 

Use this method or assigning value to a Selection property to format text initially in the rich edit. E.g.:

    RichEdit1.RE_FmtBold := TRUE;
    RichEdit1.Selection := 'bolded text'#13#10;
    RichEdit1.RE_FmtBold := FALSE;
    RichEdit1.RE_FmtItalic := TRUE;
    RichEdit1.Selection := 'italized text';
...

procedure DeleteLines( FromLine, ToLine: Integer );

Deletes lines from FromLine to ToLine (inclusively, i.e. 0 to 0 deletes one line with index 0). Current selection is restored as possible.

 

function Item2Pos( ItemIdx: Integer ): DWORD;

Only for edit controls: converts line index to character position.

 

function Pos2Item( Pos: Integer ): DWORD;

Only for edit controls: converts character position to line index.

 

function SavePosition: TEditPositions;

Only for edit controls: saves current editor selection and scroll positions. To restore position, use RestorePosition with a structure, containing saved position as a parameter.

 

procedure RestorePosition( const p: TEditPositions );

Call RestorePosition with a structure, containing saved position as a parameter (this structure filled in in SavePosition method). If you set RestoreScroll to FALSE, only selection is restored, without scroll position.

 

procedure UpdatePosition( var p: TEditPositions; FromPos, CountInsertDelChars, CountInsertDelLines: Integer );

If you called SavePosition and then make some changes in the edit control, calling RestorePosition will fail if chages are affecting selection size. The problem can be solved updating saved position info using this method. Pass a count of inserted characters and lines as a positive number and a count of deleted characters as a negative number here. CountInsertDelLines is optional paramters: if you do not specify it, only selection is fixed.

 

function EditTabChar: PControl;

Call this method (once) to provide insertion of tab character (code #9) when tab key is pressed on keyboard.

 

function IndexOf( const S: KOLString ): Integer;

Works for the most of control types, though some of those have its own methods to search given item. If a control is not list box or combobox, item is finding by enumerating all the Items one by one. See also SearchFor method.

 

function SearchFor( const S: KOLString; StartAfter: Integer; Partial: Boolean ): Integer;

Works for the most of control types, though some of those have its own methods to search given item. If a control is not list box or combobox, item is finding by enumerating all the Items one by one. See also IndexOf method.

 

procedure AddDirList( const Filemask: KOLString; Attrs: DWORD );

Can be used only with listbox and combobox - to add directory list items, filtered by given Filemask (can contain wildcards) and Attrs. Following flags can be combined in Attrs: If the listbox is sorted, directory items will be sorted (alpabetically).

 

function SetButtonIcon( aIcon: HIcon ): PControl;

Sets up button icon image and changes its styles. Returns button itself.

 

function SetButtonBitmap( aBmp: HBitmap ): PControl;

Sets up button icon image and changes its styles. Returns button itself.

 

function AllBtnReturnClick: PControl;

Call this method for a form or control to provide clicking a focused button when ENTER pressed. By default, a button can be clicked only by SPACE key from the keyboard, or by mouse.

 

procedure Show;

Makes control visible and activates it.

 

function ShowModal: Integer;

Can be used only with a forms to show it modal. See also global function ShowMsgModal.

To use a form as a modal, it is possible to make it either auto-created or dynamically created. For a first case, You (may be prefer to hide a form after showing it as a modal:

 

  procedure TForm1.Button1Click( Sender: PObj );
  begin
    Form2.Form.ShowModal;
    Form2.Form.Hide;
  end;

 

Another way is to create modal form just before showing it (this economies system resources):

 

  procedure TForm1.Button1Click( Sender: PObj );
  begin
    NewForm2( Form2, Applet );
    Form2.Form.ShowModal;
    Form2.Form.Free; 

    // Never call Form2.Free or Form2.Form.Close

    // but always Form2.Form.Free; (!)

  end;               

 

In samples above, You certainly can place any wished code before and after calling ShowModal method.

Do not forget that if You have more than a single form in your project, separate Applet object should be used.

See also ShowModalEx.

 

function ShowModalParented( const AParent: PControl ): Integer;

by Alexander Pravdin. The same as ShowModal, but with a certain form as a parent.

 

function ShowModalEx: Integer;

The same as ShowModal, but all the windows of current thread are disabled while showing form modal. This is useful if KOL form from a DLL is used modally in non-KOL application.

 

procedure Hide;

Makes control hidden.

 

function CallDefWndProc( var Msg: TMsg ): Integer;

Function to be called in WndProc method to redirect message handling to default window procedure.

 

function DoSetFocus: Boolean;

Sets focus for Enabled window. Returns True, if success.

 

procedure MinimizeNormalAnimated;

Apply this method to a main form (not to another form or Applet, even when separate Applet control is not used and main form matches it!). This provides normal animated visual minimization for the application. It therefore has no effect, if animation during minimize/resore is turned off by user.

Applying this method also provides for the main form (only for it) correct restoring the form maximized if it was maximized while minimizing the application. See also RestoreNormalMaximized method.

 

procedure RestoreNormalMaximized;

Apply to any form for which it is important to restore it maximized when the application was minimizing while such form was maximized. If the method MinimizeNormalAnimated was called for the main form, then the correct behaviour is already provided for the main form, so in such case it is no more necessary to call also this method, but calling it therefore is not an error.

 

function IsMainWindow: Boolean;

Returns True, if a window is the main in application (created first after the Applet, or matches the Applet).

 

function ProcessMessage: Boolean;

Processes one message. See also ProcessMessages.

 

procedure ProcessMessages;

Processes pending messages during long cycle of calculation, allowing to window to be repainted if needed and to respond to other messages. But if there are no such messages, your application can be stopped until such one appear in messages queue. To prevent such situation, use method ProcessPendingMessages instead.

 

procedure ProcessMessagesEx;

Version of ProcessMessages, which works always correctly, even if the application is minimized or background.

 

procedure ProcessPendingMessages;

Similar to ProcessMessages, but without waiting of message in messages queue. I.e., if there are no pending messages, this method immediately returns control to your code. This method is better to call during long cycle of calculation (then ProcessMessages).

 

procedure ProcessPaintMessages;

 

function WndProc( var Msg: TMsg ): Integer; virtual;

Responds to all Windows messages, posted (sended) to the window, before all other proceeding. You can override it in derived controls, but in KOL there are several other ways to control message flow of existing controls without deriving another costom controls for only such purposes. See OnMessage, AttachProc.

 

function SetBorder( Value: Integer ): PControl;

Assigns new Border value, and returns @ Self.

 

function BringToFront: PControl;

Changes z-order of the control, bringing it to the topmost level.

 

function SendToBack: PControl;

Changes z-order of the control, sending it to the back of siblings.

 

function DblBufTopParent: PControl;

Returns the topmost DoubleBuffered Parent control.

 

function MouseTransparent: PControl;

Call this method to set up mouse transparent control (which always returns HTTRANSPARENT in responce to WM_NCHITTEST). This function returns a pointer to a control itself.

 

procedure GotoControl( Key: DWORD );

Emulates tabulation key press w/o sending message to current control. Can be applied to a form or to any its control. If VK_TAB is used, state of shift kay is checked in: if it is pressed, tabulate is in backward direction.

 

procedure DragStart;

Call this method for a form or control to drag it with left mouse button, when mouse left button is already down. Dragging is stopped when left mouse button is released. See also DragStartEx, DragStopEx.

 

procedure DragStartEx;

Call this method to start dragging the form by mouse. To stop dragging, call DragStopEx method. (Tip: to detect mouse up event, use OnMouseUp event of the dragging control). This method can be used to move any control with the mouse, not only entire form. State of mouse button is not significant. Determine dragging state of the control checking its Dragging property.

 

procedure DragStopEx;

Call this method to stop dragging the form (started by DragStopEx).

 

procedure DragItem( OnDrag: TOnDrag );

Starts dragging something with mouse. During the process, callback function OnDrag is called, which allows to control drop target, change cursor shape, etc.

 

function LikeSpeedButton: PControl;

Transparent method (returns control itself). Makes button not focusable.

 

function Add( const S: KOLString ): Integer;

Only for listbox and combobox.

 

function Insert( Idx: Integer; const S: KOLString ): Integer;

Only for listbox and combobox.

 

procedure Delete( Idx: Integer );

Deletes given (by index) pointer item from the list, shifting all follow item indexes up by one.

 

procedure Clear;

Clears object content. Has different sense for different controls. E.g., for label, editbox, button and other simple controls it assigns empty string to Caption property. For listbox, combobox, listview it deletes all items. For toolbar, it deletes all buttons. Et so on.

 

procedure RemoveStatus;

Call it to remove status bar from a form (created in result of assigning value(s) to StatusText[], SimpleStatusText properties). When status bar is removed, form is resized to preset client height.

 

function StatusPanelCount: Integer;

Returns number of status panels defined in status bar.

 

function SetUnicode( Unicode: Boolean ): PControl;

Sets control as Unicode or not. The control itself is returned as for other "transparent" functions. A conditional define UNICODE_CTRLS must be added to a project to provide handling unicode messages.

 

function TC_Insert( Idx: Integer; const TabText: KOLString; TabImgIdx: Integer ): PControl;

Inserts new tab before given, returns correspondent page control (which can be used as a parent for controls to place on the page).

 

procedure TC_Delete( Idx: Integer );

Removes tab from tab control, destroying all its child controls.

 

procedure TC_InsertControl( Idx: Integer; const TabText: KOLString; TabImgIdx: Integer; Page: PControl );

Inserts new tab before given, but not construt this Page (this control must be created before inserting, and may be not a Panel).

 

function TC_Remove( Idx: Integer ): PControl;

Only removes tab from tab control, and return this Page as Result.

 

procedure TC_SetPadding( cx, cy: Integer );

Sets space padding around tab text in a tab of tab control.

 

function TC_TabAtPos( x, y: Integer ): Integer;

Returns index of tab, found at the given position (relative to a client rectangle of tab control). If no tabs found at the position, -1 is returned.

 

function TC_DisplayRect: TRect;

Returns rectangle, occupied by a page rather then tab.

 

function TC_IndexOf( const S: KOLString ): Integer;

By Mr Brdo. Index of page by its Caption.

 

function TC_SearchFor( const S: KOLString; StartAfter: Integer; Partial: Boolean ): Integer;

By Mr Brdo. Index of page by its Caption.

 

procedure LVColAdd( const aText: KOLString; aalign: TTextAlign; aWidth: Integer );

Adds new column. Pass 'width' <= 0 to provide default column width. 'text' is a column header text.

 

procedure LVColInsert( ColIdx: Integer; const aText: KOLString; aAlign: TTextAlign; aWidth: Integer );

Inserts new column at the Idx position (1-based column index).

 

procedure LVColDelete( ColIdx: Integer );

Deletes column from List View

 

function LVNextItem( IdxPrev: Integer; Attrs: DWORD ): Integer;

Returns an index of the next after IdxPrev item with given attributes in the list view. Attributes can be: LVNI_ALL - Searches for a subsequent item by index, the default value.

 

Searchs by physical relationship to the index of the item where the search is to begin. LVNI_ABOVE - Searches for an item that is above the specified item. LVNI_BELOW - Searches for an item that is below the specified item. LVNI_TOLEFT - Searches for an item to the left of the specified item. LVNI_TORIGHT - Searches for an item to the right of the specified item.

 

The state of the item to find can be specified with one or a combination of the following values: LVNI_CUT - The item has the LVIS_CUT state flag set. LVNI_DROPHILITED - The item has the LVIS_DROPHILITED state flag set LVNI_FOCUSED - The item has the LVIS_FOCUSED state flag set. LVNI_SELECTED - The item has the LVIS_SELECTED state flag set.

 

function LVNextSelected( IdxPrev: Integer ): Integer;

Returns an index of next (after IdxPrev) selected item in a list view.

 

function LVAdd( const aText: KOLString; ImgIdx: Integer; State: TListViewItemState; StateImgIdx, OverlayImgIdx: Integer; Data: DWORD ): Integer;

Adds new line to the end of ListView control. Only content of item itself is set (aText, ImgIdx). To change other column text and attributes of item added, use appropriate properties / methods ().

Returns an index of added item.

There is no Unicode version defined, use LVItemAddW instead.

 

function LVItemAdd( const aText: KOLString ): Integer;

Adds an item to the end of list view. Returns an index of the item added.

 

function LVInsert( Idx: Integer; const aText: KOLString; ImgIdx: Integer; State: TListViewItemState; StateImgIdx, OverlayImgIdx: Integer; Data: DWORD ): Integer;

Inserts new line before line with index Idx in ListView control. Only content of item itself is set (aText, ImgIdx). To change other column text and attributes of item added, use appropriate properties / methods (). if ImgIdx = I_IMAGECALLBACK, event handler OnGetLVItemImgIdx is responsible for returning image index for an item ( /// not implemented yet /// ) Pass StateImgIdx and OverlayImgIdx = 0 (ignored in that case) or 1..15 to use correspondent icon from ImageListState image list.

Returns an index of item inserted.

There is no unicode version of this method, use LVItemInsertW.

 

function LVItemInsert( Idx: Integer; const aText: KOLString ): Integer;

Inserts an item to Idx position.

 

procedure LVDelete( Idx: Integer );

Deletes item of ListView with subitems (full row - in lvsDetail view style.

 

procedure LVSetItem( Idx, Col: Integer; const aText: KOLString; ImgIdx: Integer; State: TListViewItemState; StateImgIdx, OverlayImgIdx: Integer; Data: DWORD );

Use this method to set item data and item columns data for ListView control. It is possible to pass I_SKIP as ImgIdx, StateImgIdx, OverlayImgIdx values to skip setting this fields. But all other are set always. Like in LVInsert / LVAdd, ImgIdx can be I_IMAGECALLBACK to determine that image will be retrieved in OnGetItemImgIdx event handler when needed.

If this method is called to set data for column > 0, parameters ImgIdx and Data are ignored anyway.

There is no unicode version of this method, use other methods to set up listed properties separately using correspondent W-functions.

 

procedure LVSelectAll;

Call this method to select all the items of the list view control.

 

function LVItemRect( Idx: Integer; Part: TGetLVItemPart ): TRect;

Returns rectangle occupied by given item part(s) in ListView window. Empty rectangle is returned, if the item is not viewing currently.

 

function LVSubItemRect( Idx, ColIdx: Integer ): TRect;

Returns rectangle occupied by given item's subitem in ListView window, in lvsDetail or lvsDetailNoHeader style. Empty rectangle (0,0,0,0) is returned if the item is not viewing currently. Left or/and right bounds of the rectangle returned can be outbound item rectangle if only a part of the subitem is visible or the subitem is not visible in the item, which is visible itself.

 

function LVItemAtPos( X, Y: Integer ): Integer;

Return index of item at the given position.

 

function LVItemAtPosEx( X, Y: Integer; var Where: TWherePosLVItem ): Integer;

Retrieves index of item and sets in Where, what part of item is under given coordinates. If there are no items at the specified position, -1 is returned.

 

procedure LVMakeVisible( Item: Integer; PartiallyOK: Boolean );

Makes listview item visible. Ignored when Item passed < 0.

 

procedure LVEditItemLabel( Idx: Integer );

Begins in-place editing of item label (first column text).

 

procedure LVSort;

Initiates sorting of list view items. This sorting procedure is available only for Win2K, WinNT4 with IE5, Win98 or Win95 with IE5. See also LVSortData.

 

procedure LVSortData;

Initiates sorting of list view items. This sorting procedure is always available in Windows95/98, NT/2000. But OnCompareLVItems procedure receives not indexes of items compared but its Data field associated instead.

 

procedure LVSortColumn( Idx: Integer );

This is a method to simplify sort by column. Just call it in your OnColumnClick event passing column index and enjoy with your list view sorted automatically when column header is clicked. Requieres Windows2000 or Winows98, not supported under WinNT 4.0 and below and under Windows95.

Either lvoSortAscending or lvoSortDescending option must be set in LVOptions, otherwise no sorting is performed.

 

function LVIndexOf( const S: KOLString ): Integer;

Returns first list view item index with caption matching S. The same as LVSearchFor( S, -1, FALSE ).

 

function LVSearchFor( const S: KOLString; StartAfter: Integer; Partial: Boolean ): Integer;

Searches an item with Caption equal to S (or starting from S, if Partial = TRUE). Searching is started after an item specified by StartAfter parameter.

 

function TVInsert( nParent, nAfter: THandle; const Txt: KOLString ): THandle;

Inserts item to a tree view. If nParent is 0 or TVI_ROOT, the item is inserted at the root of tree view. It is possible to pass following special values as nAfter parameter:

 

TVI_FIRST

Inserts the item at the beginning of the list.

TVI_LAST

Inserts the item at the end of the list.

TVI_SORT

Inserts the item into the list in alphabetical order.

 

procedure TVDelete( Item: THandle );

Removes an item from the tree view. If value TVI_ROOT is passed, all items are removed.

 

function TVItemPath( Item: THandle; Delimiter: KOLChar ): KOLString;

Returns full path from the root item to given item. Path is calculated as a concatenation of all parent nodes text strings, separated by given delimiter character.

Please note, that returned path has no trailing delimiter, this character is only separating different parts of the path.

If Item is not specified ( =0 ), path is returned for Selected item.

 

function TVItemAtPos( x, y: Integer; var Where: DWORD ): THandle;

Returns handle of item found at specified position (relative to upper left corener of client area of the tree view). If no item found, 0 is returned. Variable Where receives additional flags combination, describing more detailed, on which part of item or tree view given point is located, such as:

 

TVHT_ABOVE

Above the client area

TVHT_BELOW

Below the client area

TVHT_NOWHERE

In the client area, but below the last item

TVHT_ONITEM

On the bitmap or label associated with an item

TVHT_ONITEMBUTTON

On the button associated with an item

TVHT_ONITEMICON

On the bitmap associated with an item

TVHT_ONITEMINDENT

In the indentation associated with an item

TVHT_ONITEMLABEL

On the label (string) associated with an item

TVHT_ONITEMRIGHT

In the area to the right of an item

TVHT_ONITEMSTATEICON

On the state icon for a tree-view item that is in a user-defined state

TVHT_TOLEFT

To the right of the client area

TVHT_TORIGHT

To the left of the client area

 

procedure TVExpand( Item: THandle; Flags: DWORD );

Call it to expand/collapse item's child nodes. Possible values for Flags parameter are:  TVE_COLLAPSE Collapses the list. TVE_COLLAPSERESET Collapses the list and removes the child items. Note that TVE_COLLAPSE must also be specified. TVE_EXPAND Expands the list. TVE_TOGGLE Collapses the list if it is currently expanded or expands it if it is currently collapsed.

 

procedure TVSort( N: THandle );

By Alex Mokrov. Sorts treeview. If N = 0, entire treeview is sorted. Otherwise, children of the given node only.

 

procedure TVEditItem( Item: THandle );

Begins editing given item label in tree view.

 

procedure TVStopEdit( Cancel: Boolean );

Ends editing item label, started by user or explicitly by TVEditItem method.

 

procedure TBAddBitmap( Bitmap: HBitmap );

Adds bitmaps to a toolbar. You can pass special values as Bitmap to add one of predefined system button images bitmaps:

 

THandle(-1) to add standard small icons,

THandle(-2) to add standard large icons,

THandle(-5) to add standard small view icons,

THandle(-6) to add standard large view icons,

THandle(-9) to add standard small history icons,

THandle(-10) to add standard large history icons, (in that case use following values as indexes to the standard and view bitmaps:

 

STD_COPY, STD_CUT, STD_DELETE, STD_FILENEW, STD_FILEOPEN, STD_FILESAVE, STD_FIND, STD_HELP, STD_PASTE, STD_PRINT, STD_PRINTPRE, STD_PROPERTIES, STD_REDO, STD_REPLACE, STD_UNDO,

VIEW_LARGEICONS, VIEW_SMALLICONS, VIEW_LIST, VIEW_DETAILS, VIEW_SORTNAME, VIEW_SORTSIZE, VIEW_SORTDATE, VIEW_SORTTYPE (use it as parameters BtnImgIdxArray in TBAddButtons or TBInsertButtons methods, and in assigning value to TBButtonImage[ ] property). Added bitmaps have indeces starting from previous count of images (as these are appended to existing - if any).

Note, that if You add your own (custom) bitmap, it is not transparent. Do not assume that clSilver is always equal to clBtnFace. Use API function CreateMappedBitmap to load bitmap from resource and map desired colors as you wish (e.g., convert clTeal to clBtnFace). Or, call defined in KOL function LoadMappedBitmap to do the same more easy. Unfortunately, resource identifier for bitmap to pass it to LoadMappedBitmap or to CreateMappedBitmap seems must be integer, so it is necessary to create rc-file manually and compile using Borland Resource Compiler to figure it out.

 

function TBAddButtons( const Buttons: array of PKOLChar; const BtnImgIdxArray: array of Integer ): Integer;

Adds buttons to toolbar. Last string in Buttons array *must* be empty ('' or nil), so to add buttons without text, pass ' ' string (one space char). It is not necessary to provide image indexes for all buttons (it is sufficient to assign index for first button only). But in place, correspondent to separator button (defined by string '-'), any integer must be passed to assign follow image indexes correctly. See example.  To add check buttons, use prefix '+' or '-' in button definition string. If next character is '!', such buttons are grouped to a radio-group. Also, it is possible to use '^' prefix (must be first) to define button with small drop-down section (use also OnTBDropDown event to respond to clicking drop down section of such buttons).

This function returns command id for first added button (other id's can be calculated incrementing the result by one for each button, except separators, which have no command id).

Note: for static toolbar (single in application and created once) ids are started from value 100.

 

function TBInsertButtons( BeforeIdx: Integer; Buttons: array of PKOLChar; const BtnImgIdxArray: array of Integer ): Integer;

Inserts buttons before button with given index on toolbar. Returns command identifier for first button inserted (other can be calculated incrementing returned value needed times. See also TBAddButtons.

 

procedure TBDeleteButton( BtnID: Integer );

Deletes single button given by its command id. To delete separator, use TBDeleteBtnByIdx instead.

 

procedure TBDeleteBtnByIdx( Idx: Integer );

Deletes single button given by its index in toolbar (not by command ID).

 

procedure TBClear;

Deletes all buttons. Dufa

 

procedure TBAssignEvents( BtnID: Integer; Events: array of TOnToolbarButtonClick );

Allows to assign separate OnClick events for every toolbar button. BtnID should be toolbar button ID or index of the first button to assign event. If it is an ID, events are assigned to buttons in creation order. Otherwise, events are assigned in placement order. Anyway, separator buttons are not skipped, so pass at least nil for such button as an event.

Please note, that though not all buttons should exist before assigning events to it, therefore at least the first button (specified by BtnID) must be already added before calling TBAssignEvents.

 

procedure TBResetImgIdx( BtnID, BtnCount: Integer );

Resets image index for BtnCount buttons starting from BtnID.

 

function TBItem2Index( BtnID: Integer ): Integer;

Converts button command id to button index for tool bar.

 

function TBIndex2Item( Idx: Integer ): Integer;

Converts toolbar button index to its command ID..

 

procedure TBConvertIdxArray2ID( const IdxVars: array of PDWORD );

Converts toolbar button indexes to its command IDs for an array of indexes (each item in the array passed is a pointer to Integer, containing button index when the procedure is callled, then all these indexes are relaced with a correspondent button ID).

 

function TBButtonSeparator( BtnID: Integer ): Boolean;

Returns TRUE, if a toolbar button is separator.

 

function TBButtonAtPos( X, Y: Integer ): Integer;

Returns command ID of button at the given position on toolbar, or -1, if there are no button at the position. Value 0 is returned for separators.

 

function TBBtnIdxAtPos( X, Y: Integer ): Integer;

Returns index of button at the given position on toolbar. This also can be index of separator button. -1 is returned if there are no buttons found at the position.

 

function TBBtnEvent( Idx: Integer ): TOnToolbarButtonClick;

Returns toolbar event handler assigned to a toolbar button (by its index).

 

function TBMoveBtn( FromIdx, ToIdx: Integer ): Boolean;

By TR"]F. Moves button from one position to another.

 

procedure TBSetTooltips( BtnID1st: Integer; const Tooltips: array of PKOLChar );

Allows to assign tooltips to several buttons. Until this procedure is not called, tooltips list is not created and no code is added to executable. This method of tooltips maintainance for toolbar buttons is useful both for static and dynamic toolbars (meaning "dynamic" - toolbars with buttons, deleted and inserted at run-time).

 

function TBBtnTooltip( BtnID: Integer ): KOLString;

Returns tooltip assigned to a toolbar button.

 

function PlaceRight: PControl;

Places control right (to previously created on the same parent).

 

function PlaceDown: PControl;

Places control below (to previously created on the same parent). Left position is not changed (thus is, kept equal to Parent.Margin).

 

function PlaceUnder: PControl;

Places control below (to previously created one, aligning its Left position to Left position of previous control).

 

function SetSize( W, H: Integer ): PControl;

Changes size of a control. If W or H less or equal to 0, correspondent size is not changed.

 

function Size( W, H: Integer ): PControl;

Like SetSize, but provides automatic resizing of parent control (recursively). Especially useful for aligned controls.

 

function SetClientSize( W, H: Integer ): PControl;

Like SetSize, but works setting W = ClientWidth, H = ClientHeight. Use this method for forms, which can not be resized (dialogs).

 

function MakeWordWrap: PControl;

Determines if to autosize control (like label, button, etc.)

 

function IsAutoSize: Boolean;

TRUE, if a control is autosizing.

 

function AlignLeft( P: PControl ): PControl;

assigns Left := P.Left

 

function AlignTop( P: PControl ): PControl;

assigns Top := P.Top

 

function ResizeParent: PControl;

Resizes parent, calling ResizeParentRight and ResizeParentBottom.

 

function ResizeParentRight: PControl;

Resizes parent right edge (Margin of parent is added to right coordinate of a control). If called second time (for the same parent), resizes only for increasing of right edge of parent.

 

function ResizeParentBottom: PControl;

Resizes parent bottom edge (Margin of parent is added to bottom coordinate of a control).

 

function CenterOnParent: PControl;

Centers control on parent, or if applied to a form, centers form on screen.

 

function CenterOnForm( Form1: PControl ): PControl;

Centers form on another form. If Form1 not present, centers on screen.

 

function CenterOnCurrentScreen: PControl;

Centers on a display where a mouse is located now. For forms only.

 

function Shift( dX, dY: Integer ): PControl;

Moves control respectively to current position (Left := Left + dX, Top := Top + dY).

 

function SetPosition( X, Y: Integer ): PControl;

Moves control directly to the specified position.

 

function Tabulate: PControl;

Call it once for form/applet to provide tabulation between controls on form/on all forms using TAB / SHIFT+TAB and arrow keys.

 

function TabulateEx: PControl;

Call it once for form/applet to provide tabulation between controls on form/on all forms using TAB / SHIFT+TAB and arrow keys. Arrow keys are used more smart, allowing go to nearest control in certain direction.

 

function SetAlign( AAlign: TControlAlign ): PControl;

Assigns passed value to property Align, aligning control on parent, and returns @Self (so it is "transparent" function, which can be used to adjust control at the creation, e.g.:

MyLabel := NewLabel( MyForm, 'Label1' ).SetAlign( caBottom );

 

function SetChecked( const Value: Boolean ): PControl;

Use it to check/uncheck check box control or push button. Do not apply it to check radio buttons - use SetRadioChecked method below.

 

function SetRadioChecked: PControl;

Use it to check radio button item correctly (unchecking all alternative ones). Actually, method Click is called, and control itself is returned.

 

procedure Click;

Emulates click on control programmatically, sending WM_COMMAND message with BN_CLICKED code. This method is sensible only for buttons, checkboxes and radioboxes.

 

function Perform( msgcode: DWORD; wParam, lParam: Integer ): Integer; stdcall;

Sends message to control's window (created if needed).

 

function Postmsg( msgcode: DWORD; wParam, lParam: Integer ): Boolean; stdcall;

Sends message to control's window (created if needed).

 

procedure AttachProc( Proc: TWindowFunc );

It is possible to attach dynamically any message handler to window procedure using this method. Last attached procedure is called first. If procedure returns True, further processing of a message is stopped. Attached procedure can be detached using DetachProc (but do not attach/detach procedures during handling of attached procedure - this can hang application).

 

procedure AttachProcEx( Proc: TWindowFunc; ExecuteAfterAppletTerminated: Boolean );

The same as AttachProc, but a handler is executed even after terminating the main message loop processing (i.e. after assigning true to AppletTerminated global variable.

 

function IsProcAttached( Proc: TWindowFunc ): Boolean;

Returns True, if given procedure is already in chain of attached ones for given control window proc.

 

procedure DetachProc( Proc: TWindowFunc );

Detaches procedure attached earlier using AttachProc.

 

procedure SetAutoPopupMenu( PopupMenu: PObj );

To assign a popup menu to the control, call SetAutoPopupMenu method of the control with popup menu object as a parameter.

 

function SupportMnemonics: PControl;

This method provides supporting mnemonic keys in menus, buttons, checkboxes, toolbar buttons.

 

function LBItemAtPos( X, Y: Integer ): Integer;

Return index of item at the given position.

 

function RE_TextSizePrecise: Integer;

By Savva. Returns length of rich edit text.

 

function RE_FmtStandard: PControl;

"Transparent" method (returns @Self as a result), which (when called) provides "standard" keyboard interface for formatting Rich text (just call this method, for example:

RichEd1 := NewRichEdit( Panel1, [ ] ).SetAlign( caClient ).RE_FmtStandard;

 

Following keys will be maintained additionally:

 

CTRL+I

switch "Italic"

CTRL+B

switch "Bold"

CTRL+U

switch "Underline"

CTRL+SHIFT+U

switch underline type and turn underline on (note, that some of underline styles can not be shown properly in RichEdit v2.0 and lower, though RichEdit2.0 stores data successfully).

CTRL+O

switch "StrikeOut"

CTRL+'gray+'

increase font size

CTRL+'gray-'

decrease font size

CTRL+SHIFT+'gray+'

superscript

CTRL+SHIFT+'gray-'

subscript

CTRL+SHIFT+Z

ReDo

 

And, though following standard formatting keys are provided by RichEdit control itself in Windows2000, some of these are not functioning automatically in earlier Windows versions, even for RichEdit2.0. So, functionality of some of these (marked with (*) ) are added here too:

 

CTRL+L

align paragraph left

CTRL+R

align paragraph right

CTRL+E

align paragraph center

CTRL+A

select all, double-click on word - select word

CTRL+Right

to next word

CTRL+Left

to previous word

CTRL+Home

to the beginning of text

CTRL+End

to the end of text

CTRL+Z

UnDo

 

 

If You originally assign some (plain) text to Text property, switching "underline" can also change other font attributes, e.g., "bold" - if fsBold style is in default Font. To prevent such behavior, select entire text first (see SelectAll) and make assignment to RE_Font property, e.g.:

 RichEd1.SelectAll;
 RichEd1.RE_Font := RichEd1.RE_Font;
 RichEd1.SelLength := 0;

 

And, some other notices about formatting. Please remember, that only True Type fonts can be succefully scaled and transformed to get desired effects (e.g., bold). By default, RichEdit uses System font face name, which can even have problems with fsBold style. Please remember also, that assigning RE_Font to RE_Font just initializying formatting attributes, making all those valid in entire text, but does not change font attributes. To use True Type font, directly assign face name You wish, e.g.:

 RichEd1.SelectAll;
 RichEd1.RE_Font := RichEd1.RE_Font;
 RichEd1.RE_Font.FontName := 'Arial';
 RichEd1.SelLength := 0;

 

procedure RE_CancelFmtStandard;

Cancels RE_FmtStandard (detaching window procedure handler).

 

function RE_LoadFromStream( Stream: PStream; Length: Integer; Format: TRETextFormat; SelectionOnly: Boolean ): Boolean;

Use this method rather then assignment to RE_Text property, if source is stored in file or stream (to minimize resources during loading of RichEdit content). Data is loading starting from current position in stream and no more then Length bytes are loaded (use -1 value to load to the end of stream). Loaded data replaces entire content of RichEdit control, or selection only, depending on SelectionOnly flag.

If You want to provide progress (e.g. in form of progress bar), assign OnProgress event to your handler - and to examine current position of loading, read TSream.Position property of soiurce stream).

 

function RE_SaveToStream( Stream: PStream; Format: TRETextFormat; SelectionOnly: Boolean ): Boolean;

Use this method rather then RE_TextProperty to store data to file or stream (to minimize resources during saving of RichEdit content). Data is saving starting from current position in a stream (until end of RichEdit data). If SelectionOnly flag is True, only selected part of RichEdit text is saved.

Like for RE_LoadFromStream, it is possible to assign your method to OnProgress event (but to calculate progress of save-to-stream operation, compare current stream position with RE_Size[ rsBytes ] property value).

 

function RE_LoadFromFile( const Filename: KOLString; Format: TRETextFormat; SelectionOnly: Boolean ): Boolean;

Use this method rather then other assignments to RE_Text property, if a source for RichEdit is the file. See also RE_LoadFromStream.

 

function RE_SaveToFile( const Filename: KOLString; Format: TRETextFormat; SelectionOnly: Boolean ): Boolean;

Use this method rather then other similar, if You want to store entire content of RichEdit or selection only of RichEdit to a file.

 

procedure RE_Append( const S: KOLString; ACanUndo: Boolean );

 

procedure RE_InsertRTF( const S: KOLString );

 

procedure RE_HideSelection( aHide: Boolean );

Allows to hide / show selection in RichEdit.

 

function RE_SearchText( const Value: KOLString; MatchCase, WholeWord, ScanForward: Boolean; SearchFrom, SearchTo: Integer ): Integer;

Searches given string starting from SearchFrom position up to SearchTo position (to the end of text, if SearchTo is -1). Returns zero-based character position of the next match, or -1 if there are no more matches. To search in bacward direction, set ScanForward to False, and pass SearchFrom > SearchTo (or even SearchFrom = -1 and SearchTo = 0).

 

function RE_WSearchText( const Value: KOLWideString; MatchCase, WholeWord, ScanForward: Boolean; SearchFrom, SearchTo: Integer ): Integer;

Searches given string starting from SearchFrom position up to SearchTo position (to the end of text, if SearchTo is -1). Returns zero-based character position of the next match, or -1 if there are no more matches. To search in bacward direction, set ScanForward to False, and pass SearchFrom > SearchTo (or even SearchFrom = -1 and SearchTo = 0).

 

function RE_NoOLEDragDrop: PControl;

Just prevents drop OLE objects to the rich edit control. Seems not working for some cases.

 

function CanUndo: Boolean;

Returns True, if the edit (or RichEdit) control can correctly process the EM_UNDO message.

 

procedure EmptyUndoBuffer;

Reset the undo flag of an edit control, preventing undoing all previous changes.

 

function Undo: Boolean;

For a single-line edit control, the return value is always TRUE. For a multiline edit control and RichEdit control, the return value is TRUE if the undo operation is successful, or FALSE if the undo operation fails.

 

procedure FreeCharFormatRec;

Only for RichEdit control: Returns True if successful.

 

 

TControl events

 

property OnHelp: TOnHelp;

An event of a form, it is called when F1 pressed or help topic requested by any other way. To prevent showing help, nullify Sender. Set Popup to TRUE to provide showing help in a pop-up window. It is also possible to change Context dynamically.

 

property OnDropDown: TOnEvent;

Is called when combobox is dropped down (or drop-down button of toolbar is pressed - see also OnTBDropDown).

 

property OnCloseUp: TOnEvent;

Is called when combobox is closed up. When drop down list is closed because user pressed "Escape" key, previous selection is restored. To test if it is so, call GetKeyState( VK_ESCAPE ) and check, if negative value is returned (i.e. Escape key is pressed when event handler is calling).

 

property OnBitBtnDraw: TOnBitBtnDraw;

Special event for BitBtn. Using it, it is possible to provide additional effects, such as highlighting button text (by changing its Font and other properties). If the handler returns True, it is supposed that it made all drawing and there are no further drawing occur.

 

property OnMeasureItem: TOnMeasureItem;

This event is called for owner-drawn controls, such as list box, combo box, list view with appropriate owner-drawn style. For fixed item height controls (list box with loOwnerDrawFixed style, combobox with coOwnerDrawFixed and list view with lvoOwnerDrawFixed option) this event is called once. For list box with loOwnerDrawVariable style and for combobox with coOwnerDrawVariable style this event is called for every item.

 

property OnShow: TOnEvent;

Is called when a control or form is to be shown. This event is not fired for a form, if its WindowState initially is set to wsMaximized or wsMinimized. This behaviour is by design (the window does not receive WM_SHOW message in such case).

 

property OnHide: TOnEvent;

Is called when a control or form becomes hidden.

 

property OnMessage: TOnMessage;

Is called for every message processed by TControl object. And for Applet window, this event is called also for all messages, handled by all its child windows (forms).

 

property OnClose: TOnEventAccept;

Called before closing the window. It is possible to set Accept parameter to False to prevent closing the window. This event events is not called when windows session is finishing (to handle this event, handle WM_QUERYENDSESSION message, or assign OnQueryEndSession event to another or the same event handler).

 

property OnQueryEndSession: TOnEventAccept;

Called when WM_QUERYENDSESSION message come in. It is possible to set Accept parameter to False to prevent closing the window (in such case session ending is halted). It is possible to check CloseQueryReason property to find out, why event occur.

To provide normal application close while handling OnQueryEndSession, call in your code PostQuitMessage( 0 ) or call method Close for the main form, this is enough to provide all OnClose and OnDestroy handlers to be called.

 

property OnMinimize: TOnEvent;

Called when window is minimized.

 

property OnMaximize: TOnEvent;

Called when window is maximized.

 

property OnRestore: TOnEvent;

Called when window is restored from minimized or maximized state.

 

property OnPaint: TOnPaint;

Event to set to override standard control painting. Can be applied to any control (though originally was designed only for paintbox control). When an event handler is called, it is possible to use UpdateRgn to examine what parts of window require painting to improve performance of the painting operation.

 

property OnPrePaint: TOnPaint;

Only for graphic controls. If you assign it, call Invalidate also.

 

property OnPostPaint: TOnPaint;

Only for graphic controls. If you assign it, call Invalidate also.

 

property OnEraseBkgnd: TOnPaint;

This event allows to override erasing window background in response to WM_ERASEBKGND message. This allows to add some decorations to standard controls without overriding its painting in total. Note: When erase background, remember, that property ClientRect can return not true client rectangle of the window - use GetClientRect API function instead. For example:

 

var BkBmp: HBitmap;
procedure TForm1.KOLForm1FormCreate(Sender: PObj);
begin
 Toolbar1.OnEraseBkgnd := DecorateToolbar;
 BkBmp := LoadBitmap( hInstance, 'BK1' );
end;
 
procedure TForm1.DecorateToolbar(Sender: PControl; DC: HDC);
var CR: TRect;
begin
 GetClientRect( Sender.Handle, CR );
 Sender.Canvas.Brush.BrushBitmap := BkBmp;
 Sender.Canvas.FillRect( CR );
end;

 

property OnClick: TOnEvent;

Called on click at control. For buttons, checkboxes and radioboxes is called regadless if control clicked by mouse or keyboard. For toolbar, the same event is used for all toolbar buttons and toolbar itself. To determine which toolbar button is clicked, check CurIndex property. And note, that all the buttons including separator buttons are enumerated starting from 0. Though images are stored (and prepared) only for non-separator buttons. And to determine, if toolbar button was clicked with right mouse button, check RightClick property.

This event does not work on a Form, still it is fired in responce to WM_COMMAND window message mainly rather direct to mouse down. But, if you want to have OnClick event to be fired on a Form, use (following) property OnFormClick to assign it.

 

property OnFormClick: TOnEvent;

Assign you OnClick event handler using this property, if you want it to be fired in result of mouse click on a form surface. Use to assign the event only for forms (to avoid doublicated firing the handler).

Note: for a form, in case of WM_xDOUBLECLK event, this event is fired for both clicks. So if you install both OnFormClick and OnMouseDblClk, handlers will be called in the following sequence for each double click: OnFormClick; OnMouseDblClk; OnFormClick.

 

property OnEnter: TOnEvent;

Called when control receives focus.

 

property OnLeave: TOnEvent;

Called when control looses focus.

 

property OnChange: TOnEvent;

Called when edit control is changed, or selection in listbox or current index in combobox is changed (but if OnSelChanged assigned, the last is called for change selection). To respond to check/uncheck checkbox or radiobox events, use OnClick instead.

 

property OnSelChange: TOnEvent;

Called for rich edit control, listbox, combobox or treeview when current selection (range, or current item) is changed. If not assigned, but OnChange is assigned, OnChange is called instead.

 

property OnResize: TOnEvent;

Called whenever control receives message WM_SIZE (thus is, if control is resized.

 

property OnMove: TOnEvent;

Called whenever control receives message WM_MOVE (i.e. when control is moved over its parent).

 

property OnMoving: TOnEventMoving;

Called whenever control receives message WM_MOVE (i.e. when control is moved over its parent).

 

property OnSplit: TOnSplit;

Called when splitter control is dragging - to allow for your event handler to decide if to accept new size of left (top) control, and new size of the rest area of parent.

 

property OnKeyDown: TOnKey;

Obvious.

 

property OnKeyUp: TOnKey;

Obvious.

 

property OnChar: TOnChar;

Deprecated event, use OnKeyChar.

 

property OnKeyChar: TOnChar;

Obviuos.

 

property OnKeyDeadChar: TOnChar;

Obviuos.

 

property OnMouseUp: TOnMouse;

Obvious.

 

property OnMouseDown: TOnMouse;

Obvious.

 

property OnMouseMove: TOnMouse;

Obvious.

.

 

property OnMouseDblClk: TOnMouse;

Obvious.

 

property OnMouseWheel: TOnMouse;

Mouse wheel (up or down) event. In Windows, only focused controls and controls having scrollbars (or a scrollbar iteself) receive such message. To get direction and amount of wheel, use typecast: SmallInt( HiWord( Mouse.Shift ) ). Value 120 corresponds to one wheel step (-120 - for step back).

 

property OnMouseEnter: TOnEvent;

Is called when mouse is entered into control. See also OnMouseLeave.

 

property OnMouseLeave: TOnEvent;

Is called when mouse is leaved control. If this event is assigned, then mouse is captured on mouse enter event to handle all other mouse events until mouse cursor leaves the control.

 

property OnTestMouseOver: TOnTestMouseOver;

Special event, which allows to extend OnMouseEnter / OnMouseLeave (and also Flat property for BitBtn control). If a handler is assigned to this event, actual testing whether mouse is in control or not, is occuring in the handler. So, it is possible to simulate more careful hot tracking for controls with non-rectangular shape (such as glyphed BitBtn control).

 

property OnEndEditLVItem: TOnEditLVItem;

Called when edit of an item label in ListView control finished. Return True to accept new label text, or false - to not accept it (item label will not be changed). If handler not set to an event, all changes are accepted.

 

property OnLVDelete: TOnDeleteLVItem;

This event is called when an item is deleted in the listview. Do not add, delete, or rearrange items in the list view while processing this notification.

 

property OnDeleteLVItem: TOnDeleteLVItem;

Called for every deleted list view item.

 

property OnDeleteAllLVItems: TOnEvent;

Called when all the items of the list view control are to be deleted. If after returning from this event handler event OnDeleteLVItem is yet assigned, an event OnDeleteLVItem will be called for every deleted item.

 

property OnLVData: TOnLVData;

Called to provide virtual list view with actual data. To use list view as virtaul list view, define also lvsOwnerData style and set Count property to actual row count of the list view. This manner of working with list view control can greatly improve performance of an application when working with huge data sets represented in listview control.

 

property OnCompareLVItems: TOnCompareLVItems;

Event to compare two list view items during sort operation (initiated by LVSort method call). Do not send any messages to the list view control while it is sorting - results can be unpredictable!

 

property OnColumnClick: TOnLVColumnClick;

This event handler is called when column of the list view control is clicked. You can use this event to initiate sorting of list view items by this column.

 

property OnLVStateChange: TOnLVStateChange;

This event occure when an item or items range in list view control are changing its state (e.g. selected or unselected).

 

property OnDrawItem: TOnDrawItem;

This event can be used to implement custom drawing for list view, list box, dropped list of a combobox. For a list view, custom drawing using this event is possible only in lvsDetail and lvsDetailNoHeader styles, and OnDrawItem is called to draw entire row at once only. See also OnLVCustomDraw event.

 

property OnLVCustomDraw: TOnLVCustomDraw;

 

Custom draw event for listview. For every item to be drawn, this event can be called several times during a single drawing cycle - depending on a result, returned by an event handler. Stage can have one of following values:

 

CDDS_PREERASE
CDDS_POSTERASE
CDDS_ITEMPREERASE
CDDS_PREPAINT
CDDS_ITEMPREPAINT
CDDS_ITEM
CDDS_SUBITEM + CDDS_ITEMPREPAINT
CDDS_SUBITEM + CDDS_ITEMPOSTPAINT
CDDS_ITEMPOSTPAINT
CDDS_POSTPAINT
 
When called, see on Stage to get know, on what stage the event is activated. And depend on the stage and on what you want to paint, return a value as a result, which instructs the system, if to use default drawing on this (and follows) stage(s) for the item, and if to notify further about different stages of drawing the item during this drawing cycle. Possible values to return are:

 

CDRF_DODEFAULT

perform default drawing. Do not notify further for this item (subitem) (or for entire listview, if called with flag CDDS_ITEM reset - ?)

CDRF_NOTIFYITEMDRAW

return this value, when the event is called the first time in a cycle of drawing, with ItemIdx = -1 and flag CDDS_ITEM reset in Stage parameter

CDRF_NOTIFYPOSTERASE

usually can be used to provide default erasing, if you want to perform drawing immediately after that

CDRF_NOTIFYPOSTPAINT

return this value to provide calling the event after performing default drawing. Useful when you wish redraw only a part of the (sub)item

CDRF_SKIPDEFAULT

return this value to inform the system that all drawing is done and system should not peform any more drawing for the (sub)item during this drawing cycle.

CDRF_NEWFONT

informs the system, that font is changed and default drawing should be performed with changed font;

 
If you want to get notifications for each subitem, do not use option lvoOwnerDrawFixed, because such style prevents system from notifying the application for each subitem to be drawn in the listview and only notifications will be sent about entire items.

See also NM_CUSTOMDRAW in API Help.

 

property OnTVBeginDrag: TOnTVBeginDrag;

Is called for tree view, when its item is to be dragging.

 

property OnTVBeginEdit: TOnTVBeginEdit;

Is called for tree view, when its item label is to be editing. Return TRUE to allow editing of the item.

 

property OnTVEndEdit: TOnTVEndEdit;

Is called when item label is edited. It is possible to cancel edit, returning False as a result.

 

property OnTVExpanding: TOnTVExpanding;

Is called just before expanding/collapsing item. It is possible to return TRUE to prevent expanding item, otherwise FALSE should be returned.

 

property OnTVExpanded: TOnTVExpanded;

Is called after expanding/collapsing item children.

 

property OnTVDelete: TOnTVDelete;

Is called just before deleting item. You may use this event to free resources, associated with an item (see TVItemData property).

 

property OnTVSelChanging: TOnTVSelChanging;

Is called before changing the selection. The handler can return FALSE to prevent changing the selection.

 

property OnTBDropDown: TOnEvent;

This event is called for drop down buttons, when user click drop part of drop down button. To determine for which button event is called, look at CurItem or CurIndex property. It is also possible to use common (with combobox) property OnDropDown.

 

property OnTBClick: TOnEvent;

The same as OnClick.

 

property OnTBCustomDraw: TOnTBCustomDraw;

An event (mainly) to customize toolbar background.

 

property OnDTPUserString: TDTParseInputEvent;

Special event to parse input from the application. Option dtpoParseInput must be set when control is created.

 

property OnSBBeforeScroll: TOnSBBeforeScroll;

 

property OnSBScroll: TOnSBScroll;

 

property OnDropFiles: TOnDropFiles;

Assign this event to your handler, if You want to accept drag and drop files from other applications such as explorer onto your control. When this event is assigned to a control or form, this has effect also for all its child controls too.

 

property OnScroll: TOnScroll;

 

property OnRE_InsOvrMode_Change: TOnEvent;

This event is called, whenever key INSERT is pressed in control (and for RichEdit, this means, that insert mode is changed).

 

property OnProgress: TOnEvent;

This event is called during RE_SaveToStream, RE_LoadFromStream (and also during RE_SaveToFile, RE_LoadFromFile and while accessing or changing RE_Text property). To calculate relative progress, it is possible to examine current position in stream/file with its total size while reading, or with rich edit text size, while writing (property RE_TextSize[ rsBytes ]).

 

property OnRE_OverURL: TOnEvent;

Is called when mouse is moving over URL. This can be used to set cursor, for example, depending on type of URL (to determine URL type read property RE_URL).

 

property OnRE_URLClick: TOnEvent;

Is called when click on URL detected.

 

 

TControl fields

 

FormString: KOLString;

String of the current parameter. It is cleared after each call to FormExecuteCommands, so no special clearing is required.

 

fDoubleBuffered: Boolean;      

True, if cannot set DoubleBuffered to True (RichEdit).

 

fClassicTransparent: Boolean;  

True, when creating of object is in progress.

 

fDestroying: Boolean;  

True, when destroying of the window is started.

 

fBeginDestroying: Boolean;

true, when destroying of the window is initiated by the system, i.e. message WM_DESTROY fired

 

fChangedPosSz: Byte;  

Flags of changing left (1), top (2), width (4) or height (8)

 

fIsForm: Boolean;  

True, if the object is form.

 

fIsApplet: Boolean;  

True, if the object represent application taskbar button.

 

fIsControl: Boolean;

True, if it is a control on form.

 

fIsMDIChild: Boolean;  

TRUE, if the object is MDI child form.

 

fIsCommonControl: Boolean;  

True, if it is common control.

 

fWindowed: Boolean;    

True, if control is windowed (or is a form). It is set to FALSE only for graphic controls.

 

fCtlClsNameChg: Boolean;

True, if control class name changed and memory is allocated to store it.

 

fChildren: PList;  

List of children.

 

fTmpBrush: HBrush;    

Brush handle to return in response to some color set messages. Intended for internal use instead of Brush.Color if possible to avoid using it.

 

fMenu: HMenu;    

Usually used to store handle of attached main menu, but sometimes is used to store control ID (for standard GUI controls only).

 

fMenuObj: PObj;    

PMenu pointer to TMenu object. Freed automatically with entire chain of menu objects attached to a control (or form).

 

fImageList: PImageList;  

Pointer to first private image list. Control can own several image, lists, linked to a chain of image list objects. All these image lists are released automatically, when control is destroyed.

 

fTextColor: TColor;  

Color of text. Used instead of fFont.Color internally to // avoid usage of Font object if user is not accessing and changing it.

 

fColor: TColor;      

Color of control background.

 

fClientRight: ShortInt;  

Store adjustment factor of ClientRect for some 'idiosincrasies' windows, // such as Groupbox or Tabcontrol.

 

DF: TDataFields;

Data fields for certain controls. These are overlapped to economy size of TControl object.

 

fNestedMsgHandling: SmallInt;    

level of nested message handling for a control. Only when it is 0 at the end of message handling and fBeginDestroying set, the control is destroyed.

 

stdcall;    

MDI client window control

 

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