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
 OnFinishWork event handler for actions?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Apr 11 2015 :  13:09:33  Show Profile  Reply
Hi! I need to enable a Save button AFTER the PROCESSING of a TImageEn has finished. So I put a TImageEnProc on the form and set its AttachedImageEn property to ImageEn1.

However, when I process the ImageEn1 with one of the preset ImageEnViewProc actions from the ImageEn library, the ImageEnProc1.OnFinishWork event is not triggered!

So how can I implement an event handler which is triggered after the ImageEn processing from a preset ImageEn action?

xequte

38616 Posts

Posted - Apr 12 2015 :  01:56:48  Show Profile  Reply
Hi

I assume ImageEn1 is a TImageEnView, so you do not need to use a TImageEnProc, instead just call ImageEn1.Proc....

At any rate, saving does not use a TImageEnProc object (which is for editing and analayzing images) it uses a TImageEnIO object (loading and saving images). Which you can access via ImageEn1.IO...

And just ImageEn1.OnFinishWork to know when saving has completed.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

PeterPanino

933 Posts

Posted - Apr 12 2015 :  04:21:24  Show Profile  Reply
Please note: I need to enable something after the PROCESSING of an image has finished (i.e. after a PROC function), NOT when saving has finished. When I use TImageEn.OnFinishWork, then it would fire also after saving which I do not want.

And BTW: I do the PROCESSING in this case with the predefined ImageEn Actions, so I cannot use ActionList.OnExecute, because that event is fired BEFORE the action is executed.
Go to Top of Page

xequte

38616 Posts

Posted - Apr 13 2015 :  02:04:59  Show Profile  Reply
Hi

It should not matter whether it is saving or editing. The ImageEn actions use TImageEnView.Proc, and TImageEnView.Proc.OnFinishWork is assigned to TImageEnView.OnFinishWork.

I will investigate when I am back in the office next week.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38616 Posts

Posted - Apr 20 2015 :  23:40:29  Show Profile  Reply
Hi

I cannot find any problem with OnFinishWork. It is called correctly after processing of images.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

zerob

162 Posts

Posted - Apr 21 2015 :  09:10:38  Show Profile  Reply
@Peter: You could set a global variable with the state in it, so the OnFinishWork function knows if TImageEn just finished saving or processing.

@Xequte: I think he means, that his OnFinishWork function has no way to know why it was called... What work just finished.
Go to Top of Page

xequte

38616 Posts

Posted - Apr 21 2015 :  20:43:55  Show Profile  Reply
Sorry Peter, I missed the gist of that.

To determine the task type, check the class of the sender:

  if Sender is TImageEnIO then
    MainForm.Caption := 'IO Task has finished'
  else             
  if Sender is TImageEnProc then
    MainForm.Caption := 'Processing Task has finished'
  else                 
    MainForm.Caption := 'Unexpected result!';


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