[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Easy to use components
From:       Kurt Granroth <kurt_granroth () email ! mot ! com>
Date:       1999-07-01 16:02:30
[Download RAW message or body]

I used an ActiveX component for the first time yesterday (<excuse>I had to
get the product working in under and hour and it had to be a Windows app (in
the project-requirements)</excuse>).  I almost hate to say it, but I was
impressed!

What I needed to do was embedd a web browser into my app.  Mind you, an HTML
widget would *not* have worked as the browser needed to take care of such
things as the proxy and downloading the pages as well as displaying them.
I used the MS Internet Explorer ActiveX component to do this.  Here are
all the steps I took to do so in VC++5:

1) Click on Project->Add Components.  Select WebBrowser control from HUGE list
   of components (all with descriptions).  Decide on name for the wrapper
   class (CWebBrowser)

2) Go to the dialog editor (my app was dialog based).  I see a cute icon on my
   tools bar for the browser component.  I select it and do a click-n-drag
   to put it on my dialog in the size that I want.

3) I go to the class-wizard and associate a member variable for that component
   (CWebBrowser m_browser)

Mind you, I have not written one *single* line of code, yet.

4) I go into my dialog class (CGpsDemoDlg) and add this to the init function
   m_browser.Navigate("http://www.pobox.com/~kurt_granroth", ..).

5) I compile and run.  Voila!  I see my home page displayed in my app.

Wow!  One line of code to have an entire embedded web browser!  Of course,
there are tons more options that you can set (and I did, later), but the fact
that you can do sooo much with so little effort is incredible.

Just some food for thought when we think about using KOM/OP.  Can we get it to
be that easy?
-- 
Kurt Granroth            | granroth@kde.org
KDE Developer/Evangelist | http://www.pobox.com/~kurt_granroth
         KDE -- Putting a Friendly Face on Linux

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic