[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DocumentView confusion


On 11/12/25 12:26 PM, gbWilly wrote:
On attached image you can see code run during a scroll of the mousewheel to retrieve on what page of a loaded pdf in a DocumentView is shown.

DocumentView.png

There are 4 properties that I would like to discuss as they are, at least, confusing. I'm talking about:
- FirstVisibleDocument (Return the number of the first visible page in the viewer.)
- FirstVisiblePage (Return the index of the first visible page.)
- LastVisibleDocument (Return the number of the last visible page in the viewer.)
- LastVisiblePage (Return the index of the last visible page.)

To my understanding of the matter (correct me where I'm wrong), the index is 1 lower that the actual page number (shown on the DocumentView by setting its ShowPage property to True)
Page 1 -> Index 0
Page 2 -> Index 1
Page 3 -> Index 2
...

[snip]

In short:
Both First.. properties return the index
Both Last... properties return the page number
...VisiblePage talks about index in wiki
...VisibleDocument talks about number in wiki

Something is off (Gambas 3.19.6), please enlighten me..

gbWilly

GambOS <https://gambos.gambas.one/>
Gambas3 for Debian/Ubuntu <https://gitlab.com/gbWilly/gambas3-debian-repository>
<https://gambos.gambas.one/>

*...there is always a Catch if things go wrong!*

Sent with Proton Mail <https://proton.me/mail/home> secure email.

I thought I might investigate this but ......

How in the world does one load a document into DocumentView?


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


Follow-Ups:
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
References:
DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>