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
 difference in event
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
499 Posts

Posted - Apr 01 2016 :  12:55:51  Show Profile  Reply
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

w2m

USA
1990 Posts

Posted - Apr 01 2016 :  13:24:13  Show Profile  Reply
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
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Apr 01 2016 :  13:41:49  Show Profile  Reply
Thank you..I understand now.Appreciate the good explanation.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: