procedure TSkinEdit.DrawItem(WinHandle: HWND;
DC: Hdc; Rect: TRect;
Selected: Bool);
var
rc: TRect;
memdc: HDC;
oldFont: HFont;
oldbmp: HBitmap;
buffer:
array[0..1024]
of Char;
Text: PWideChar;
begin
rc := Rect;
SendMessage(WinHandle, WM_GETTEXT, sizeof(buffer), Integer(@buffer));
Text := buffer;
SetBkMode(
DC, TRANSPARENT);
memdc := CreateCompatibleDC(
Dc);
oldFont := SelectObject(
Dc, GetEditFont);
oldbmp := SelectObject(memdc, SkinEngine.GetBackBitmap(GetParent(WinHandle)));
BitBlt(
DC, rc.left, rc.top, rc.Right, rc.Bottom, memdc, rc.left, rc.top, SRCCOPY);
if GetShadow
then
begin
if IsWindowEnabled(WinHandle)
then
Color:= GetShadowColor
else
Color:=
RGB(255,255,255);
DrawTextToDC(
DC, Text, rc.Left, rc.Top, Color, FFontName, FPointSize, FFontStyle, 1.1, 0);
if IsWindowEnabled(WinHandle)
then
begin
if Selected
then
Color:=AktForecolor
else
Color:= InAktForecolor;
end else
Color:=
RGB(140,140,140);
DrawTextToDC(
DC, Text, rc.Left, rc.Top, Color, FFontName, FPointSize, FFontStyle, 1.1, 0);
end else
DrawTextToDC(
DC, Text, rc.Left, rc.Top, Color, FFontName, FPointSize, FFontStyle, 0, 0);
SelectObject(
DC, oldFont);
DeleteObject(oldFont);
SelectObject(memdc, oldbmp);
DeleteDC(memdc);
end;