I am trying to do some drawing on the background using RVStyle1DrawParaBack. But I can't get it to work. I'm trying to just draw a color in the background but only in the current para. I need a way to restrict it to just the para with the cursor in it, otherwise it draws it in every para. I have tried a lot of stuff this afternoon and can't get it to do what I'm after!
Here's what I have:
Code: Select all
ACanvas.Brush.Color := Sender.Color;
ACanvas.FillRect(ARect);
if not EditorActiveLine1.Checked then exit;
//Note: setting RVStyle1.ParaStyles LineSpacing to 105% helps with the "look"
//of the highlight area.
//Note: I originally used "if Sender.ItemNo = RichViewEdit1.CurItemNo then..."
//but that failed when I put a tab into the line. No idea why. But using the
//line number from each item worked better, but not 100%:
if rve.GetLineNo(Sender.ItemNo,0) = rve.GetLineNo(rve.CurItemNo,0) then
begin
//ACanvas.Brush.Color := clGrayText;
//ACanvas.FillRect(r);
//ColorBlend looks better as it is alpha blended:
ColorBlend(ACanvas, ARect, clGrayText , 70);
end;
Any advice appreciated.
Edit: What I have above does work most of the time. I had a file with some odd formatting that gave me some trouble. I'll keep testing it but if you have any ideas please let me know.
Stan