From 3effa2d5fadca02167e67f5bfa8426c7f18f4372 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 23 Jan 2009 18:08:43 +0000 Subject: [PATCH] win32: set correct bg color and text bg color when we set color to the ListView control (bug #0011051) git-svn-id: trunk@18400 - --- lcl/interfaces/win32/win32wscomctrls.pp | 1 + lcl/interfaces/win32/win32wscustomlistview.inc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lcl/interfaces/win32/win32wscomctrls.pp b/lcl/interfaces/win32/win32wscomctrls.pp index 662e94b948..c12d03a71c 100644 --- a/lcl/interfaces/win32/win32wscomctrls.pp +++ b/lcl/interfaces/win32/win32wscomctrls.pp @@ -124,6 +124,7 @@ type class function GetVisibleRowCount(const ALV: TCustomListView): Integer; override; class procedure SetAllocBy(const ALV: TCustomListView; const AValue: Integer); override; + class procedure SetColor(const AWinControl: TWinControl); override; class procedure SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); override; class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override; class procedure SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); override; diff --git a/lcl/interfaces/win32/win32wscustomlistview.inc b/lcl/interfaces/win32/win32wscustomlistview.inc index f0bc63810d..87d78925e1 100644 --- a/lcl/interfaces/win32/win32wscustomlistview.inc +++ b/lcl/interfaces/win32/win32wscustomlistview.inc @@ -677,6 +677,14 @@ begin ListView_SetItemCount(ALV.Handle, AValue); end; +class procedure TWin32WSCustomListView.SetColor(const AWinControl: TWinControl); +begin + if not WSCheckHandleAllocated(AWinControl, 'TWin32WSCustomListView.SetColor') then + Exit; + Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, AWinControl.Color); + Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, AWinControl.Color); +end; + class procedure TWin32WSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); begin if not WSCheckHandleAllocated(ALV, 'SetDefaultItemHeight')