GetDefaultBitBtnGlyph variable
Address of the routine used to get default glyphs for TBitBtn instances.
Declaration
GetDefaultBitBtnGlyph: TGetDefaultBitBtnGlyph = NilDescription
GetDefaultBitBtnGlyph is a
TGetDefaultBitBtnGlyph
variable with the address for the routine used to get the default glyphs for
TBitBtn instances in the application.
Kind is a
TBitBtnKind argument that identifies the
content needed in the bitmap returned from the function.
Handled is a
Boolean value which indicates if the
TBitmap instance was successfully created and loaded in the
routine.
Create a function using the signature in TGetDefaultBitBtnGlyph, and assign it the variable to use custom bitmaps for the glyphs in TBitBtn. For example:
// provides Ok and Cancel glyphs
function GetCustomBitBtnGlyph(Kind: TBitBtnKind; Handled: Boolean): TBitmap;
begin
if Kind in [bkOK, bkCancel] then
begin
Result := TBitmap.Create;
case Kind of
bkOk: Result.Assign(MyOkGlyph);
bkCancel: Result.Assign(MyCancelGlyph);
end;
end
else
Result := Nil;
Handled := (Result <> Nil);
end;
// assign the routine to the GetDefaultBitBtnGlyph variable
Buttons.GetDefaultBitBtnGlyph := @GetCustomBitBtnGlyph;See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
