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
 Remove Layers and Add Layers do not trigger notify
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

nwscomps

190 Posts

Posted - Sep 15 2018 :  11:51:02  Show Profile  Reply
In my code I have:
fCurrentIEView.LayersRemove(fCurrentIEView.LayersCurrent);

and in another part:

fCurrentIEView.LayersCurrent := fCurrentIEView.LayersAdd;
fCurrentIEView.IO.LoadFromFile(OpenImageEnDialog1.FileName);
fCurrentIEView.Update;

Both these codes do not trigger the OnLayerNotifyEx to notify both the deleteion and the creation of layers.
The notification I get only with mouseover, selected, moved, resized, etc..
This happens with latest version of Imageen.
Can you reproduce?
Thanks

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library

klausdoege

Germany
389 Posts

Posted - Sep 15 2018 :  11:59:28  Show Profile  Reply
Hi Francesco,
OnLayerNotifyEx event can have this values:
ielSelected, ielDeselected, ielMoved, ielResized, ielRotated, ielCreated, ielAction, ielEdited, ielRemoved, ielArranged...
Deletion = ielRemoved and creation = ielCreated.
This works by my programms perfect.

Klaus
www.klausdoege.de
Go to Top of Page

nwscomps

190 Posts

Posted - Sep 15 2018 :  12:22:00  Show Profile  Reply
Klaus did you try my code? How are you adding removing layers

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

nwscomps

190 Posts

Posted - Sep 15 2018 :  12:29:31  Show Profile  Reply
Just checked in the imageen code and found the reason why is not notified:

procedure TImageEnView.LayersRemove(LyrIndex: Integer = LYR_SELECTED_LAYERS);
begin
LayersRemoveEx( LyrIndex, loAutoUndoChangesbyCode in fLayerOptions );
end;

procedure TImageEnView.LayersRemoveEx(LyrIndex: Integer = LYR_SELECTED_LAYERS; SaveUndo: Boolean = False; CallLayerNotify: Boolean = False);


........
if CallLayerNotify then
DoLayerNotify( LyrIndex, ielBeforeRemove );

but CallLayerNotify is false by default

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Sep 16 2018 :  02:41:57  Show Profile  Reply
Sorry you're right,
it only works if I edit the layer with the mouse.
If I delete it with a procedure the layer, nothing happens.
So it only responds to mouse events?
This is a pity.

Klaus
www.klausdoege.de
Go to Top of Page

xequte

39141 Posts

Posted - Sep 16 2018 :  04:13:42  Show Profile  Reply
Hi

OnLayerNotifyEx only occurs on user actions, not calls you make in code.

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

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