Please enable JavaScript to view this site.

KOL/MCK - User Guide

function NewToolbar( AParent: PControl; Align: TControlAlign; Options: TToolbarOptions; Bitmap: HBitmap; const Buttons: array of PKOLChar; const BtnImgIdxArray: array of Integer ): PControl;

 

Creates toolbar control. Bitmap (if present) must contain images for all buttons excluding separators (defined by string '-' in Buttons array) and system images, otherwise last buttons will no have images at all. Image width for every button is assumed to be equal to Bitmap height (if last of "squares" has insufficient width, it will not be used). To define fixed buttons, use characters '+' or '-' as a prefix for button string (even empty). To create groups of (radio-)buttons, use also '!' follow '+' or '-'. (These rules are similar used in menu creation). To define drop down button, use (as first) prefix '^'. (Do not forget to set OnTBDropDown event for this case). If You want to assign images to buttons not in the same order how these are placed in Bitmap (or You use system bitmap), define for every button (in BtnImgIdxArray array) indexes for every button (excluding separator buttons). Otherwise, it is possible to define index only for first button (e.g., [0]). It is also possible to change TBImages[ ] property for such purpose, or do the same in method TBSetBtnImgIdx).

 

Following properties, methods and event are specially designed to work with toolbar control:

 

OnDropDown

property OnDropDown: TOnEvent;

OnClick

property OnClick: TOnEvent;

OnTBDropDown

property OnTBDropDown: TOnEvent;

OnTBClick

property OnTBClick: TOnEvent;

OnTBCustomDraw

property OnTBCustomDraw: TOnTBCustomDraw;

TBAddBitmap

procedure TBAddBitmap( Bitmap: HBitmap );

TBAddButtons

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

TBInsertButtons

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

TBDeleteButton

procedure TBDeleteButton( BtnID: Integer );

TBDeleteBtnByIdx

procedure TBDeleteBtnByIdx( Idx: Integer );

TBClear

procedure TBClear;

TBAssignEvents

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

TBResetImgIdx

procedure TBResetImgIdx( BtnID, BtnCount: Integer );

TBItem2Index

function TBItem2Index( BtnID: Integer ): Integer;

TBIndex2Item

function TBIndex2Item( Idx: Integer ): Integer;

TBConvertIdxArray2ID

procedure TBConvertIdxArray2ID( const IdxVars: array of PDWORD );

TBButtonSeparator

function TBButtonSeparator( BtnID: Integer ): Boolean;

TBButtonAtPos

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

TBBtnIdxAtPos

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

TBMoveBtn

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

TBSetTooltips

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

TBBtnTooltip

function TBBtnTooltip( BtnID: Integer ): KOLString;

CurIndex

property CurIndex: Integer;

Count

property Count: Integer;

RightClick

property RightClick: Boolean;

TBCurItem

property TBCurItem: Integer;

TBButtonCount

property TBButtonCount: Integer;

TBBtnImgWidth

property TBBtnImgWidth: Integer;

TBButtonEnabled

property TBButtonEnabled[ BtnID: Integer ]: Boolean;

TBButtonVisible

property TBButtonVisible[ BtnID: Integer ]: Boolean;

TBButtonChecked

property TBButtonChecked[ BtnID: Integer ]: Boolean;

TBButtonMarked

property TBButtonMarked[ BtnID: Integer ]: Boolean;

TBButtonPressed

property TBButtonPressed[ BtnID: Integer ]: Boolean;

TBButtonText

property TBButtonText[ BtnID: Integer ]: KOLString;

TBButtonImage

property TBButtonImage[ BtnID: Integer ]: Integer;

TBButtonRect

property TBButtonRect[ BtnID: Integer ]: TRect;

TBButtonWidth

property TBButtonWidth[ BtnID: Integer ]: Integer;

TBButtonLParam

property TBButtonLParam[ const Idx: Integer ]: DWORD;

TBButtonsMinWidth

property TBButtonsMinWidth: Integer;

TBButtonsMaxWidth

property TBButtonsMaxWidth: Integer;

TBRows

property TBRows: Integer;

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