wince: handle clDefault font color (not tested)

git-svn-id: trunk@28309 -
This commit is contained in:
paul 2010-11-18 02:54:33 +00:00
parent 6380ade6ac
commit 6bf5ba8ef9
3 changed files with 17 additions and 5 deletions

View File

@ -1299,7 +1299,10 @@ begin
begin
if ChildWinControl <> nil then
begin
Windows.SetTextColor(HDC(WParam), Windows.COLORREF(ColorToRGB(ChildWinControl.Font.Color)));
WindowColor := ChildWinControl.Font.Color;
if WindowColor = clDefault then
WindowColor := ChildWinControl.GetDefaultColor(dctFont);
Windows.SetTextColor(WindowDC, Windows.COLORREF(ColorToRGB(WindowColor)));
WindowColor := ChildWinControl.Brush.Color;
if WindowColor = clDefault then
WindowColor := ChildWinControl.GetDefaultColor(dctBrush);

View File

@ -221,7 +221,12 @@ var
else if Selected then
OldColor := Windows.SetTextColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_HIGHLIGHTTEXT))
else
OldColor := Windows.SetTextColor(Data^._HDC, ColorToRGB(CheckListBox.Font.Color));
begin
OldColor := CheckListBox.Font.Color;
if OldColor = clDefault then
OldColor := CheckListBox.GetDefaultColor(dctFont);
OldColor := Windows.SetTextColor(Data^._HDC, ColorToRGB(OldColor));
end;
WideBuffer := UTF8Decode(CheckListBox.Items[Data^.ItemID]);
Windows.DrawTextW(Data^._HDC, PWideChar(WideBuffer), -1,

View File

@ -744,13 +744,17 @@ begin
// TODO ???
end;
class procedure TWinCEWSCustomListView.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
class procedure TWinCEWSCustomListView.SetFont(const AWinControl: TWinControl; const AFont: TFont);
var
Color: TColor;
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, ColorToRGB(AFont.Color));
Color := AFont.Color;
if Color = clDefault then
Color := AWinControl.GetDefaultColor(dctFont);
Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTCOLOR, 0, ColorToRGB(Color));
end;
//roozbeh not supported!