- speedup imagelist a bit (thanks to Marc)

- make speedbutton glyph more shiny when mouse over the button

git-svn-id: trunk@12780 -
This commit is contained in:
paul 2007-11-08 09:58:45 +00:00
parent ee80b0fd46
commit 38ac66bbd3
3 changed files with 12 additions and 6 deletions

View File

@ -210,7 +210,7 @@ type
FDownLoaded : Boolean;// value of Down set during loading
FDragging: Boolean;
FFlat: Boolean;
FGlyph: TButtonGlyph;
FGlyph: TButtonGlyph;
FGroupIndex: Integer;
FLastDrawDetails: TThemedElementDetails;
FLayout: TButtonLayout;

View File

@ -867,13 +867,15 @@ begin
end
else msk := AMask.Handle;
R := Rect(0, 0, FWidth, FHeight);
for i := 0 to ACount - 1 do
begin
R := Rect(FWidth * i, 0, FWidth * (i + 1), FHeight);
RawImage_FromBitmap(RawImg, AImage.Handle, msk, R);
ImgData := InternalSetImage(AIndex + i, RawImg);
if HandleAllocated
then TWSCustomImageListClass(WidgetSetClass).Insert(Self, AIndex + i, ImgData);
inc(R.Left, FWidth);
inc(R.Right, FWidth);
end;
{$endif}

View File

@ -892,10 +892,14 @@ function TCustomSpeedButton.DrawGlyph(ACanvas: TCanvas; const AClient: TRect;
BiDiFlags: Longint): TRect;
begin
if Assigned(FGlyph) then
if (AState = bsDown) or (Down = true) then
Result := FGlyph.Draw(ACanvas, AClient, point(AOffset.x + 1, AOffset.y + 1), AState, ATransparent, BiDiFlags)
else
Result := FGlyph.Draw(ACanvas, AClient, AOffset, AState, ATransparent, BiDiFlags);
begin
if (AState = bsUp) and FMouseInControl then
AState := bsExclusive;
if (AState = bsDown) or (Down = true) then
Result := FGlyph.Draw(ACanvas, AClient, point(AOffset.x + 1, AOffset.y + 1), AState, ATransparent, BiDiFlags)
else
Result := FGlyph.Draw(ACanvas, AClient, AOffset, AState, ATransparent, BiDiFlags);
end;
end;
{------------------------------------------------------------------------------