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
 Can't DeSelectAll Layers with mlCreateShapeLayers
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

john_siggy@yahoo.com

USA
138 Posts

Posted - Nov 05 2020 :  14:20:43  Show Profile  Reply
Hi Nigel,

With MouseInteractLayers := MouseInteractLayers + [mlCreateShapeLayers]

Trying to ImageEnView1.LayersDeselectAll when user clicks on ImageEnView1 where there is no layer (ImageEnVect1.FindLayerAt(X, Y) = -1)

The problem is after successful ImageEnView1.LayersDeselectAll one of the shape layers is immediately selected.

xequte

38180 Posts

Posted - Nov 05 2020 :  16:12:43  Show Profile  Reply
Hi

If you put that code in MouseDown then the Layer mouse events will still occur.

Put the code in MouseUp and it will work.



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

john_siggy@yahoo.com

USA
138 Posts

Posted - Nov 06 2020 :  07:55:07  Show Profile  Reply
My code for the MouseUp is:


procedure TForm.ImageEnView1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
//
if (Button = mbLeft) and (SaveX = X) and (SaveY = Y) and (ImageEnView1.FindLayerAt(X, Y) = -1) then
begin
ImageEnView1.LayersDeselectAll;
end;
end;

Clicking on an area without any layers:
On MouseUp the code successfully deselects all layers about 1/2 the time. The other 1/2 a shape is still under the mouse (FindLayerAt <> -1);
Go to Top of Page

xequte

38180 Posts

Posted - Nov 06 2020 :  15:26:56  Show Profile  Reply
Sorry, I think I have misunderstood. What is it you are trying to achieve?


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

john_siggy@yahoo.com

USA
138 Posts

Posted - Nov 06 2020 :  17:58:28  Show Profile  Reply
While in add ShapeLayers mode given by:

ImageEnView1.MouseInteractLayers :=
ImageEnView1.MouseInteractLayers + [mlCreateShapeLayers]

I want the users to be able to deselect all ShapeLayers by clicking on an unpopulated area of ImageEnView1.

The way it works now is clicking on an unpopulated area leads to the same or another ShapeLayer being selected.

My code works half the time because a new ShapeLayer appears automatically when an unpopulated area gets clicked. FindLayerAt(X, Y) can wrongly return populated because this ShapeLayer may be present for a while.
Go to Top of Page

xequte

38180 Posts

Posted - Nov 07 2020 :  23:06:11  Show Profile  Reply
Actually, ImageEn should be deselecting the layer when clicking an unpopulated area anyway. I will fix that for v9.2.6 (late next week). You can email me for the source if you like.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: