dmitriychunikhin / pdfium-vfp

PDF Viewer and ReportOutput for Visual FoxPro
The Unlicense
3 stars 1 forks source link

Pdfiumviewer in top-level form #3

Closed ondravojta closed 1 week ago

ondravojta commented 2 weeks ago

Hi,

it seems that pdfiumviewer doesn't work in top-level forms. After calling openpdf() method, pdfiumviewer starts loading PDF but after that, it remains empty.

1) I have created simple form, added pdfiumviewer and button that calls pdfiumviewer.openpdf() with sample file. Everything works fine now. 2) Then I tried to change forms property ShowWindow to value 2 - As Top-Level Form. After that, pdfiumviewer will not display PDF.

dmitriychunikhin commented 2 weeks ago

Hi. Interesting issue. I'll check this later today

dmitriychunikhin commented 2 weeks ago

I belive it is fixed.

A reason was that: when Thisform.ShowWindow = 2 VFP for some reason creates child window for Thisform, also when Thisform.Scrollbars !=0 VFP creates one more nested child window with the first child window as a parent. So we have 2 nested windows in VFP form with scrollbars and 1 nested window when scrollbars are turned off.

VFP creates only 1 nested child window when ShowWindow != 2 and ScrollBars != 0 and finally there is no nested windows if ShowWindows != 2 and ScrollBars = 0 🤦‍♂️

I've released version 1.8 with that fix. Please, check if your case is solved after updating.

Changed files: pdfium-vfp.vct, pdfium-vfp.vcx

ondravojta commented 1 week ago

It seems ok now. Thank you very much for fast fix.

dmitriychunikhin commented 1 week ago

Thanks for the feedback.