win32: teach listview to set correct clDefault color

git-svn-id: trunk@28142 -
This commit is contained in:
paul 2010-11-08 03:16:46 +00:00
parent c322d95b26
commit 8c8ff0c25a

View File

@ -984,11 +984,16 @@ begin
end;
class procedure TWin32WSCustomListView.SetColor(const AWinControl: TWinControl);
var
Color: TColor;
begin
if not WSCheckHandleAllocated(AWinControl, 'TWin32WSCustomListView.SetColor') then
Exit;
Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, ColorToRGB(AWinControl.Color));
Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, ColorToRGB(AWinControl.Color));
Color := AWinControl.Color;
if Color = clDefault then
Color := TWSWinControlClass(AWinControl.WidgetSetClass).GetDefaultColor(AWinControl);
Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, ColorToRGB(Color));
Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, ColorToRGB(Color));
end;
class procedure TWin32WSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer);