Difference between revisions of "ColorBox"

From Free Pascal wiki
Jump to navigationJump to search
m (Text replace - "delphi>" to "syntaxhighlight>")
 
(5 intermediate revisions by 4 users not shown)
Line 2: Line 2:
  
 
===About===
 
===About===
 +
 
ColorBox is a component that lets you select any predefined color with preview. There are two predefined palettes available:  
 
ColorBox is a component that lets you select any predefined color with preview. There are two predefined palettes available:  
  
 
* cpDefault (some frequently used named colors)
 
* cpDefault (some frequently used named colors)
 
* cpFull (all named colors)
 
* cpFull (all named colors)
 
 
The download contains the component, and a patch to make use of the cpFull option.
 
  
 
This component was designed for cross-platform applications.
 
This component was designed for cross-platform applications.
Line 16: Line 14:
  
 
===License===
 
===License===
 +
 
[http://www.opensource.org/licenses/lgpl-license.php LGPL]
 
[http://www.opensource.org/licenses/lgpl-license.php LGPL]
 
   
 
   
 
===Download===
 
===Download===
The latest stable release can be found on the [http://sourceforge.net/project/showfiles.php?group_id=92177 Lazarus CCR Files page].
+
 
 +
{{Warning|This component is now part of Lazarus/the LCL; the download is only of historical interest.}}
 +
 
 +
The download contains the component, and a patch to make use of the cpFull option.
 +
 
 +
The download can be found on the [http://sourceforge.net/project/showfiles.php?group_id=92177 Lazarus CCR Files page].
  
 
===Change Log===
 
===Change Log===
 +
 
* Version 1.0 2005/05/16
 
* Version 1.0 2005/05/16
  
 
===Dependencies / System Requirements===
 
===Dependencies / System Requirements===
 +
 
* None
 
* None
  
 
===Notes===
 
===Notes===
This component is now part of the LCL.
 
  
 
Status: Beta
 
Status: Beta
Line 37: Line 42:
  
 
===Installation===
 
===Installation===
 +
 +
{{Warning|ColorBox is currently included in Lazarus; the instructions below only apply for manual installs}}
 +
 
* Apply the patch colorbox.diff
 
* Apply the patch colorbox.diff
 
* Install the component or create it at runtime
 
* Install the component or create it at runtime
  
 
===Creation at runtime===
 
===Creation at runtime===
 +
 
To create the component at runtime use the following code :
 
To create the component at runtime use the following code :
  
<syntaxhighlight>procedure TForm1.Form1Create(Sender: TObject);
+
<syntaxhighlight lang="pascal">
 +
Uses ...ColorBox...
 +
 
 +
procedure TForm1.Form1Create(Sender: TObject);
 
begin
 
begin
 
   cbColorBox := TColorBox.Create(Self);
 
   cbColorBox := TColorBox.Create(Self);
Line 53: Line 65:
 
    
 
    
 
Make sure you don't forget to declare a global variable cbColorBox.
 
Make sure you don't forget to declare a global variable cbColorBox.
 +
 +
===See also===
 +
[https://lazarus-ccr.sourceforge.io/docs/lcl/colorbox/tcolorbox.html TColorBox documentation]
  
 
[[Category:Components]]
 
[[Category:Components]]
 +
[[Category:LCL]]
 +
[[Category:Lazarus]]
 +
[[Category:Lazarus-CCR]]

Latest revision as of 11:25, 11 May 2022

Deutsch (de) English (en) français (fr)

About

ColorBox is a component that lets you select any predefined color with preview. There are two predefined palettes available:

  • cpDefault (some frequently used named colors)
  • cpFull (all named colors)

This component was designed for cross-platform applications.

Author

Darius Blaszijk

License

LGPL

Download

Warning-icon.png

Warning: This component is now part of Lazarus/the LCL; the download is only of historical interest.

The download contains the component, and a patch to make use of the cpFull option.

The download can be found on the Lazarus CCR Files page.

Change Log

  • Version 1.0 2005/05/16

Dependencies / System Requirements

  • None

Notes

Status: Beta

Issues: Tested on Windows. Needs testing on Linux.

Installation

Warning-icon.png

Warning: ColorBox is currently included in Lazarus; the instructions below only apply for manual installs

  • Apply the patch colorbox.diff
  • Install the component or create it at runtime

Creation at runtime

To create the component at runtime use the following code :

Uses ...ColorBox...

procedure TForm1.Form1Create(Sender: TObject);
begin
  cbColorBox := TColorBox.Create(Self);
  cbColorBox.Parent := Self;
  cbColorBox.Left := 100;
  cbColorBox.Top := 100;
  cbColorBox.Palette := cpFull;
end;

Make sure you don't forget to declare a global variable cbColorBox.

See also

TColorBox documentation