Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

Lazarus Custom Drawn Package

About

The package customdrawn.lpk is an under construction package containing all kinds of custom drawn components for Lazarus. Read more about it in Lazarus Custom Drawn Controls.

Advantages

Units

customdrawncontrols.pas

See Lazarus Custom Drawn Controls

customdrawnextras.pas

The control helps implementing an user interface which has buttons with an unusual look, such as is often found in games. The appearance of the button is defined by a set of raster images which are displayed for each state of the button, such as normal, focused, down.

Location of the code in Lazarus: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/customdrawn/customdrawnextras.pas?view=markup&root=lazarus

Usage example:

pascal
uses customdrawnextras;

var
  ActionButton: TBitmappedButton;
begin
  ActionButton := TBitmappedButton.Create(Self);
  ActionButton.Options := [bboUseImageForSelection];
  ActionButton.TabStop := True;
  ActionButton.OnClick := HandleActionButtonClick;
  ActionButton.Tag := i;
  ActionButton.Font.Size := 12;
  ActionButton.Font.Name := 'Times New Roman';
  ActionButton.Font.Color := clWhite;
  ActionButton.Parent := Self;
  ActionButton.Visible := True;
  ActionButton.Height := GetSkins().GetButton(sbSmall).Height;
  ActionButton.Width := GetSkins().GetButton(sbSmall).Width;
  ActionButton.Left := lLeft;
  ActionButton.Top := lTop;
  ActionButton.ImageBtn.Assign(GetSkins().GetButton(sbSmall));
  ActionButton.ImageBtnFocused.Assign(GetSkins().GetButtonFocused(sbSmall));
  ActionButton.ImageBtnDown.Assign(GetSkins().GetButtonDown(sbSmall));
  ActionButton.Caption := FModel.ActionButtons[i].Caption;

Maintainers

See Also


From the Free Pascal wiki, page "Lazarus Custom Drawn Package", as it stood on 2020-02-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .