wince: try to merge win32 fix of CheckListBox (not tested)

docs: add Yuriy Yeroshkin to contributor list

git-svn-id: trunk@16788 -
This commit is contained in:
paul 2008-09-29 08:28:43 +00:00
parent 7f6b691173
commit d4c1dc0b6d
2 changed files with 18 additions and 18 deletions

View File

@ -125,6 +125,7 @@ Vincent Beuselinck
Vincent Snijders Vincent Snijders
Wanderlan Santos dos Anjos Wanderlan Santos dos Anjos
Wojciech Malinowski Wojciech Malinowski
Yuriy Yeroshkin
Zaenal Mutaqin Zaenal Mutaqin
Zaher Dirkey Zaher Dirkey
Zeljan Rikalo Zeljan Rikalo

View File

@ -157,7 +157,7 @@ var
Brush: HBRUSH; Brush: HBRUSH;
Rect: Windows.Rect; Rect: Windows.Rect;
Details: TThemedElementDetails; Details: TThemedElementDetails;
OldColor: COLORREF; NewColor, OldColor: COLORREF;
OldBackColor: COLORREF; OldBackColor: COLORREF;
WideBuffer: widestring; WideBuffer: widestring;
begin begin
@ -169,10 +169,13 @@ var
Note: GetSysColorBrush is more efficient then getting the Note: GetSysColorBrush is more efficient then getting the
color and creating a brush because it uses a buffered brush color and creating a brush because it uses a buffered brush
} }
if Enabled and Selected then if Selected then
Brush := Windows.GetSysColorBrush(COLOR_HIGHLIGHT or SYS_COLOR_INDEX_FLAG) NewColor := COLOR_HIGHLIGHT
else else
Brush := Windows.GetSysColorBrush(COLOR_WINDOW or SYS_COLOR_INDEX_FLAG); NewColor := COLOR_WINDOW;
Brush := Windows.GetSysColorBrush(NewColor or SYS_COLOR_INDEX_FLAG)
Rect := Data^.rcItem; Rect := Data^.rcItem;
Windows.FillRect(Data^._HDC, Rect, Brush); Windows.FillRect(Data^._HDC, Rect, Brush);
@ -194,21 +197,17 @@ var
because the LCLIntf version makes sure that SYS_COLOR_INDEX_FLAG because the LCLIntf version makes sure that SYS_COLOR_INDEX_FLAG
is added to the constant. is added to the constant.
} }
if Selected then
begin OldBackColor := Windows.SetBkColor(Data^._HDC, Windows.GetSysColor(NewColor));
OldColor := Windows.SetTextColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_HIGHLIGHTTEXT));
OldBackColor := Windows.SetBkColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_HIGHLIGHT)); // $00D39137 if not Enabled then
end OldColor := Windows.SetTextColor(Data^._HDC, Windows.GetSysColor(COLOR_GRAYTEXT))
else if not Enabled then
begin
OldColor := Windows.SetTextColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_GRAYTEXT)); // $00BFBFBF
OldBackColor := Windows.SetBkColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_WINDOW)); // $00FFFFFF
end
else else
begin if Selected then
OldColor := Windows.SetTextColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_WINDOWTEXT)); OldColor := Windows.SetTextColor(Data^._HDC, Windows.GetSysColor(COLOR_HIGHLIGHTTEXT))
OldBackColor := Windows.SetBkColor(Data^._HDC, LCLIntf.GetSysColor(COLOR_WINDOW)); // $00FFFFFF else
end; OldColor := Windows.SetTextColor(Data^._HDC, ColorToRGB(CheckListBox.Font.Color));
WideBuffer := UTF8Decode(CheckListBox.Items[Data^.ItemID]); WideBuffer := UTF8Decode(CheckListBox.Items[Data^.ItemID]);
Windows.DrawTextW(Data^._HDC, PWideChar(WideBuffer), -1, Windows.DrawTextW(Data^._HDC, PWideChar(WideBuffer), -1,