]> git.saurik.com Git - wxWidgets.git/blame - wxPython/contrib/iewin/readme.txt
Script updates
[wxWidgets.git] / wxPython / contrib / iewin / readme.txt
CommitLineData
c731eb47
RD
1Lindsay Mathieson
2Email : <lmathieson@optusnet.com.au>
3
4This is prelimanary stuff - the controls need extra methods and events etc,
5feel free to email with suggestions &/or patches.
6
7Tested with wxWindows 2.3.2.
8Built with MS Visual C++ 6.0 & DevStudio
9Minor use of templates and STL
10
11-----------------------------------------------------------
12This sample illustrates using wxActiveX and wxIEHtmlWin too:
131. Host an arbitrary ActiveX control
142. Specifically host the MSHTML Control
15
16
17wxActiveX:
18==========
19wxActiveX is used to host and siplay any activeX control, all the wxWindows developer
20needs to know is either the ProgID or CLSID of the control in question.
21
22Derived From:
23- wxWindow
24
25Include Files:
26- wxactivex.h
27
28Source Files:
29- wxactivex.cpp
30
31Event Handling:
32---------------
811712d8
RD
33- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
34class wxActiveXEvent : public wxNotifyEvent
35 int ParamCount() const;
36 wxVariant operator[] (int idx) const; // parameter by index
37 wxVariant& operator[] (int idx);
38 wxVariant operator[] (wxString name) const; // named parameters
39 wxVariant& operator[] (wxString name);
40
c731eb47
RD
41
42Members:
43--------
44wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1);
45- Creates a activeX control identified by clsid
46e.g
47 wxFrame *frame = new wxFrame(this, -1, "test");
48 wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser);
49
50wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1);
51- Creates a activeX control identified by progId
52e.g.
53 wxFrame *frame = new wxFrame(this, -1, "test");
54 wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar");
55
56
57wxActiveX::~wxActiveX();
58- Destroys the control
59- disconnects all connection points
60
61HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink);
62- Connects a event sink. Connections are automaticlly diconnected in the destructor
63e.g.
64 FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol);
65 hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events);
66 if (! SUCCEEDED(hret))
67 delete events;
68
69
811712d8
RD
70Sample Events:
71--------------
72EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
73
74void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
75{
76 wxString url = event["Url"];
77
78 int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
79
80 if (rc != wxYES)
81 event["Cancel"] = true;
82};
c731eb47
RD
83
84
85wxIEHtmlWin:
86============
87wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control.
88
89Derived From:
90- wxActiveX
91- wxWindow
92
93Event Handling:
94---------------
95- class wxMSHTMLEvent
96
97- EVT_MSHTML_BEFORENAVIGATE2
98* url = event.m_text1
99* event.Veto() to cancel
100Generated before an attempt to browse a new url
101
102- EVT_MSHTML_NEWWINDOW2
103* event.Veto() to cancel
104Generated when the control is asked create a new window (e.g a popup)
105
106- EVT_MSHTML_DOCUMENTCOMPLETE
107* url = event.m_text1
108Generated after the document has finished loading
109
110- EVT_MSHTML_PROGRESSCHANGE
111* event.m_long1 = progress so far
112* event.m_long2 = max range of progress
113
114- EVT_MSHTML_STATUSTEXTCHANGE
115* status = event.m_text1
116
117- EVT_MSHTML_TITLECHANGE
118* title = event.m_text1
119
120Members:
121--------
122wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1);
123- Constructs and initialises the MSHTML control
124- LoadUrl("about:blank") is called
125
126wxIEHtmlWin::~wxIEHtmlWin();
127- destroys the control
128
129void wxIEHtmlWin::LoadUrl(const wxString&);
130- Attempts to browse to the url, the control uses its internal (MS)
131 network streams
132
133bool wxIEHtmlWin::LoadString(wxString html);
134- Load the passed HTML string
135
136bool wxIEHtmlWin::LoadStream(istream *strm);
137- load the passed HTML stream. The control takes ownership of
138 the pointer, deleting when finished.
139
140void wxIEHtmlWin::SetCharset(wxString charset);
141- Sets the charset of the loaded document
142
143void wxIEHtmlWin::SetEditMode(bool seton);
144- Sets edit mode.
145 NOTE: This does work, but is bare bones - we need more events exposed before
146 this is usable as an HTML editor.
147
148bool wxIEHtmlWin::GetEditMode();
149- Returns the edit mode setting
150
151wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false);
152- Returns the currently selected text (plain or HTML text)
153
154wxString GetText(bool asHTML = false);
155- Returns the body text (plain or HTML text)
156
157Lindsay Mathieson
158Email : <lmathieson@optusnet.com.au>