3 #pragma warning( disable : 4101 4786)
4 #pragma warning( disable : 4786)
13 #include "wxactivex.h"
15 class wxMSHTMLEvent
: public wxNotifyEvent
18 wxMSHTMLEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0)
19 : wxNotifyEvent(commandType
, id
)
22 wxString
GetText1() { return m_text1
; }
23 long GetLong1() { return m_long1
; }
24 long GetLong2() { return m_long2
; }
28 long m_long1
, m_long2
;
30 virtual wxEvent
*Clone() const { return new wxMSHTMLEvent(*this); }
33 DECLARE_DYNAMIC_CLASS(wxMSHTMLEvent
)
37 BEGIN_DECLARE_EVENT_TYPES()
38 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2
, 0)
39 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_NEWWINDOW2
, 0)
40 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE
, 0)
41 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE
, 0)
42 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE
, 0)
43 DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_MSHTML_TITLECHANGE
, 0)
44 END_DECLARE_EVENT_TYPES()
46 typedef void (wxEvtHandler::*wxMSHTMLEventFunction
)(wxMSHTMLEvent
&);
48 #define EVT_MSHTML_BEFORENAVIGATE2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
49 #define EVT_MSHTML_NEWWINDOW2(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_NEWWINDOW2, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
50 #define EVT_MSHTML_DOCUMENTCOMPLETE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
51 #define EVT_MSHTML_PROGRESSCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
52 #define EVT_MSHTML_STATUSTEXTCHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
53 #define EVT_MSHTML_TITLECHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_MSHTML_TITLECHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMSHTMLEventFunction) & fn, NULL ),
56 enum wxIEHtmlRefreshLevel
58 wxIEHTML_REFRESH_NORMAL
= 0,
59 wxIEHTML_REFRESH_IFEXPIRED
= 1,
60 wxIEHTML_REFRESH_CONTINUE
= 2,
61 wxIEHTML_REFRESH_COMPLETELY
= 3
64 class wxIEHtmlWin
: public wxActiveX
67 wxIEHtmlWin(wxWindow
* parent
, wxWindowID id
= -1,
68 const wxPoint
& pos
= wxDefaultPosition
,
69 const wxSize
& size
= wxDefaultSize
,
71 const wxString
& name
= wxPanelNameStr
);
72 virtual ~wxIEHtmlWin();
74 void LoadUrl(const wxString
&);
75 bool LoadString(wxString html
);
76 bool LoadStream(istream
*strm
);
78 void SetCharset(wxString charset
);
79 void SetEditMode(bool seton
);
81 wxString
GetStringSelection(bool asHTML
= false);
82 wxString
GetText(bool asHTML
= false);
88 bool Refresh(wxIEHtmlRefreshLevel level
);
91 DECLARE_EVENT_TABLE();
96 wxAutoOleInterface
<IWebBrowser2
> m_webBrowser
;
99 #endif /* _IEHTMLWIN_H_ */