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
 difference in event

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
pierrotsc Posted - Apr 01 2016 : 12:55:51
what is the difference between the objectclick and selectobject event?
Don't they get triggered at the same time when I click an object ?
Thanks
Pierre
2   L A T E S T    R E P L I E S    (Newest First)
pierrotsc Posted - Apr 01 2016 : 13:41:49
Thank you..I understand now.Appreciate the good explanation.
w2m Posted - Apr 01 2016 : 13:24:13
ObjectClick executes before SelectObject and ObjectClick passes the clicked object in hobj. Only one hobj is passed in the event. ObjectClick only handles one object (hobj) at a time, while SelectObject allows handing all objects.

SelectObject executes after ObjectClick and SelectObject does not pass the selected object in the event. To get the selected object in the SelectObject event call IsSelObj[I] for all the objects in a loop to determine which object(s) are selected. This allows handling all the selected objects. The SelectObject event allows setting the object properties for all of the selected objects such as (color, pen and brush properties...).
procedure TForm1.ImageEnVect1ObjectClick(Sender: TObject; hobj: Integer);
begin
  ShowMessage('Object clicked.');
end;

procedure TForm1.ImageEnVect1SelectObject(Sender: TObject);
var
  i: Integer;
begin
  ShowMessage('Object selected.');
  for i := 0 to ImageEnVect1.ObjectsCount - 1 do
  begin
    if ImageEnVect1.IsSelObject(i) then
    begin
      ListViewObjects1.ItemIndex := i;
      Break;
    end
    else
      ListViewObjects1.ItemIndex := -1;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development