[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Buttons' (#lcl)

# GetDefaultBitBtnGlyph

Address of the routine used to get default glyphs for TBitBtn instances.

## Declaration

Source position: buttons.pp line 520

`var GetDefaultBitBtnGlyph: TGetDefaultBitBtnGlyph = Nil;`

## Description

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

TGetDefaultBitBtnGlyph |  | TGetDefaultBitBtnGlyph - generic method to return a default Bit Button Glyph of specified Kind.