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
 mlMoveLayers and miSelect still incompatible?

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
PeterPanino Posted - Nov 07 2021 : 05:43:27
TImageEnView 10.2.0:

MouseInteractGeneral.miSelect and MouseInteractLayers.mlMoveLayers are still MUTUALLY EXCLUSIVE at run-time! (In previous versions they were mutually exclusive even at design-time, i.e. they erased each other at design-time).

This is annoying, as it forces the user to manually switch between modes where he has to explicitly select a mode to EITHER make a selection with the mouse OR to move a selected layer with the mouse.

To make this process of mode-switching somewhat automatic, I have implemented this workaround in my app:

procedure TformMain.imgMainLayerNotify(Sender: TObject; layer: Integer; event: TIELayerEvent);
begin
  if event = ielLeftClicked then
  begin
    if layer = 0 then // user has left-clicked the image-background
    begin
      imgMain.MouseInteractGeneral := [miSelect];
    end
    else  // user has left-clicked a layer
    begin
      imgMain.MouseInteractGeneral := [];
      imgMain.MouseInteractLayers := [mlMoveLayers,mlResizeLayers,mlRotateLayers];
    end;
  end;
end;


But since the LayerNotify event of ielLeftClicked is not instantaneous (it occurs at mouse-button-UP), this is a MULTI-STEP process: The user has to first click either the image-background or a layer, then release the mouse button, and only then he can make a selection or move the layer respectively. It would be better if this mode-switching would occur internally and automatically inside TImageEnView.

What do you think?
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 10 2021 : 17:13:36
You can just use:

lyr := ImageEnView1.FindLayerAt( X, Y );


https://www.imageen.com/help/TImageEnView.FindLayerAt.html

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Nov 10 2021 : 04:48:03
Hi Nigel,

But the MouseDown event would not get me the layer number. Why do you think the MouseDown event is better?
xequte Posted - Nov 10 2021 : 04:45:04
Hi Peter

You would probably be better to implement your code into the MouseDown event. Though there may be side effects.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Nov 10 2021 : 03:00:56
I understand. Could the workaround for automatic switching I proposed above be optimized by TImageEnView internally?
xequte Posted - Nov 10 2021 : 01:16:11
Hi Peter

The problem is that the mlMoveLayers and miSelect are mutually exclusive. Clicking the background with mlMoveLayers generates a layer selection rectangle, which clashes with miSelect. Also, mlMoveLayers would prevent miSelect from allowing selection of content within image layers.

Nigel
Xequte Software
www.imageen.com