win32: set correct bg color and text bg color when we set color to the ListView control (bug #0011051)

git-svn-id: trunk@18400 -
This commit is contained in:
paul 2009-01-23 18:08:43 +00:00
parent 5cb7294343
commit 3effa2d5fa
2 changed files with 9 additions and 0 deletions

View File

@ -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;

View File

@ -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')