ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Determine when the mouse exits an annotation
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

rswyman@docuxplorer.com

USA
156 Posts

Posted - Jun 29 2018 :  22:52:46  Show Profile  Reply
Hi All,

I use ImageEnVect1.OnObjectOver to know when the move hovers an annotation but how can I be notified when the mouse is not over an annotation?

Thanks
Ron

xequte

38194 Posts

Posted - Jun 30 2018 :  01:48:43  Show Profile  Reply
Hi Ron

Use the standard TImageEnVect.OnMouseMove and FindObjectAt().

https://www.imageen.com/help/TImageEnVect.FindObjectAt.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

rswyman@docuxplorer.com

USA
156 Posts

Posted - Jun 30 2018 :  08:22:19  Show Profile  Reply
This is what I came up with...

procedure TMainForm.ImageEnVect1MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
var
  hobj: integer;
  Distance: double;
begin
  hobj := ImageEnVect1.FindObjectAt(x, y, Distance);
  if (lasthobj > -1) and (Distance > 1) then begin
    ImageEnVect1.ObjBrushColor[lasthobj] := clWhite;
    ImageEnVect1.ObjBrushStyle[lasthobj] := bsClear;
    lasthobj := -1;
  end;

  if (hobj > -1) and (ImageEnVect1.ObjKind[hobj] = iekTEXT) and (Distance < 1) then begin
    if (lasthobj > -1) then begin
      ImageEnVect1.ObjBrushColor[lasthobj] := clWhite;
      ImageEnVect1.ObjBrushStyle[lasthobj] := bsClear;
    end;
    ImageEnVect1.ObjBrushColor[hobj] := clYellow;
    ImageEnVect1.ObjBrushStyle[hobj] := bsSolid;
    Label6.Caption := ImageEnVect1.ObjText[hobj];

    lasthobj := hobj;
  end;
end;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: