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
 OnZoomIn/OnZoomOut issue
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

880 Posts

Posted - Mar 07 2024 :  12:04:03  Show Profile  Reply
The events TImageEnView.OnZoomIn and TImageEnView.OnZoomOut are not triggered when setting the Zoom programmatically, for example:

ImageEnView1.Zoom := ImageEnView1.Zoom + 10;


However, they are triggered when setting the Zoom with the mouse wheel.

This is shown in the following test project:

attach/PeterPanino/20243712229_MouseInteractionsTest_ZoomIssue.zip
76.92 KB

Is this a bug?

xequte

38319 Posts

Posted - Mar 07 2024 :  19:48:18  Show Profile  Reply
Hi Peter

As per the documentation, OnZoomIn/OnZoomOut only occur when the user changes the zoom.

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

PeterPanino

880 Posts

Posted - Mar 08 2024 :  10:20:02  Show Profile  Reply
As per the definition, the user changes the zoom when clicking a button that executes:

ImageEnView1.Zoom := ImageEnView1.Zoom + 10;
Go to Top of Page

xequte

38319 Posts

Posted - Mar 08 2024 :  14:34:35  Show Profile  Reply
Then by definition, that is not a user activity that is changing zoom, it is your code.

You should just change your code to:

ImageEnView1.Zoom := ImageEnView1.Zoom + 10;
ImageEnView1ZoomIn( nil );

Which is nice and easy, unlike the counter which would be difficult. i.e. if OnZoomIn reacted to code changes, then how would you differentiate between the event occurring due to a code change or a user change?

Think about TEdit.OnChange or TCheckbox.OnClick, how do you determine whether the change was by the user or by your code?



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