Sign in Join
Wiki copytemporary

Lazarus Custom Drawn Package: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Lazarus Custom Drawn Package

OldNewLine
1+## About
2+
3+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]].
4+
5+## Advantages
6+
7+- Can be fully reliable in look, behavior and size across platforms
8+- Customizable look (skinnable in a reliable and cross-platform way)
9+- Ability to mix native and custom drawn controls. This is major difference with with using \[fpGUI\] or the \[fpGUI Interface\]: it can't mix native and ownerdrawn (fpgui) components in one application.
10+- They can be utilized in LCL interfaces if the native controls are too unreliable or if no native control exists or if the native controls cannot be used in a convinient way (because they are written in Java, for example)
11+
12+## Units
13+
14+### customdrawncontrols.pas
15+
16+See [[Lazarus Custom Drawn Controls]]
17+
18+### customdrawnextras.pas
19+
20+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.
21+
22+Location of the code in Lazarus: <http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/customdrawn/customdrawnextras.pas?view=markup&root=lazarus>
23+
24+Usage example:
25+
26+``` pascal
27+uses customdrawnextras;
28+
29+var
30+ ActionButton: TBitmappedButton;
31+begin
32+ ActionButton := TBitmappedButton.Create(Self);
33+ ActionButton.Options := [bboUseImageForSelection];
34+ ActionButton.TabStop := True;
35+ ActionButton.OnClick := HandleActionButtonClick;
36+ ActionButton.Tag := i;
37+ ActionButton.Font.Size := 12;
38+ ActionButton.Font.Name := 'Times New Roman';
39+ ActionButton.Font.Color := clWhite;
40+ ActionButton.Parent := Self;
41+ ActionButton.Visible := True;
42+ ActionButton.Height := GetSkins().GetButton(sbSmall).Height;
43+ ActionButton.Width := GetSkins().GetButton(sbSmall).Width;
44+ ActionButton.Left := lLeft;
45+ ActionButton.Top := lTop;
46+ ActionButton.ImageBtn.Assign(GetSkins().GetButton(sbSmall));
47+ ActionButton.ImageBtnFocused.Assign(GetSkins().GetButtonFocused(sbSmall));
48+ ActionButton.ImageBtnDown.Assign(GetSkins().GetButtonDown(sbSmall));
49+ ActionButton.Caption := FModel.ActionButtons[i].Caption;
50+```
51+
52+## Maintainers
53+
54+- Felipe Monteiro de Carvalho
55+- JiXian Yang
56+
57+## See Also
58+
59+- [[Lazarus Components Directory]]
60+
61+---
62+*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](/wiki-contact).*
63+Category: Components
64+Category: Custom Drawn
65+Category: Packages

Back to history