wxWidgets/wxPython/contrib/activex/wxie
Robin Dunn 9c97d337bf Remove use of m_bestSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-15 19:56:20 +00:00
..
doxydoc Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
latex Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
default.doxygen Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
IEHtmlStream.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
IEHtmlWin.cpp fixes for unicode build, return values from event handlers (via 2004-03-24 23:06:01 +00:00
IEHtmlWin.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
license.txt Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
makefile Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
makefile.gtk Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
makefile.mtf Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
notes.txt Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
README.1st.txt Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
readme.txt Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
resource.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxactivex.cpp Remove use of m_bestSize 2004-04-15 19:56:20 +00:00
wxactivex.h Add wxRTTI info and set bestSize 2004-04-07 21:22:24 +00:00
wxActiveXFrame.cpp Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxActiveXFrame.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIE.dsp Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIE.ico Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIE.rc Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIE.xpm Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIEApp.cpp Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIEApp.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIEFrm.cpp Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
wxIEFrm.h Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00
zip.bat Lindsay Mathieson's newest wxActiveX class has been wrapped into a new 2004-03-23 05:29:50 +00:00

Lindsay Mathieson
Email : <lmathieson@optusnet.com.au>

This is prelimanary stuff - the controls need extra methods and events etc,
feel free to email with suggestions &/or patches.

Tested with wxWindows 2.3.2.
Built with MS Visual C++ 6.0 & DevStudio
Minor use of templates and STL

-----------------------------------------------------------
This sample illustrates using wxActiveX and wxIEHtmlWin too:
1. Host an arbitrary ActiveX control
1.1 - Capture and logging of all events from control
2. Specifically host the MSHTML Control


wxActiveX:
==========
wxActiveX is used to host and siplay any activeX control, all the wxWindows developer
needs to know is either the ProgID or CLSID of the control in question.

Derived From:
- wxWindow

Include Files:
- wxactivex.h

Source Files:
- wxactivex.cpp

Event Handling:
---------------
- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
- EVT_ACTIVEX_DISPID(id, eventDispId, handler) (handler = void OnActiveX(wxActiveXEvent& event))
class wxActiveXEvent : public wxNotifyEvent
    wxString EventName();
    int ParamCount() const;
    wxString ParamType(int idx);
    wxString ParamName(int idx);
    wxVariant  operator[] (int idx) const;	// parameter by index
    wxVariant& operator[] (int idx);
    wxVariant  operator[] (wxString name) const; // named parameters
    wxVariant& operator[] (wxString name);


Members:
--------
wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1);
- Creates a activeX control identified by clsid
e.g
  wxFrame *frame = new wxFrame(this, -1, "test");
  wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser);

wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1);
- Creates a activeX control identified by progId
e.g.
  wxFrame *frame = new wxFrame(this, -1, "test");
  wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar");


wxActiveX::~wxActiveX();
- Destroys the control
- disconnects all connection points

- int GetEventCount() const;
  Number of events generated by control

- const FuncX& GetEvent(int idx) const;
  Names, Params and Typeinfo for events

HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink);
- Connects a event sink. Connections are automaticlly diconnected in the destructor
e.g.
  FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol);
  hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events);
  if (! SUCCEEDED(hret))
    delete events;


Sample Events:
--------------
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2",   OnMSHTMLBeforeNavigate2X)

void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
{
  wxString url = event["Url"];

  int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);

  if (rc != wxYES)
    event["Cancel"] = true;
};


wxIEHtmlWin:
============
wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control.

Derived From:
- wxActiveX
- wxWindow

Event Handling:
---------------
- see wxActiveX
Members:
--------
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1);
- Constructs and initialises the MSHTML control
- LoadUrl("about:blank") is called

wxIEHtmlWin::~wxIEHtmlWin();
- destroys the control

void wxIEHtmlWin::LoadUrl(const wxString&);
- Attempts to browse to the url, the control uses its internal (MS)
  network streams

bool wxIEHtmlWin::LoadString(wxString html);
- Load the passed HTML string

bool wxIEHtmlWin::LoadStream(istream *strm);
- load the passed HTML stream. The control takes ownership of
  the pointer, deleting when finished.

bool wxIEHtmlWin::LoadStream(wxInputStream *is);
- load the passed HTML stream. The control takes ownership of
  the pointer, deleting when finished.

void wxIEHtmlWin::SetCharset(wxString charset);
- Sets the charset of the loaded document

void wxIEHtmlWin::SetEditMode(bool seton);
- Sets edit mode. 
  NOTE: This does work, but is bare bones - we need more events exposed before
        this is usable as an HTML editor.

bool wxIEHtmlWin::GetEditMode();
- Returns the edit mode setting

wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false);
- Returns the currently selected text (plain or HTML text)

wxString GetText(bool asHTML = false);
- Returns the body text (plain or HTML text)

Lindsay Mathieson
Email : <lmathieson@optusnet.com.au>