Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scrolling to the bottom of a wxHtmlWindow

72 views
Skip to first unread message

Razvan Cojocaru

unread,
May 14, 2010, 5:38:48 AM5/14/10
to
Hello,

I'd like to scroll to the bottom of a HTML page displayed in a
wxHtmlWindow-derived UI component. My quick-and-dirty solution was this:

GetVirtualSize(&x, &y);
GetScrollPixelsPerUnit(&xUnit, &yUnit);
Scroll(0, y / yUnit);

It does work in all my tests, but doesn't quite feel right. I was hoping
for better, more "official" way of scrolling to the bottom of a
wxHtmlWindow. Is there one?


Thanks,
--
Razvan Cojocaru
KeyID: 0x04CA34DE

Vadim Zeitlin

unread,
Jul 3, 2010, 7:50:14 AM7/3/10
to
On 2010-05-14, Razvan Cojocaru <razv...@gmx.net> wrote:
> Hello,
>
> I'd like to scroll to the bottom of a HTML page displayed in a
> wxHtmlWindow-derived UI component. My quick-and-dirty solution was this:
>
> GetVirtualSize(&x, &y);
> GetScrollPixelsPerUnit(&xUnit, &yUnit);
> Scroll(0, y / yUnit);
>
> It does work in all my tests, but doesn't quite feel right. I was hoping
> for better, more "official" way of scrolling to the bottom of a
> wxHtmlWindow. Is there one?

I don't think so. The above looks correct to me and while I guess it could
be a good idea to add a small helper function to do this to
wxScrolledWindow itself it wouldn't really do anything different anyhow.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

0 new messages