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; end;
class procedure TWin32WSCustomListView.SetColor(const AWinControl: TWinControl); class procedure TWin32WSCustomListView.SetColor(const AWinControl: TWinControl);
var
Color: TColor;
begin begin
if not WSCheckHandleAllocated(AWinControl, 'TWin32WSCustomListView.SetColor') then if not WSCheckHandleAllocated(AWinControl, 'TWin32WSCustomListView.SetColor') then
Exit; Exit;
Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, ColorToRGB(AWinControl.Color)); Color := AWinControl.Color;
Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, ColorToRGB(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; end;
class procedure TWin32WSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); class procedure TWin32WSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer);