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
 ImageEnView unfocused scrolling
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mdgodfrey

USA
54 Posts

Posted - Mar 22 2024 :  14:12:23  Show Profile  Reply
I am using the PDFViewer Demo trying to understand why scrolling of an unfocused ImageEnView component. I have added a fileListbox and a wwdbGrid to the form.

I run the program and load a PDF then check the 'Show all Pages' check box.

Then, if I click on the FileListBox and move the mouse over ImageEnview it scrolls very nicely.
When I click on the wwDBGrid and move the mouse over the ImageEnView it will not scroll. Clicking on the ImageEnView does implement scrolling of course, but hoping to not have to do that.

Any suggestions on that would be appreciated.

xequte

38608 Posts

Posted - Mar 22 2024 :  22:24:05  Show Profile  Reply
Hi

Are you able to reproduce without third party components so I can reproduce it here?

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

mdgodfrey

USA
54 Posts

Posted - Mar 25 2024 :  11:37:49  Show Profile  Reply
Yes, it happens if I use a TStringGrid. One other caveat is that I am using the on Delphi2007 at the moment.
Have tried this behavior on anything more current yet.
Go to Top of Page

mdgodfrey

USA
54 Posts

Posted - Mar 25 2024 :  12:43:12  Show Profile  Reply
To clarify, I have NOT tried this behavior on a more current version of Delph2007 so far.
Go to Top of Page

xequte

38608 Posts

Posted - Mar 25 2024 :  23:32:11  Show Profile  Reply
Thanks. I will try and reproduce that here.

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

xequte

38608 Posts

Posted - Mar 30 2024 :  17:31:47  Show Profile  Reply
Sorry, I don't see that in Delphi 12. I expect the "Focused" TStringList is swallowing the mouse wheel calls. Presumably it was an issue that have been fixed by Embarcadero.

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

mdgodfrey

USA
54 Posts

Posted - Apr 01 2024 :  17:20:25  Show Profile  Reply
Since something is stealing the Mousewheel scroll from the ImageEnView do you have a suggestion on how I can scroll with code.
I have tried attempts with ImageEnView1.Perform on ImageEnView1MouseWheel but that seems to just want to move the entire page so far.
Go to Top of Page

xequte

38608 Posts

Posted - Apr 03 2024 :  15:44:17  Show Profile  Reply
Hi

Are you saying that the ImageEnView1MouseWheel event is still occurring in this situation when it is not scrolling?

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

mdgodfrey

USA
54 Posts

Posted - Apr 04 2024 :  09:36:29  Show Profile  Reply
Yes. Even with focus it won't scroll.
Go to Top of Page

xequte

38608 Posts

Posted - Apr 05 2024 :  01:20:59  Show Profile  Reply
Hi

I fired up Delphi 2007. As expected the mouse wheel calls are being swallowed by TStringList if it is the active control (even though it isn't under the cursor).

Also, as expected, I'm not seeing ImageEnView1MouseWheel events in this situation. This means that there is no workaround while TStringList has focus. So your only solution is to give focus to the ImageEnView:

ImageEnView1.SetFocus();

(Or upgrade your Delphi version )

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

mdgodfrey

USA
54 Posts

Posted - Apr 08 2024 :  17:38:49  Show Profile  Reply
So even when ImageEnView has focus it won't scroll with the MouseWheel.
The OnMouseWheel is firing so I could move it with code but I can't narrow down the correct way to do that.
Or even if some other component has focus I could intercept and scroll the PDF.

Any suggestions?
I've tried ImnageEnView.ScrollBy but that doesn't seem to do much. I've tried Perform. That moves it but is not predictable for me. PDFViewer has a few things but mostly seem to just moving to a new page.

Thanks
Go to Top of Page

xequte

38608 Posts

Posted - Apr 09 2024 :  23:23:58  Show Profile  Reply
Hi

We seem to be seeing different things. You are seeing TImageEnView.OnMouseWheel events, whereas I do not. If TImageEnView.OnMouseWheel is occurring then the internal scrolling code should also occur. So I cannot understand what is occuring.

I cannot create a situation where TImageEnView has focus and scrolling does not occur.

You might want to try putting a breakpoint in the TImageEnView.DoWMMouseWheel method (I would expect it does not fire in this situation).

If your OnMouseWheel does fire you could try explicitly performing the scroll, which would be something like:

  nPos := ImageEnView1.ViewY + Direction * ImageEnView1.MouseWheelParams.Value;
  ImageEnView1.ViewY := nPos;
  ImageEnView1.PdfViewer.SetPageToScrollPos( Direction >= 0 );


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

mdgodfrey

USA
54 Posts

Posted - Apr 10 2024 :  20:59:31  Show Profile  Reply
Thanks for the code but...
The 'Direction' variable coding was not shown. But changing the first lines fixed it for me.
I did this:

Direction := WheelDelta div 100; // maybe just needed + or - 1
nPos := ImageEnView1.ViewY - Direction * ImageEnView1.MouseWheelParams.Value;


As far as weird behavior I am using other third party tools on this form. The stringgrid mocked part of the problem but not all.
So I assume something else is chewing it up.


Thanks
Go to Top of Page

xequte

38608 Posts

Posted - Apr 11 2024 :  05:41:23  Show Profile  Reply
Nice work

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