Page 1 of 3
Using Firefox as a html viewer
Posted: Tue Apr 26, 2005 10:01 am
by nrasool
Hi there, First posting, so please bear with me.

I have to say Purebasic is excellent, and moving from VB to this, is a dream. I have one question though.
In the example we use the ATL API to display the webpage in a gadget.
Code: Select all
;HTML Example viewer
;Written by Nadeem Rasool
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Web_0
EndEnumeration
WindowID=OpenWindow(#Window_0, 0, 0, 640, 480, #PB_Window_SystemMenu|#PB_Window_ScreenCentered , "Nadcom CMS",0)
;The following is for the status bar
CreateStatusBar(0, WindowID())
StatusBarText(0, 0, "Ready...", 0)
CreateGadgetList(WindowID())
;end statusbar code
CreateGadgetList(WindowID())
WebGadget(#Web_0, 10, 10, 600, 400, "http://www.google.co.uk")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Does anyone know, if there is any way to change the viewer, so instead of using IE, which i believe is coming from ATL, can we use Firefox by calling the dll which are stored within Firefox? Or is there an easier way
Any help would be appreciated.
Kind Regards
Nadeem
Posted: Thu Apr 28, 2005 2:14 pm
by porfirio
If that work that will be awesome but i dont know mabe you can try to mess with firefox dll's and find something

Posted: Thu Apr 28, 2005 4:56 pm
by Num3
This would be GRAND !
Has Firefox is multiOS .... The only problem is i don't think there is an API for the webgadget
Firefox uses it's own graphical API, so i don't know it can work

Posted: Thu Apr 28, 2005 9:58 pm
by porfirio
Num3 wrote:This would be GRAND !
Has Firefox is multiOS .... The only problem is i don't think there is an API for the webgadget
Firefox uses it's own graphical API, so i don't know it can work

Mabe there are some way to get the firefox api ...
webgadgect uses internet explorer api
mabe some one could talk with the developers about that
that will be wanderfull!!!

Posted: Sat May 07, 2005 1:58 am
by ricardo
Here is some Activex control that let you use Mozilla in you application.
http://www.iol.ie/~locka/mozilla/control.htm
In the same web you can find source codes of how to use it in VB, C++ and Delhpi, maybe someone can help porting to PB.
From the website:
ActiveX Control Implementation
Not just a similar API
An identical one! That's right, the Mozilla control will implement the IWebBrowser and DWebBrowserEvents interfaces that Microsoft have already defined for Internet Explorer.
Since the Mozilla control implements exactly the same API, it will mean that developers can take existing IE code and port it, sometimes in a matter of minutes!
The only modification required may be to replace the line that creates the control of type CLSID_WebBrowser with one of CLSID_MozillaBrowser
Posted: Tue May 10, 2005 10:16 am
by Fred
I just give it a try and it seems to work perfectly: you can get a beta version here:
www.purebasic.com/beta/mozilla/GadgetExtension . Warning, the WebGadget() command needs the mozilla activex installed ! So better backuop the actual GadgetExtension file before installing this new one.
Posted: Tue May 10, 2005 1:02 pm
by nrasool
Fred,
Wow!! Thanks for this
Checking it now, what a top service this is, help from the actual developer
Kind Regards
Posted: Tue May 10, 2005 1:13 pm
by nrasool
Hi there
When i tried testing this, i opened my sourcecode and get an error saying
"Duplicate Library Command: ButtonImageGadget() (in Libraries GadgetExtenstion and GadgetExtenstion).
What i done is the following:
Went to "C:\Program Files\PureBasic\PureLibraries"
Rename "GadgetExtension" to "GadgetExtension.backup" and place in new GadgetExtension here
Edit: Just fixed it, by zipping up the old "GadgetExtension" extenstion now, strange it stills looks at the file even though its been renamed.
Its work perfectly Fred, again must say thankyou for this, it was a call beyond the call of duty
Kind Regards
Nadeem
Posted: Tue May 10, 2005 3:09 pm
by Fred
Cool if it works for you. About the library, the compiler scan the whole directory and load the pb files which are in it, so even if you rename it will load it.
BTW, we will just add a flag to the current WebGadget() to enable mozilla use.
Posted: Tue May 10, 2005 7:33 pm
by Num3
Very cool! And faster too!
Any chance for the Firefox option to be Multi OS !?
Thanks Fred.
Posted: Tue May 10, 2005 7:42 pm
by Fred
Linux already uses FireFox and MacOS uses Safari (dunno about a shared component based on FireFox on MacOS X).
Posted: Tue May 10, 2005 8:41 pm
by Num3
Never the less, i prefer Firefox, the IE componente is *very* susceptable to malware, worms and virus...
Nice show, keep it up!
Posted: Tue May 10, 2005 9:15 pm
by porfirio
O my god it work!!!!!
Excelent!!
so if i made a program with this ppl that use my program have to download the activex or it will not work...
mebe you fred must find a way to inplement the activex in pb......
Posted: Tue May 10, 2005 9:54 pm
by Berikco
Okay, it's integrated in the new Visual Designer also now, works just fine and fast

Posted: Tue May 10, 2005 10:58 pm
by Fred
porfirio: i don't plan to include the activex for several reasons:
1) bug fixes. what if a security hole is found in the mozilla engine ? as the activex is a separate package you can easily update it and all apps based on it will be fixed.
2) maintainance. it will be an hell to follow all the release and include them in PB.
Ii don't think than the activex redistribution and installation is a problem, as it's relatively small (4,7 mb) and got a blind install (almost nothing to do).