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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 OnClick

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
egrobler Posted - Dec 09 2013 : 15:46:49
Hi

If I add an object image:

ImageEnVect1.SetObjBitmapFromFile(-1, 'myimage.jpg');
ImageEnVect1.ObjKind[-1] := iekBitmap;
ImageEnVect1.SetObjRect(-1, Rect(0, 0, 800, 600));
ImageEnVect1.ObjStyle[hobj] := [ievsSelectable];
ImageEnVect1.AddNewObject();

How can I detect if the user clicks on the object/image.
I do not want the user to select or or move it, I just need an event if the user clicked on a object

Thanks
Eric
2   L A T E S T    R E P L I E S    (Newest First)
egrobler Posted - Dec 09 2013 : 17:56:17
Perfect, thanks!
w2m Posted - Dec 09 2013 : 16:04:45
Use the OnObjectClicked event. If you select an object the event is executed. If you just click on the background image and not on an object the event is NOT executed.:

procedure TForm1.ImageEnVect1ObjectClick(Sender: TObject; hobj: Integer);
{ ImageEnVect1ObjectClick. }
var
  iObjectKind: string;
begin
  ObjectName1.Text := string(ImageEnVect1.ObjName[hobj]);
  case ImageEnVect1.ObjKind[hobj] of
    iekNONE:
      iObjectKind := 'None';
    iekLINE:
      iObjectKind := 'Line';
    iekBOX:
      iObjectKind := 'Box';
    iekELLIPSE:
      iObjectKind := 'Ellipse';
    iekARC:
      iObjectKind := 'Arc';
    iekBITMAP:
      iObjectKind := 'Bitmap';
    iekText:
      iObjectKind := 'Text';
    iekRULER:
      iObjectKind := 'Ruler';
    iekPOLYLINE:
      iObjectKind := 'Polyline';
    iekANGLE:
      iObjectKind := 'Angle';
    iekMEMO:
      iObjectKind := 'Memo';
    iekLINELABEL:
      iObjectKind := 'LineLabel';
    iekEXTENDED:
      iObjectKind := 'Extended';
  end;
  ObjectKind1.Text := iObjectKind;
end;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html