Please enable JavaScript to view this site.

KOL/MCK - User Guide

function NewBitBtn( AParent: PControl; const Caption: KOLString; Options: TBitBtnOptions; Layout: TGlyphLayout; GlyphBitmap: HBitmap; GlyphCount: Integer ): PControl;

 

Creates image button (actually implemented as owner-drawn). In Options, it is possible to determine, whether bitmap or image list used to contain one or more (up to 5) images, correspondent to certain BitBtn state.

   

For case of imagelist (option bboImageList), it is possible to use a number of glyphs from the image list, starting from image index given by GlyphCount parameter. Number of used glyphs is passed in that case in high word of GlyphCount parameter (if 0, one image is used therefore). For bboImageList, BitBtn can be Transparent (and in that case bboNoBorder style can be useful to draw custom buttons of non-rectangular shape).

 

For case of bitmap BitBtn, image is stretched down (if too big), but can not be transparent. It is not necessary for bitmap BitBtn to pass correct GlyphCount - it is calculated on base of bitmap size, if 0 is passed.

 

And, certainly, BitBtn can be without glyph image (text only). For that case, it is therefore is more flexible and power than usual Button (but requires more code). E.g., BitBtn can change its Font, Color , and to be totally Transparent. Moreover, BitBtn can be Flat , bboFixed, SpeedButton and have property RepeatInterval.

   

Note: if You use bboFixed Style, use OnChange event instead of OnClick, because Checked state is changed immediately however OnClick occure only when mouse or space key released (and can be not called at all if mouse button is released out of BitBtn bounds). Also, bboFixed defines only which glyph to show (the border if it is not turned off behaves as usual for a button, i.e. it becomes lowered and then raised again at any click).

 

Here You can find references to other properties, events and methods applicable to BitBtn:

 

OnBitBtnDraw

property OnBitBtnDraw: TOnBitBtnDraw;

OnTestMouseOver

property OnTestMouseOver: TOnTestMouseOver;

LikeSpeedButton

function LikeSpeedButton: PControl;

Caption

property Caption: KOLString;

BitBtnDrawMnemonic

property BitBtnDrawMnemonic: Boolean;

TextShiftX

property TextShiftX: Integer;

TextShiftY

property TextShiftY: Integer;

BitBtnImgIdx

property BitBtnImgIdx: Integer;

BitBtnImgList

property BitBtnImgList: THandle;

DefaultBtn

property DefaultBtn: Boolean;

CancelBtn

property CancelBtn: Boolean;

TextAlign

property TextAlign: TTextAlign;

MouseInControl

property MouseInControl: Boolean;

Flat

property Flat: Boolean;

RepeatInterval

property RepeatInterval: Integer;

ImageListNormal

property ImageListNormal: PImageList;

Checked

property Checked: Boolean;

 

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