procedure TForm1.PopupMenu1DrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; AState: TOwnerDrawState);
var
x, y: Integer;
begin
ACanvas.Font.Assign(Screen.MenuFont);
if AState * [odSelected, odFocused] <> [] then begin
ACanvas.Brush.Color := RGBToColor(216, 215, 255);
ACanvas.Pen.Color := RGBToColor(190, 190, 230);
ACanvas.Rectangle(ARect);
//ACanvas.Font.Style := [fsBold];
end
else
ACanvas.GradientFill(ARect, clSkyBlue, clSkyBlue, gdHorizontal);
x := 2;
y := (ARect.Top + ARect.Bottom - ImageList1.Height) div 2;
ImageList1.Draw(ACanvas, x, y, TMenuItem(Sender).ImageIndex, TMenuItem(Sender).Enabled);;
x := x + ImageList1.Width + 4;
ACanvas.Pen.Color := clGray;
ACanvas.Line(x, ARect.Top, x, ARect.Bottom);
x := x + 4;
y := (ARect.Top + ARect.Bottom - ACanvas.TextHeight('Tg')) div 2;
ACanvas.Brush.Style := bsClear;
ACanvas.TextOut(x, y, TMenuItem(Sender).Caption);
end;