Scrolling the webbrowser_control?

Discussions related to Visual Prolog
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

Scrolling the webbrowser_control?

Unread post by B.Hooijenga »

I could not figure out how to do that.
Suggestions, perhaps a small example (?), would be very wellcome.

Kind regards

Ben
User avatar
Thomas Linder Puls
VIP Member
Posts: 1181
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

The webBrowser control is "merely" a shell that keeps track of "documents" and components that these are loaded in. If the document is an HTML document it is actually in the MSHTML component, and it is that you should instruct to scroll.

I don't know how that is done. I do however know that our COM import mechanism can unfortunately not import that component, so you will have to deal with it in more low-level fashion.
Regards Thomas Linder Puls
PDC
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

Unread post by B.Hooijenga »

Thank you Thomas for clearing it up.

It looks as if there are methods for scrolling within mshtml.
But I will not dive into it.

I call an external browser from within my program.


Kind regards,

Ben
User avatar
Thomas Linder Puls
VIP Member
Posts: 1181
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

But can you scroll the external browser?
Regards Thomas Linder Puls
PDC
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

Unread post by B.Hooijenga »

Yes.

This code just calls the standardbrowser one is using, Firefox in my case.
Everything works as normal, but not inside the VIP_webcontrol anymore, of course.

Code: Select all

predicates     onHelpContents : window::menuItemListener. clauses     onHelpContents(_Source, _MenuTag) :-            mainexe::getFileName(Path,_),            shell_api::shellOpen(string::concat(Path,"rs232user.html")).

Kind regards

Ben
User avatar
Thomas Linder Puls
VIP Member
Posts: 1181
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

I think I have misunderstood the problem. I thought you wanted to scroll the page from the program. But now I believe that you just want a scrollbar to appear so that the user can scroll.

The presence of a scrollbar is controlled by the hostInfoFlags:

Code: Select all

constants     hostInfoFlags_default : docHostUIFlag =         docHostUIFlag_no3dOuterBorder +         docHostUIFlag_scroll_no +         docHostUIFlag_theme. properties     hostInfoFlags : docHostUIFlag.     % @short A combination of docHostUIFlag_XXX flags.     % See IDocHostUIHandler::GetHostInfo and DOCHOSTUIFLAG in MSDN     % @end
As you can see docHostUIFlag_scroll_no is part of the default value of this flag.
Regards Thomas Linder Puls
PDC
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

Unread post by B.Hooijenga »

Perhaps I am to blame. I should have asked: how to scroll the content of the webbrowser_control.

I looked around in MSDN and I think that MSHTML makes it possible to change the docHostUIFlags.
But VIP lacks (at the moment) the predicates to do so. So be it, we can not have it all.

I might add that at the very first I was confused by scroll_predicates in the WebBrowserControl_package
as I saw them in the helpfile. But I see now that they have nothing to do with the com_mechanisms.

Kind regards

Ben
User avatar
Thomas Linder Puls
VIP Member
Posts: 1181
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

No, you can set the hostInfoFlags:

Code: Select all

webBrowser_ctl:hostInfoFlags := docHostUIFlag_no3dOuterBorder + docHostUIFlag_theme,
Regards Thomas Linder Puls
PDC
B.Hooijenga
Active Member
Posts: 47
Joined: 11 Jul 2002 23:01

Unread post by B.Hooijenga »

Great!

I tried it out in the VIP_webrowser_example and it surely works.

Code: Select all

clauses     new(Parent) :-         formWindow::new(Parent),         generatedInitialize(),         addMenuItemListener(resourceIdentifiers::idr_Navigation_Back, onIdrNavigationBack),         addMenuItemListener(resourceIdentifiers::idr_Navigation_Forward, onIdrNavigationForward),         addMenuItemListener(resourceIdentifiers::idr_Navigation_Home, onIdrNavigationHome),         webBrowserControl_ctl:statusTextChangeEvent:addListener(onStatusTextChange),         webBrowserControl_ctl:hostInfoFlags := webBrowser::docHostUIFlag_no3dOuterBorder + webBrowser::docHostUIFlag_theme,         webBrowserControl_ctl:html := main::html.
Thanks, again Thomas

Kind regards
Ben
Post Reply