Using Firefox as a html viewer

Just starting out? Need help? Post your questions and find answers here.
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Using Firefox as a html viewer

Post by nrasool »

Hi there, First posting, so please bear with me. :D
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
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post 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 ;)
Forgive-me for my english, i'm portuguese!
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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 :|
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post 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!!! :lol: 8) :wink: :D
Forgive-me for my english, i'm portuguese!
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post 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
ARGENTINA WORLD CHAMPION
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post by nrasool »

Fred,

Wow!! Thanks for this :)

Checking it now, what a top service this is, help from the actual developer :)

Kind Regards
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post 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
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Very cool! And faster too!

Any chance for the Firefox option to be Multi OS !?

Thanks Fred.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Linux already uses FireFox and MacOS uses Safari (dunno about a shared component based on FireFox on MacOS X).
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Never the less, i prefer Firefox, the IE componente is *very* susceptable to malware, worms and virus...

Nice show, keep it up!
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post 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......
Forgive-me for my english, i'm portuguese!
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Okay, it's integrated in the new Visual Designer also now, works just fine and fast :)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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).
Post Reply