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
 MouseInteract
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
266 Posts

Posted - Jun 25 2019 :  19:25:08  Show Profile  Reply
For the few years that I've been using ImageEn, I've had a simple user interface. Double clicking toggled between MouseInteract = [miScroll] or [miSelectZoom]. I'm now using 8.6 so it is MouseInteractGeneral.

Earlier this year I began working with layers. I've found something I think is strange, perhaps not intended.

If MouseInteract contains [miSelectZoom] or MouseInteractGeneral contains it and MouseInteractLayers contains [mlResizeLayers, mlRotateLayers] or MouseInteractLayers = [] I can toggle between miSelectZoom and miScroll with the double click event as before. But if I happen to double click on a layer, even though it is not active and cannot be selected, it still shows the layer property dialog. The doubleclick event comes before LayerNotify and both receive the double click. And because the doubleclick event is activated, my code toggles between miScroll and miSelectZoom.

If layers are active, I can easily block the double click event like so:

if (mlResizeLayers in ImageEnView1.MouseInteractLayers = true) or
    (mlMoveLayers in ImageEnView1.MouseInteractLayers = true) then
    exit; 

That prevents toggling scroll and zoom when I am working with layers, but that does not work to stop toggling when I have double clicked on an inactive layer.

I would like to either block the double click from activating the layer property dialog or block it from toggling scroll/selectzoom. Either would give my user interface a more consistent feel. Another possibility would be to reactivate the layer when I double click on it.

Are any of these options possible? I have tried a bunch of stuff to detect the double click on the layer, but failed. I have no idea how to block the layer property dialog when the layers are inactive.

A related question:

Prior to 8.6, I replaced MouseInteract = [miScroll] with [mlResizeLayers, mlRotateLayers] and there was no ambiguity as to what the mouse should do.

With 8.6, should I set MouseInteractGeneral := [] when setting MouseInteractLayer := [mlResizeLayers, mlRotateLayers] and vice versa?

J.R.

xequte

38610 Posts

Posted - Jun 26 2019 :  01:59:40  Show Profile  Reply
Hi JR

You can disable double-clicking for Layer properties by calling:

ImageEnView1.LayerOptions := ImageEnView1.LayerOptions - [ loPropsOnDblClick ];

When setting MouseInteractLayers, it will clear any items in MouseInteractGeneral that are incompatible. In this case miScroll is incompatible with layer editing options so it will be automatically removed from MouseInteractGeneral (and vice versa).

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jrpcguru

USA
266 Posts

Posted - Jun 27 2019 :  16:21:44  Show Profile  Reply
Thanks for the prompt reply. I came across loPropsOnDblClick when I was trying to determine what happened with a double click on a text layer. But I completely missed its broader purpose. It did the trick very nicely.

J.R.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: