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
 Prevent the IMAGE-CHANGED status for ImageEnView1?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Aug 26 2020 :  07:46:50  Show Profile  Reply
Making a change to the TImageEnView image, for example:

ImageEnMView1.CopyToIEBitmap(idx, MainForm.formMain.ImageEnView1.IEBitmap, True);


...causes the ImageEnView1 SAVE Toolbar-Button to change from DISABLED to ENABLED

How can I suppress this IMAGE-CHANGED status for ImageEnView1 for any specific cases and thus prevent the enabling of the Save toolbar-button?

BTW, how to temporarily disable a specific Toolbar Button, e.g. IEViewSave_Button_ID?

xequte

38615 Posts

Posted - Aug 26 2020 :  16:07:51  Show Profile  Reply
Hi Peter

1. In the TImageEnView.OnImageChange event, you can set ImageEnView1.Modified := False;

Alternatively, if you are using a TImageEnViewToolbar (i.e. not the automatic TImageEnView popup toolbar), you could iterate over the buttons to find the one with the TImageEnViewSave action and set EnableOnlyWhenChanged := False;


2. Specific buttons cannot be enabled/disabled as it is handled by TActions. You can only include/exclude buttons using:

https://www.imageen.com/help/TCustomImageEnToolbar.OnAddButton.html
https://www.imageen.com/help/TIEImageEnGlobalSettings.OnAddToolbarButton.html

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

PeterPanino

933 Posts

Posted - Aug 26 2020 :  16:32:51  Show Profile  Reply
Hi Nigel,

with the above code:

ImageEnMView1.CopyToIEBitmap(idx, MainForm.formMain.ImageEnView1.IEBitmap, True);


... neither the OnImageChange event-handler nor the OnImageChangeEx event-handler for ImageEnView1 gets triggered - but yet the SAVE button gets activated!

Could you please provide a code example on how to "iterate over the buttons to find the one with the TImageEnViewSave action"? Thank you!

PS: I have tried this code but was stuck on how to access the button's action:

procedure TformMain.DisableSaveToolbarButton;
var
  bt: TImageEnViewButton;
begin
  // iterate over the buttons to find the one with the TImageEnViewSave action and set EnableOnlyWhenChanged := False;

  for bt := Low(TImageEnViewButton) to High(TImageEnViewButton) do
  begin
    // how to find the one with the TImageEnViewSave action?
  end;
end;
Go to Top of Page

PeterPanino

933 Posts

Posted - Aug 26 2020 :  17:42:13  Show Profile  Reply
Working solution:

ImageEnMView1.CopyToIEBitmap(idx, MainForm.formMain.imgMain.IEBitmap, True); 
MainForm.formMain.imgMain.Modified := False;


With this, I don't need to manually disable the SAVE button - it remains disabled!
Go to Top of Page

PeterPanino

933 Posts

Posted - Aug 27 2020 :  04:47:56  Show Profile  Reply
However, when pasting with the PASTE TOOLBAR-BUTTON then the SAVE-BUTTON gets ALWAYS ENABLED!

So PLEASE implement TImageEnView.OnPaste event and an event when any Toolbar-Button is clicked to get notified which toolbar-button has been clicked! Thank you!
Go to Top of Page

xequte

38615 Posts

Posted - Aug 27 2020 :  20:03:47  Show Profile  Reply
Hi Peter

In the v9.1.2 beta there is an OnActionExecute event which you can use to react to paste actions.



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

PeterPanino

933 Posts

Posted - Aug 28 2020 :  03:05:25  Show Profile  Reply
Hi Nigel,

Thanks for the information. When will v9.1.2(+) Release be available?
Go to Top of Page

xequte

38615 Posts

Posted - Aug 30 2020 :  22:43:46  Show Profile  Reply
Hi

Before the end of September. You can email us for a pre-release 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: