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
 Can't DeSelectAll Layers with mlCreateShapeLayers

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
john_siggy@yahoo.com Posted - Nov 05 2020 : 14:20:43
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.
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 07 2020 : 23:06:11
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
john_siggy@yahoo.com Posted - Nov 06 2020 : 17:58:28
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.
xequte Posted - Nov 06 2020 : 15:26:56
Sorry, I think I have misunderstood. What is it you are trying to achieve?


Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Nov 06 2020 : 07:55:07
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);
xequte Posted - Nov 05 2020 : 16:12:43
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