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