* Use DrawEffect to paint disabled and selected images

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@715 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-02-19 01:27:15 +00:00
parent 216770d05a
commit 3f728b5a6c

View File

@ -3674,7 +3674,8 @@ uses
MMSystem, // for animation timer (does not include further resources) MMSystem, // for animation timer (does not include further resources)
TypInfo, // for migration stuff TypInfo, // for migration stuff
ActnList, ActnList,
StdActns // for standard action support StdActns, // for standard action support
GraphType
{$ifdef EnableAccessible} {$ifdef EnableAccessible}
,VTAccessibilityFactory ,VTAccessibilityFactory
{$endif}; // accessibility helper class {$endif}; // accessibility helper class
@ -23114,7 +23115,7 @@ procedure TBaseVirtualTree.PaintImage(var PaintInfo: TVTPaintInfo; ImageInfoInde
var var
CutNode: Boolean; CutNode: Boolean;
PaintFocused: Boolean; PaintFocused: Boolean;
DrawEnabled: Boolean; DrawEffect: TGraphicsDrawEffect;
begin begin
with PaintInfo do with PaintInfo do
@ -23129,7 +23130,6 @@ begin
else else
PaintInfo.ImageInfo[iiOverlay].Index := -1; PaintInfo.ImageInfo[iiOverlay].Index := -1;
DrawEnabled := not (vsDisabled in Node.States) and Enabled;
with ImageInfo[ImageInfoIndex] do with ImageInfo[ImageInfoIndex] do
begin begin
if (vsSelected in Node.States) and not (Ghosted or CutNode) then if (vsSelected in Node.States) and not (Ghosted or CutNode) then
@ -23142,6 +23142,9 @@ begin
else else
Images.BlendColor := Color; Images.BlendColor := Color;
if (vsDisabled in Node.States) or not Enabled then
DrawEffect := gdeDisabled
else
// Blend image if enabled and the tree has the focus (or ghosted images must be drawn also if unfocused) ... // Blend image if enabled and the tree has the focus (or ghosted images must be drawn also if unfocused) ...
if (toUseBlendedImages in FOptions.FPaintOptions) and PaintFocused if (toUseBlendedImages in FOptions.FPaintOptions) and PaintFocused
// ... and the image is ghosted... // ... and the image is ghosted...
@ -23152,14 +23155,14 @@ begin
not (toGridExtensions in FOptions.FMiscOptions)) or not (toGridExtensions in FOptions.FMiscOptions)) or
// ... or the node must be shown in cut mode. // ... or the node must be shown in cut mode.
CutNode) then CutNode) then
Images.DrawingStyle := dsSelected DrawEffect := gdeShadowed
else else
Images.DrawingStyle := dsNormal; DrawEffect := gdeNormal;
if (vsSelected in Node.States) and not Ghosted then if (vsSelected in Node.States) and not Ghosted then
Images.BlendColor := clDefault; Images.BlendColor := clDefault;
Images.Draw(Canvas, XPos, YPos, Index); Images.Draw(Canvas, XPos, YPos, Index, DrawEffect);
// Now, draw the overlay. // Now, draw the overlay.
// Delphi version has the ability to use the built in overlay indices of windows system image lists // Delphi version has the ability to use the built in overlay indices of windows system image lists