X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7abf01706714b3eb7777555ce4d1db00d641e40..ee45c548e61fa0ce1f8adbcf29d7678769f2c0ed:/wxPython/contrib/iewin/iewin.i diff --git a/wxPython/contrib/iewin/iewin.i b/wxPython/contrib/iewin/iewin.i index ee39c836a8..f55d9260a4 100644 --- a/wxPython/contrib/iewin/iewin.i +++ b/wxPython/contrib/iewin/iewin.i @@ -11,32 +11,31 @@ ///////////////////////////////////////////////////////////////////////////// -%module iewin +%module(package="wx") iewin %{ -#include "wxPython.h" +#include "wx/wxPython/wxPython.h" +#include "wx/wxPython/pyclasses.h" +#include "wx/wxPython/pyistream.h" + #include "IEHtmlWin.h" %} //--------------------------------------------------------------------------- -%include typemaps.i -%include my_typemaps.i - -%extern wx.i -%extern windows.i -%extern _defs.i -%extern misc.i -%extern events.i +%import core.i +%pythoncode { wx = _core } +%pythoncode { __docfilter__ = wx.__DocFilter(globals()) } +%pythoncode { + import warnings + warnings.warn("This module is deprecated. Please use the wx.lib.iewin module instead.", + DeprecationWarning, stacklevel=2) +} -%pragma(python) code = "import wx" +MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr); -//--------------------------------------------------------------------------- +%include _iewin_rename.i -%{ - // Put some wx default wxChar* values into wxStrings. - DECLARE_DEF_STRING(PanelNameStr); -%} //--------------------------------------------------------------------------- @@ -44,7 +43,7 @@ class wxMSHTMLEvent : public wxNotifyEvent { public: wxMSHTMLEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - wxString GetText(); + wxString GetText1(); long GetLong1(); long GetLong2(); }; @@ -60,25 +59,14 @@ enum { }; -%pragma(python) code = " -def EVT_MSHTML_BEFORENAVIGATE2(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, func) - -def EVT_MSHTML_NEWWINDOW2(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_NEWWINDOW2, func) - -def EVT_MSHTML_DOCUMENTCOMPLETE(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, func) - -def EVT_MSHTML_PROGRESSCHANGE(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, func) - -def EVT_MSHTML_STATUSTEXTCHANGE(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, func) - -def EVT_MSHTML_TITLECHANGE(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_MSHTML_TITLECHANGE, func) -" +%pythoncode { +EVT_MSHTML_BEFORENAVIGATE2 = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, 1) +EVT_MSHTML_NEWWINDOW2 = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_NEWWINDOW2, 1) +EVT_MSHTML_DOCUMENTCOMPLETE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, 1) +EVT_MSHTML_PROGRESSCHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, 1) +EVT_MSHTML_STATUSTEXTCHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, 1) +EVT_MSHTML_TITLECHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_TITLECHANGE, 1) +} //--------------------------------------------------------------------------- @@ -90,9 +78,13 @@ enum wxIEHtmlRefreshLevel { }; -class wxIEHtmlWin : public wxWindow /* wxActiveX */ +MustHaveApp(wxIEHtmlWin); + +class wxIEHtmlWin : public wxWindow /* wxActiveX */ { public: + %pythonAppend wxIEHtmlWin "self._setOORInfo(self)" + wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -101,19 +93,21 @@ public: void LoadUrl(const wxString&); bool LoadString(wxString html); - /* bool LoadStream(istream *strm); */ + bool LoadStream(wxInputStream *is); + + %pythoncode { Navigate = LoadUrl } void SetCharset(wxString charset); void SetEditMode(bool seton); bool GetEditMode(); - wxString GetStringSelection(bool asHTML = FALSE); - wxString GetText(bool asHTML = FALSE); + wxString GetStringSelection(bool asHTML = false); + wxString GetText(bool asHTML = false); bool GoBack(); bool GoForward(); bool GoHome(); bool GoSearch(); - bool Refresh(wxIEHtmlRefreshLevel level); + %Rename(RefreshPage, bool, Refresh(wxIEHtmlRefreshLevel level)); bool Stop(); }; @@ -121,15 +115,4 @@ public: //--------------------------------------------------------------------------- -%init %{ - wxClassInfo::CleanUpClasses(); - wxClassInfo::InitializeClasses(); - -%} - -//---------------------------------------------------------------------- - -%pragma(python) include="_iewinextras.py"; - -//---------------------------------------------------------------------------