procedure TForm3.tlbSettingsDrawItem(Control: TWinControl;
Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
Icon2: Ticon;
Icon3: Ticon;
TopDif: Integer;
// Gleicht die Höhendifferenz aus
begin
Icon2:= Ticon.Create ;
Icon2.Transparent := True;
Icon3:= Ticon.Create ;
Icon3.Transparent := True;
checkIcon(Icon2, icon3,Control,
Index);
with (Control
as TListbox)
do
begin
if odSelected
in State
then //Prüft, ob ein Item markiert ist
begin
Canvas.Brush.Color :=
RGB(196,188,80);
//Canvas-Hintergrundfarbe setzen
Canvas.FillRect(Rect);
// Hintergrund malen
Canvas.TextOut(Rect.Left + 6, Rect.Top + 6, Items[
Index]);
// Text ausgeben
end;
Canvas.Font.Color:=clWhite;
TopDif := (ItemHeight
div 2) - (Canvas.TextHeight(#32)
div 2);
Canvas.TextRect(Rect, Rect.Left + Icon2.Width + 8, Rect.Top + TopDif, Items[
Index]);
Canvas.FrameRect(Rect);
Canvas.Draw(Rect.Left, Rect.Top, Icon2);
end;
end;