It loads a web page, i can change the locations using the calls provided in the component, but the component does not react to mose clicks on the web page or any keyboard events in it. If i click a text input box in it, it never gets focus. When i hover my mouse over the webpage the cursor changes (hand/beam depending on the location on the page). I can’t scroll it (the native OS scrollbars are visible). The whole component consists of a toolbar and the webbrowser component below it, it’s created in JUCE
I’m on Windows 7, VS2008 with SP1, Debug build, latest juce tip from GIT
Well, you’d be ok unless you want the user to be able to interact with it. The problem is that when a juce comp is modal, it prevents events getting sent to windows that it doesn’t know about, and since the browser window is foreign, it doesn’t know that it should still be allowed to get events.
It might be possible to fix it, but I’ve no time to look at it right now.
but now a weird error occures. i add my toolbar+browser component as a tab in a TabbedComponent. When i add this component while my application is running, i get grey background instead of the actual web browser, also all those threads that IE creates are not created
BUT
i save the state of my component, and when i re-open my application and do the same procedure of adding saved tabs, the component appears like a normal component and works
Also if I add two tabs with the same component, close and open the application only one tab has the proper WebBrowser component, the other is grey.
Must be that the activexcomponent isn’t realising that it’s on-screen and needs to instantiate the activex object.
Probably because it’s already visible, but inside an off-screen comp which is then added… though all that sort of stuff should be handled correctly. Hmm…
I have seen similar issues, but realized later that when ActiveXcomponent was initialized the component on which I was placing it was not visible. In which case web-browser won’t be shown.
I don’t know why you’re looking around for other solutions - the juce browser works just fine - it’ll just be the order in which you add the component/make it visible that’s confusing the ActiveXComp, and making it forget to instanciate the control.
Hi atom,
Correct me if I am wrong. You are adding webbrowsercomponent to the tab component and after that adding tab component to your application.
While using webbrowsercomponent the order in which the webbrowsercomponent is added is important. If the webbrowsercomponent is added before the tab component is visible, the webbrowsercomponent wouldn't show up.
allright in that case, i’ll look into visibility changes calls and see if that will work.
i have a tabbed component, one tab (some other component) and a button that adds a new one, the new one is the web browser, the tab is added invisible so the web browser is not visible.
if i understood this right, i need to first make the tab viisble and then add the web browser component?
Well i tested this, it’s better, but when i switch the tab to some other and go back the component is all white (the native os popup menu works, the scrollbars are there but the webpage is all white).
I’ve tried to make the web component as robust as I can, but it’s hard to catch every case.
If you can find a case where it doesn’t work and can send me some sample code that reproduces the problem, I’ll be happy to take a look and try to make it deal with that situation.
Ok, this just required a slight tweak to make it reload the page when the browser’s parent is made visible. Thanks for the sample app - I’ll check in a fix later today…