[Lazarus] badge/pill/chip component ?

Michael Van Canneyt michael at freepascal.org
Sat May 5 21:19:14 CEST 2018



On Sat, 5 May 2018, AlexeyT via Lazarus wrote:

> Hi
> I can (want) to write ATBadge component.
> Planned props:
>
> AutoSize
> Color
> ColorInner (for inner colored text)
> Font
> FontInner
> Radius (1..50 in %)
> Caption
> CaptionInner

I had in mind a TBadge with the above props, and then also

Property Shape: TBadgeShape = (rounded, roundrect) ; // Maybe others
Property ImageList : TImagelist
Property CloseBadge : Boolean;
Property Items : TBadgeItems;

With 
TBadgeItem = CLass(TCollectionItem)
Public
   Property Data : Pointer
Published
   Property Caption : String;
   ImageIndex : Integer;
   Tag : PtrInt
end;

Events : 
OneBadgeClose : Procedure (Sender : TObject; aBadge: TBadgeItem; var Allow : Boolean);
OnBadgeClick : Procedure (Sender : TObject; aBadge: TBadgeItem);
OnBadgeImageClick : Procedure (Sender : TObject; aBadge: TBadgeItem);

So the badge component actually draws a collection of badges.

Does that suit your use-case and wishes? If so, please go ahead, I am
curious :)

Michael.


More information about the Lazarus mailing list