win32 interface: implemented setting listview.font.color (bug #8773)

git-svn-id: trunk@11807 -
This commit is contained in:
vincents 2007-08-13 21:35:55 +00:00
parent 3c7d2a9d84
commit 31a2d5bbb8
3 changed files with 13 additions and 1 deletions

View File

@ -34,7 +34,7 @@ uses
ImgList, StdCtrls,
LCLProc, InterfaceBase,
// widgetset
WSComCtrls, WSLCLClasses, WSProc,
WSComCtrls, WSLCLClasses, WSControls, WSProc,
// win32 widgetset
Win32Int, Win32Proc, Win32WSControls;
@ -132,6 +132,7 @@ type
class procedure SetAllocBy(const ALV: TCustomListView; const AValue: Integer); 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;
class procedure SetHoverTime(const ALV: TCustomListView; const AValue: Integer); override;
// class procedure SetIconOptions(const ALV: TCustomListView; const AValue: TIconOptions); override;

View File

@ -464,6 +464,8 @@ end;
class procedure TWin32WSWinControl.SetFont(const AWinControl: TWinControl; const AFont: TFont);
begin
if not WSCheckHandleAllocated(AWinControl, 'SetFont')
then Exit;
Windows.SendMessage(AWinControl.Handle, WM_SETFONT, Windows.WParam(AFont.Handle), 1);
end;

View File

@ -628,6 +628,15 @@ begin
// TODO ???
end;
class procedure TWin32WSCustomListView.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
begin
// call inherited SetFont; need to do it this way,
// because the compile time ancestor class is TWSCustomListView
TWSWinControlClass(ClassParent).SetFont(AWinControl, AFont);
Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTCOLOR, 0, AFont.Color);
end;
class procedure TWin32WSCustomListView.SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles);
const
MASK = LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE or LVS_EX_UNDERLINEHOT or LVS_EX_UNDERLINECOLD;