Mouse Hoover on Fast Report

Dear all,

I'm using FR 2.5,
I want to make a Hoover Line on Fast Report, which it will show when i do some
MouseOver on it (it's like a Hoover Line on DBGrid).

So i already built it with this pseudocode:

var
fr: TfrReport;

fr.OnMouseOverObject := DoMouseOverObject;

procedure TcpReport.DoMouseOverObject(iView: TfrView;
var oCursor: TCursor);

procedure CreateHooverLine;
begin
FHooverLine := TShape.Create(self);
FHooverLine.Brush.Color := $00F9E3F9;
FHooverLine.Brush.Style := bsSolid;
FHooverLine.Pen.Mode := pmMask;
FHooverLine.Pen.Style := psClear;
FHooverLine.Parent := fr.Preview.Window.PaintBox;
end;
begin
if not Assigned(FHooverLine) then CreateHooverLine;
if pos('MEMO', Uppercase(iView.Name)) > 0 then begin
FHooverLine.Left :=
TfrEMFPages(TCpPBox(FHooverLine.Parent).Preview.EMFPages).Pages[0]^.R.Left;
FHooverLine.Top := iView.y + iView.OffsY;
FHooverLine.Height := iView.dy;
FHooverLine.Width :=
TfrEMFPages(TPBox(FHooverLine.Parent).Preview.EMFPages).Pages[0]^.R.
Right -
TfrEMFPages(TPBox(FHooverLine.Parent).Preview.EMFPages).Pages[0]^.R.
Left;
FHooverLine.Visible := True;
fr.Preview.Window.Repaint;
end
else begin
FHooverLine.Visible := False;
end;
end;

It do well, but when i'm dragging the page and replacing again my mouse on it, the Hoover Line didn't place well on the right coordinates, do anybody know how to solved it??

Thanks for ur help,
and sorry for my english ;)

sandy


Comments

  • edited 4:59PM
    I has solved it.
    The previous codes are almost right,
    but i forget to rePaint it.

    So, i just need to reDraw TPBox object.
    TPBox(FHooverLine.Parent).Invalidate;

    (with FHooverLine.Parent := fr.Preview.Window.PaintBox )
    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.