Difference between revisions of "BGRAControls"
Line 1: | Line 1: | ||
== Overview == | == Overview == | ||
+ | |||
+ | '''Author:''' Dibo. | ||
+ | |||
+ | '''License:''' Modified LGPL. | ||
As many people know, Lazarus GTK doesn't have full alpha support. I created set of components which use TBGRABitmap for drawing icons, so it partialy solve problem with alpha in GTK. But this components set is not only GTK patch but have more fancy components which using power of BGRABitmap package. | As many people know, Lazarus GTK doesn't have full alpha support. I created set of components which use TBGRABitmap for drawing icons, so it partialy solve problem with alpha in GTK. But this components set is not only GTK patch but have more fancy components which using power of BGRABitmap package. |
Revision as of 16:26, 1 May 2011
Overview
Author: Dibo.
License: Modified LGPL.
As many people know, Lazarus GTK doesn't have full alpha support. I created set of components which use TBGRABitmap for drawing icons, so it partialy solve problem with alpha in GTK. But this components set is not only GTK patch but have more fancy components which using power of BGRABitmap package.
Related Articles
BGRAButton Gallery - Gallery of buttons with source code to use in your projects with BGRAButton.
Installation
BGRABitmap: http://wiki.lazarus.freepascal.org/BGRABitmap
BGRAControls: http://sourceforge.net/projects/bgracontrols/files/
You need lazarus 0.9.31 from SVN (revision >= 29834).
You need install BGRABitmap package first (it is as requied package in my package).
Install like others components by selecting bgracontrols.lpk from "Package->Open package file". This set of components is crossplatform (tested on linux GTK and windows) but if you want use BGRABitmap drawing only for GTK then install package with -dGTK_ONLY switch in package compiler options. With this switch it use default lazarus drawing for other interfaces than GTK.
Using
Drop TBGRAImageList or TBGRASpeedButton from "BGRA controls" palette and use like normal component. Example: Add icons, drop TToolBar and assign BGRAImageList to Toolbar. Images property in object inspector.
TBGRAImageList
Before:
After:
Component which inherit from TImageList. So each control (tested on TToolBar and TTreeView) which using TImageList.Draw method for drawing icons, automatically can have alpha support. Just use this component instead of TImageList.
TBGRASpeedButton
Component which inherit from TSpeedButton and draw glyph using TBGRABitmap.
TBGRAButton
Customizable graphic component which using only BGRABitmap functions for drawing. Demo project included in package.
Functionality:
- Gradients
- Double gradients
- Rounding
- Border style, width and color
- Drop down list
- Glyph
- States (normal, hover, clicked)
- Caption with shadow
- Full alpha and antialias support
- Can work as Image if no caption is set (have no stretch function yet)
ToDO:
I wanted add "container" functionality (like TPanel) so this same component could be used as toolbar with childs but TCustomControl have no transparency.
I created task for this issue in forum: http://www.lazarus.freepascal.org/index.php/topic,12933.0.html
And mailing list: http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-April/062683.html
I try report this as a bug. Instead, I created TBGRAPanel with similar gradient functionality (but very limited).
TBGRAPanel
Simple TPanel descendant which can have gradient background. Created especially for TBGRAButton (for creating nice looking toolbar for bgrabuttons).