Just we're using TBGRAButton as combobox with a TPopupMenu in testbgracontrols main form =)
The way we style the buttons with different looks is in testbgracontrols. Procedures to change all properties in a TBGRAButton in the bgrasamples unit.
BGRAButton has that kind of drawing with a lot of property for each state (because that, the control is fully customizable), other components like TWin7ToolBar use BGRAButtons and style them with a DrawStyle (TBGRASampleStyle).
BTW if I want to create a 100% equal to for example Win7Button i can't. Some buttons has an' inner shadow' when button is pressed. Some buttons hasn't the offset in the text when you press the button and some other things.. so it is customizable, but if we create separated procedures to draw the buttons those can look as you want.
ToolBars are drawn with a different procedure for each style, for example this to draw an iOS ToolBar
procedure DrawiOSToolBar(ABitmap: TBGRABitmap);
begin
DoubleGradientAlphaFill(ABitmap, Rect(0, 3, ABitmap.Width, ABitmap.Height - 6),
BGRA(172, 185, 201), BGRA(134, 153, 178, 255),
BGRA(125, 147, 175, 255), BGRA(110, 132, 162, 255),
gdVertical, gdVertical, gdVertical, 0.5);
with ABitmap do
begin
// Top Bevel
SetHorizLine(0, 0, Width - 1, BGRA(201, 210, 221, 255));
SetHorizLine(0, 1, Width - 1, BGRA(173, 184, 200, 255));
SetHorizLine(0, 2, Width - 1, BGRA(179, 190, 205, 255));
// Bottom Bevel
SetHorizLine(0, Height - 6, Width - 1, BGRA(107, 129, 158, 255));
SetHorizLine(0, Height - 5, Width - 1, BGRA(116, 139, 170, 255));
SetHorizLine(0, Height - 4, Width - 1, BGRA(48, 54, 62, 255));
// Bottom Shadow
SetHorizLine(0, Height - 3, Width - 1, BGRA(0, 0, 0, 75));
SetHorizLine(0, Height - 2, Width - 1, BGRA(255, 255, 255, 50));
SetHorizLine(0, Height - 1, Width - 1, BGRA(0, 0, 0, 10));
end;
end;
For some things like shadow we need to use BGRABitmap filters, like blur. BGRAImageButton uses BGRABitmap alpha and resample (fine resample).