Selection Options is a property to control rubberband selections.
To prevent object resizing there are two ways:
1. ImageEnVect1.ObjStyle
2. ImageEnVect1ObjectMoveResize event
You can accomplish this by setting object styles as shown below:
procedure TMainForm.RadioGroup1Click( Sender: TObject );
var
i: Integer;
hobj: Integer;
begin
// the radiogroup items are: 0 'Resize and Move' 1 'Move'
// setting the ObjStyle automatically sets the appropriate cursors
for i := 0 to ImageEnVect1.SelObjectsCount - 1 do
begin
hobj := ImageEnVect1.SelObjects[ i ];
if ( RadioGroup1.ItemIndex = 1 ) then
begin
// Only allow moving objects
ImageEnVect1.ObjStyle[ hobj ] := ImageEnVect1.ObjStyle[ hobj ] - [ ievsSizeable ];
end
else
begin
// Allow object resizing and moving
ImageEnVect1.ObjStyle[ hobj ] := ImageEnVect1.ObjStyle[ hobj ] + [ ievsSizeable ];
end;
end;
end;
You can accomplish this by preventing resizing the object in the ObjectMoveResize
event as shown below:
procedure TMainForm.ImageEnVect1ObjectMoveResize( Sender: TObject; hobj, Grip: Integer; var OffsetX, OffsetY: Integer );
begin
ASelectionChanging := true;
// Only allow moving objects
if Grip <> 3 then // Grip 3 is the selection grip... all other grips are resizing grips
begin
OffsetX := 0;
OffsetY := 0;
end;
end;
William Miller