Hay guys,
I'm new to wxWebConnect. I tried to create a wxWebControl and scroll it with my programm after a spezific time, because the programm should show a HTML page over a period of time and scroll it down till the page is at the end, and then jump back to the beginning.
So I tried all methodes that start with Scroll (ScrollPages, ScrollLines, ScrollWindow) and SetScrollPos, but none of them worked. So please help me, and tell me how to do that.
Visit my code at:
http://pastebin.com/wLvHLC1N
Rennnyyy
Kirix Support Forums
Scroll a wxWebControl
3 posts
• Page 1 of 1
Re: Scroll a wxWebControl
The scrollbars in the wxWebControl are provided by XULRunner / Gecko rather than being provided by wxWidgets, so none of the wxWindow scrolling methods will work. Instead, you will need to use the Javascript scrolling methods:
This is not helped by the fact that (from memory) the Execute() method was broken in wxWebConnect 1.1, and there has not been a new release since then. There are other threads on this forum which discuss how to fix this.
Another possibility would be to put all the logic in the HTML file: include a script section, and have it control scrolling and so forth in Javascript. This may or may not be a solution, depending on whether you are reading the same HTML file over and over or many different ones.
- Code: Select all
control->Execute("window.scrollTo(100, 200);");
This is not helped by the fact that (from memory) the Execute() method was broken in wxWebConnect 1.1, and there has not been a new release since then. There are other threads on this forum which discuss how to fix this.
Another possibility would be to put all the logic in the HTML file: include a script section, and have it control scrolling and so forth in Javascript. This may or may not be a solution, depending on whether you are reading the same HTML file over and over or many different ones.
- jonmmorgan
- Registered User
- Posts: 94
- Joined: Fri May 14, 2010 9:48 am
Re: Scroll a wxWebControl
It turns out that the scrollTo() method is also exposed on the nsIDOMWindow class, so it would be possible to change wxWebConnect to expose this (though it doesn't currently).
window.scrollBy() and window.scrollByLines / window.scrollByPages might also be useful methods for what you are trying to do.
window.scrollBy() and window.scrollByLines / window.scrollByPages might also be useful methods for what you are trying to do.
- jonmmorgan
- Registered User
- Posts: 94
- Joined: Fri May 14, 2010 9:48 am
3 posts
· Page 1 of 1
Return to wxWebConnect Questions, Thoughts & Feedback