procedure TXPStyleButton.DrawGlyph(
const Location: TPoint);
var
OldBrushColor: TColor;
SelBmp: TBitmap;
NewLocation: TPoint;
ActionList: TCustomActionList;
begin
NewLocation := Location;
if not ActionBar.DesignMode
and MouseInControl
and
not IsChecked
and Enabled
and ActionClient.HasGlyph
then
begin
OldBrushColor := Canvas.Brush.Color;
SelBmp := TBitmap.Create;
try
ActionList := ActionClient.Action.ActionList;
if ActionList.Images.GetBitmap(ActionClient.ImageIndex, SelBmp)
then
begin
Canvas.Brush.Color := GetShadowColor(ActionBar.ColorMap.SelectedColor);
SelBmp.Width := ActionList.Images.Width;
SelBmp.Height := ActionList.Images.Width;
ActionList.Images.Draw(SelBmp.Canvas, 0, 0, ActionClient.ImageIndex, dsNormal, itMask);
// Eingefüge Zeile
DrawState(Canvas.Handle, Canvas.Brush.Handle,
nil, SelBmp.Handle, 0,
NewLocation.X + 1, NewLocation.Y + 1, 0, 0, DST_BITMAP
or DSS_MONO);
end;
finally
SelBmp.Free;
Canvas.Brush.Color := OldBrushColor;
end;
if not IsChecked
then
begin
Dec(NewLocation.X);
Dec(NewLocation.Y);
end;
end;
if not (csDesigning
in ComponentState)
and ((FState = bsDown)
and not IsChecked)
and IsMouseButtonPressed
then
begin
Inc(NewLocation.X);
Inc(NewLocation.Y);
end;
inherited DrawGlyph(NewLocation);
end;