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
 TImageEnVect SelectOptions

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
randal46 Posted - Oct 05 2011 : 05:12:07
Hi,

Though I have the following line:
SelectionOptions := [iesoMoveable];

when I select objects they are resizable. How can I prevent objects from being resized?
Also how do I prevent it from changing the cursor?

Thanks
6   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Oct 05 2011 : 13:45:01
Perhaps you may want the event OnSetCursor. For example:
procedure TForm1.ImageEnVect1SetCursor(Sender: TObject; var Cursor: TCursor);
begin
  Cursor := 1785;
end;
w2m Posted - Oct 05 2011 : 10:11:06
Contact support@imageen.com. I do not think it is possible to change the cursor to 1785. If you did manage to change the move cursor to 1785 you would have no user feedback that the object could be moved.

William Miller
randal46 Posted - Oct 05 2011 : 09:44:25
That's right, it changes to move cursor.
By default cursor I meant cursor 1785.
w2m Posted - Oct 05 2011 : 07:36:34
Here setting the ObjStyle automatically sets the appropriate cursors so when ievsSizeable is removed from the objectstyle I only see the move cursor. When I add ievsSizeable I get the move cursor and resizing cursors.

I do not know of a way to change object cursors.

What do you mean 'default' cursor?


William Miller
randal46 Posted - Oct 05 2011 : 07:19:31
Thanks, it did it.
Now to the second question, how to prevent change of cursor on selection. It show 4 different cursors on selection, one diagonal, another horizontal, a 3rd one vertical and also a cross with pointers. I only want the default cursor.
w2m Posted - Oct 05 2011 : 06:28:39
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