void OnLinkClicked(const wxHtmlLinkInfo& link);
void base_OnLinkClicked(const wxHtmlLinkInfo& link);
+ wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,
+ const wxString& url,
+ wxString *redirect) const;
+
DEC_PYCALLBACK__STRING(OnSetTitle);
DEC_PYCALLBACK__CELLINTINT(OnCellMouseHover);
DEC_PYCALLBACK__CELLINTINTME(OnCellClicked);
+// DEC_PYCALLBACK_BOOL_STRING(OnOpeningURL);
PYPRIVATE;
};
IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
IMP_PYCALLBACK__CELLINTINT(wxPyHtmlWindow, wxHtmlWindow, OnCellMouseHover);
IMP_PYCALLBACK__CELLINTINTME(wxPyHtmlWindow, wxHtmlWindow, OnCellClicked);
+// IMP_PYCALLBACK_BOOL_STRING(wxPyHtmlWindow, wxHtmlWindow, OnOpeningURL);
void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
}
+wxHtmlOpeningStatus wxPyHtmlWindow::OnOpeningURL(wxHtmlURLType type,
+ const wxString& url,
+ wxString *redirect) const {
+ bool found;
+ wxHtmlOpeningStatus rval;
+ wxPyBeginBlockThreads();
+ if ((found = wxPyCBH_findCallback(m_myInst, "OnOpeningURL"))) {
+ PyObject* ro;
+ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(is)", type, url.c_str()));
+ if (PyString_Check(ro)
+#if PYTHON_API_VERSION >= 1009
+ || PyUnicode_Check(ro)
+#endif
+ ) {
+ PyObject* str = PyObject_Str(ro);
+ *redirect = PyString_AsString(str);
+ Py_DECREF(str);
+ rval = wxHTML_REDIRECT;
+ }
+ else {
+ PyObject* num = PyNumber_Int(ro);
+ rval = (wxHtmlOpeningStatus)PyInt_AsLong(num);
+ Py_DECREF(num);
+ }
+ Py_DECREF(ro);
+ }
+ wxPyEndBlockThreads();
+ if (! found)
+ rval = wxHtmlWindow::OnOpeningURL(type, url, redirect);
+ return rval;
+}
+
+
+
void wxHtmlWindow_AddFilter(wxHtmlFilter *filter) {
wxHtmlWindow::AddFilter(filter);
}
static PyObject *_wrap_new_wxHtmlWinParser(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxHtmlWinParser * _result;
- wxWindow * _arg0;
+ wxHtmlWindow * _arg0 = (wxHtmlWindow *) NULL;
PyObject * _argo0 = 0;
char *_kwnames[] = { "wnd", NULL };
char _ptemp[128];
self = self;
- if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxHtmlWinParser",_kwnames,&_argo0))
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxHtmlWinParser",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
- else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
- PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxHtmlWinParser. Expected _wxWindow_p.");
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlWindow_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxHtmlWinParser. Expected _wxHtmlWindow_p.");
return NULL;
}
}
#define wxHtmlWinParser_GetWindow(_swigobj) (_swigobj->GetWindow())
static PyObject *_wrap_wxHtmlWinParser_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
- wxWindow * _result;
+ wxHtmlWindow * _result;
wxHtmlWinParser * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxWindow *)wxHtmlWinParser_GetWindow(_arg0);
+ _result = (wxHtmlWindow *)wxHtmlWinParser_GetWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
int _arg1 = (int ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
- int _arg4 = (int ) wxHW_SCROLLBAR_AUTO;
+ int _arg4 = (int ) (wxHW_SCROLLBAR_AUTO);
char * _arg5 = (char *) "htmlWindow";
PyObject * _argo0 = 0;
wxPoint temp;
int _arg2 = (int ) -1;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
- int _arg5 = (int ) wxHW_SCROLLBAR_AUTO;
+ int _arg5 = (int ) (wxHW_SCROLLBAR_AUTO);
char * _arg6 = (char *) "htmlWindow";
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
PyDict_SetItemString(d,"wxHTML_COND_ISANCHOR", PyInt_FromLong((long) wxHTML_COND_ISANCHOR));
PyDict_SetItemString(d,"wxHTML_COND_ISIMAGEMAP", PyInt_FromLong((long) wxHTML_COND_ISIMAGEMAP));
PyDict_SetItemString(d,"wxHTML_COND_USER", PyInt_FromLong((long) wxHTML_COND_USER));
+ PyDict_SetItemString(d,"wxHW_SCROLLBAR_NEVER", PyInt_FromLong((long) wxHW_SCROLLBAR_NEVER));
+ PyDict_SetItemString(d,"wxHW_SCROLLBAR_AUTO", PyInt_FromLong((long) wxHW_SCROLLBAR_AUTO));
+ PyDict_SetItemString(d,"wxHTML_OPEN", PyInt_FromLong((long) wxHTML_OPEN));
+ PyDict_SetItemString(d,"wxHTML_BLOCK", PyInt_FromLong((long) wxHTML_BLOCK));
+ PyDict_SetItemString(d,"wxHTML_REDIRECT", PyInt_FromLong((long) wxHTML_REDIRECT));
+ PyDict_SetItemString(d,"wxHTML_URL_PAGE", PyInt_FromLong((long) wxHTML_URL_PAGE));
+ PyDict_SetItemString(d,"wxHTML_URL_IMAGE", PyInt_FromLong((long) wxHTML_URL_IMAGE));
+ PyDict_SetItemString(d,"wxHTML_URL_OTHER", PyInt_FromLong((long) wxHTML_URL_OTHER));
PyDict_SetItemString(d,"wxPAGE_ODD", PyInt_FromLong((long) wxPAGE_ODD));
PyDict_SetItemString(d,"wxPAGE_EVEN", PyInt_FromLong((long) wxPAGE_EVEN));
PyDict_SetItemString(d,"wxPAGE_ALL", PyInt_FromLong((long) wxPAGE_ALL));