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
 Does TimageenView (to view PDF) have "autofocus" ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Stalker4

Ukraine
25 Posts

Posted - Jul 18 2022 :  06:12:28  Show Profile  Reply
Hi,

ImageEn 10.3

There is TimageenView in mode viewing PDF files

TImageEnView.PdfViewer.Enabled := True;
TImageEnView.PdfViewer.ShowAllPages := True;
TImageEnView.MouseWheelParams.Action := iemwVScroll;

I open a multi -page PDF in TimageenView.
In order for me to scroll out his pages with the mouse, I need to first pass him out of the focus (that is, choose it with the left button).

Question: Is there an opportunity that PDF could lean if there is simply a mouse cursor above it, i.e. without the transfer of the focus to him ?

xequte

38608 Posts

Posted - Jul 18 2022 :  16:48:24  Show Profile  Reply
Hi

That is really a windows control issue. You want the control to act as though it has focus without being the focused control. You would need to capture the mousewheel messages at the level of the form and then reposition the control:

const
  Wheel_Scroll_Amount = 8;
  
newPos := ImageEnView1.ViewY + WheelDirection * Wheel_Scroll_Amount;
ImageEnView1.ViewY := nPos;


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

Stalker4

Ukraine
25 Posts

Posted - Jul 19 2022 :  02:48:43  Show Profile  Reply
Honestly, I did not quite understand how your code will help me, but how to get around this problem I found:

var
  FOldControl :TWinControl;

procedure TForm1.EnViewMouseEnter(Sender: TObject);
begin
 FOldControl := ActiveControl;
 if ImageEnView1.CanFocus then ImageEnView1.SetFocus;
end; 

procedure TForm1.ImageEnViewMouseLeave(Sender: TObject);
begin
 if Assigned(FOldControl) and FOldControl.CanFocus then
   FOldControl.SetFocus;
end;

I just thought that "TImageEnView" has a property for such behavior.
Go to Top of Page

xequte

38608 Posts

Posted - Jul 19 2022 :  20:35:32  Show Profile  Reply
Hi

No ImageEn follows the Windows standards in this regard. Your solution should work fine.

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