Unicode fixes for wxPython

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-12-18 06:15:40 +00:00
parent fb7eaf0d7b
commit fbd3b09c78
17 changed files with 233 additions and 186 deletions

View File

@@ -110,8 +110,8 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);

View File

@@ -272,8 +272,8 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);

View File

@@ -69,7 +69,7 @@ public:
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxString& colour);
void SwapBuffers();
#ifdef __WXGTK__
@@ -151,7 +151,7 @@ public:
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxString& colour);
void SwapBuffers();
wxGLContext* GetContext();

View File

@@ -210,12 +210,13 @@ static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, Py
static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLContext * _arg0;
char * _arg1;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLContext_SetColour",_kwnames,&_argo0,&_arg1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -224,14 +225,23 @@ static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyO
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLContext_SetColour(_arg0,_arg1);
wxGLContext_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
@@ -544,12 +554,13 @@ static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyO
static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxGLCanvas * _arg0;
char * _arg1;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","colour", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxGLCanvas_SetColour",_kwnames,&_argo0,&_arg1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -558,14 +569,23 @@ static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyOb
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxGLCanvas_SetColour(_arg0,_arg1);
wxGLCanvas_SetColour(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}

View File

@@ -27,15 +27,17 @@
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
#include <wx/frame.h>
#include "wx/frame.h"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
#endif
#include <wx/msw/private.h>
#include <wx/settings.h>
#include <wx/log.h>
#include "wx/msw/private.h"
#include "myglcanvas.h"
const wxChar* wxGLCanvasName = wxT("GLcanvas");
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
@@ -108,7 +110,7 @@ void wxGLContext::SetCurrent()
*/
}
void wxGLContext::SetColour(const char *colour)
void wxGLContext::SetColour(const wxChar *colour)
{
float r = 0.0;
float g = 0.0;
@@ -403,7 +405,6 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
{
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
@@ -427,13 +428,13 @@ void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
AdjustPFDForAttributes(pfd, attribList);
pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) {
wxLogWarning(_("ChoosePixelFormat failed."));
wxLogLastError(_T("ChoosePixelFormat"));
}
else {
if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) {
wxLogWarning(_("SetPixelFormat failed."));
if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
wxLogLastError(_T("SetPixelFormat"));
}
}
}
@@ -527,7 +528,7 @@ void wxGLCanvas::SetCurrent()
}
}
void wxGLCanvas::SetColour(const char *colour)
void wxGLCanvas::SetColour(const wxChar *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
@@ -728,7 +729,7 @@ bool wxGLApp::InitGLVisual(int *attribList)
AdjustPFDForAttributes(pfd, attribList);
// use DC for whole (root) screen, since no windows have yet been created
pixelFormat = ChoosePixelFormat((HDC) ::GetDC(NULL), &pfd);
pixelFormat = ChoosePixelFormat(ScreenHDC(), &pfd);
if (pixelFormat == 0) {
wxLogError(_("Failed to initialize OpenGL"));

View File

@@ -24,6 +24,7 @@
#include <wx/scrolwin.h>
#include <windows.h>
#include "wx/msw/winundef.h"
#include <GL/gl.h>
@@ -69,7 +70,7 @@ public:
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
@@ -83,21 +84,26 @@ public:
wxWindow* m_window;
};
extern const wxChar* wxGLCanvasName;
class wxGLCanvas: public wxWindow
{
DECLARE_CLASS(wxGLCanvas)
public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "GLCanvas",
const wxSize& size = wxDefaultSize, long style = 0, const wxString&
name = wxGLCanvasName,
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette );
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
~wxGLCanvas();
@@ -106,7 +112,7 @@ class wxGLCanvas: public wxWindow
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);

View File

@@ -37,23 +37,23 @@ private:
public:
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
virtual ~FS_DWebBrowserEvents2()
virtual ~FS_DWebBrowserEvents2()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
{
{
return E_NOTIMPL;
};
@@ -72,7 +72,7 @@ public:
m_iewin->GetParent()->AddPendingEvent(event);
};
bool Process(WXTYPE etype, wxString text = "", long l1 = 0, long l2 = 0)
bool Process(WXTYPE etype, wxString text = wxEmptyString, long l1 = 0, long l2 = 0)
{
if (! m_iewin || ! m_iewin->GetParent())
return true;
@@ -103,7 +103,7 @@ public:
return v.bstrVal;
}
else
return "";
return wxEmptyString;
};
#define STR_ARG(arg) GetStrArg(pDispParams->rgvarg[arg])
@@ -116,7 +116,7 @@ public:
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
{
{
if (wFlags & DISPATCH_PROPERTYGET)
return E_NOTIMPL;
@@ -125,21 +125,21 @@ public:
case DISPID_BEFORENAVIGATE2:
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_NEWWINDOW2:
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_PROGRESSCHANGE:
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0));
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, wxEmptyString, LONG_ARG(1), LONG_ARG(0));
break;
case DISPID_DOCUMENTCOMPLETE:
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
break;
@@ -183,7 +183,7 @@ wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name) :
const wxString& name) :
wxActiveX(parent, PROGID, id, pos, size, style, name)
{
SetupBrowser();
@@ -287,12 +287,12 @@ private:
istream *m_is;
public:
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IStreamAdaptor()
~IStreamAdaptor()
{
delete m_is;
}
@@ -314,12 +314,12 @@ private:
wxInputStream *m_is;
public:
IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IwxStreamAdaptor()
~IwxStreamAdaptor()
{
delete m_is;
}
@@ -338,7 +338,7 @@ public:
void wxIEHtmlWin::LoadUrl(const wxString& url)
{
VARIANTARG navFlag, targetFrame, postData, headers;
navFlag.vt = VT_EMPTY;
navFlag.vt = VT_EMPTY;
navFlag.vt = VT_I2;
navFlag.iVal = navNoReadFromCache;
targetFrame.vt = VT_EMPTY;
@@ -346,8 +346,8 @@ void wxIEHtmlWin::LoadUrl(const wxString& url)
headers.vt = VT_EMPTY;
HRESULT hret = 0;
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
&navFlag, &targetFrame, &postData, &headers);
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
&navFlag, &targetFrame, &postData, &headers);
};
class wxOwnedMemInputStream : public wxMemoryInputStream
@@ -358,7 +358,7 @@ public:
wxOwnedMemInputStream(char *data, size_t len) :
wxMemoryInputStream(data, len), m_data(data)
{}
~wxOwnedMemInputStream()
~wxOwnedMemInputStream()
{
free(m_data);
}
@@ -524,17 +524,17 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
{
wxAutoOleInterface<IHTMLTxtRange> tr(GetSelRange(m_oleObject));
if (! tr)
return "";
return wxEmptyString;
BSTR text = NULL;
HRESULT hr = E_FAIL;
if (asHTML)
hr = tr->get_htmlText(&text);
else
hr = tr->get_text(&text);
if (hr != S_OK)
return "";
return wxEmptyString;
wxString s = text;
SysFreeString(text);
@@ -545,41 +545,41 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
wxString wxIEHtmlWin::GetText(bool asHTML)
{
if (! m_webBrowser.Ok())
return "";
return wxEmptyString;
// get document dispatch interface
IDispatch *iDisp = NULL;
HRESULT hr = m_webBrowser->get_Document(&iDisp);
if (hr != S_OK)
return "";
return wxEmptyString;
// Query for Document Interface
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
iDisp->Release();
if (! hd.Ok())
return "";
return wxEmptyString;
// get body element
IHTMLElement *_body = NULL;
hd->get_body(&_body);
if (! _body)
return "";
return wxEmptyString;
wxAutoOleInterface<IHTMLElement> body(_body);
// get inner text
BSTR text = NULL;
hr = E_FAIL;
if (asHTML)
hr = body->get_innerHTML(&text);
else
hr = body->get_innerText(&text);
if (hr != S_OK)
return "";
return wxEmptyString;
wxString s = text;
SysFreeString(text);
return s;
};
return s;
};

View File

@@ -33,7 +33,7 @@ END_EVENT_TABLE()
class wxActiveX;
class FrameSite :
class FrameSite :
public IOleClientSite,
public IOleInPlaceSiteEx,
public IOleInPlaceFrame,
@@ -60,7 +60,7 @@ public:
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR);
//IOleInPlaceFrame
STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND);
@@ -73,7 +73,7 @@ public:
STDMETHODIMP CanInPlaceActivate();
STDMETHODIMP OnInPlaceActivate();
STDMETHODIMP OnUIActivate();
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
STDMETHODIMP Scroll(SIZE);
STDMETHODIMP OnUIDeactivate(BOOL);
@@ -119,7 +119,7 @@ public:
STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);
STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);
STDMETHODIMP IsRunning(LPOLESTR);
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*);
STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**);
@@ -148,7 +148,7 @@ protected:
bool m_bInPlaceActive;
bool m_bUIActive;
bool m_bWindowless;
LCID m_nAmbientLocale;
@@ -225,14 +225,14 @@ wxActiveX::~wxActiveX()
};
m_connections.clear();
if (m_oleInPlaceObject.Ok())
if (m_oleInPlaceObject.Ok())
{
m_oleInPlaceObject->InPlaceDeactivate();
m_oleInPlaceObject->UIDeactivate();
}
if (m_oleObject.Ok())
if (m_oleObject.Ok())
{
if (m_docAdviseCookie != 0)
m_oleObject->Unadvise(m_docAdviseCookie);
@@ -268,11 +268,11 @@ void wxActiveX::CreateActiveX(REFCLSID clsid)
GetTypeInfo();
// Get IOleObject interface
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
// get IViewObject Interface
hret = m_viewObject.QueryInterface(IID_IViewObject, m_ActiveX);
hret = m_viewObject.QueryInterface(IID_IViewObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
// document advise
@@ -529,23 +529,23 @@ private:
public:
wxActiveXEvents(wxActiveX *ax) : m_activeX(ax) {}
virtual ~wxActiveXEvents()
virtual ~wxActiveXEvents()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
{
{
return E_NOTIMPL;
};
@@ -591,7 +591,7 @@ public:
if (px.IsOut())
{
wxVariant& vx = event.m_params[nArg - i - 1];
VariantToMSWVariant(vx, va);
};
};
@@ -605,7 +605,7 @@ public:
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
{
{
if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF))
return E_NOTIMPL;
@@ -616,7 +616,7 @@ public:
if (mid == m_activeX->m_eventsIdx.end())
return S_OK;
int funcIdx = mid->second;
int funcIdx = mid->second;
wxActiveX::FuncX &func = m_activeX->m_events[funcIdx];
@@ -697,12 +697,12 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
return m_params[i];
};
wxString err = "wxActiveXEvent::operator[] invalid name <" + name + ">";
err += "\r\nValid Names = :\r\n";
wxString err = wxT("wxActiveXEvent::operator[] invalid name <") + name + wxT(">");
err += wxT("\r\nValid Names = :\r\n");
for (i = 0; i < m_params.GetCount(); i++)
{
err += m_params[i].GetName();
err += "\r\n";
err += wxT("\r\n");
};
wxASSERT_MSG(false, err);
@@ -713,15 +713,15 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
void wxActiveX::GetTypeInfo()
{
/*
We are currently only interested in the IDispatch interface
We are currently only interested in the IDispatch interface
to the control. For dual interfaces (TypeKind = TKIND_INTERFACE)
we should drill down through the inheritance
we should drill down through the inheritance
(using TYPEATTR->cImplTypes) and GetRefTypeOfImplType(n)
and retrieve all the func names etc that way, then generate a C++
and retrieve all the func names etc that way, then generate a C++
header file for it.
But we don't do this and probably never will, so if we have a DUAL
interface then we query for the IDispatch
But we don't do this and probably never will, so if we have a DUAL
interface then we query for the IDispatch
via GetRefTypeOfImplType(-1).
*/
@@ -772,12 +772,12 @@ void wxActiveX::GetTypeInfo()
{
if (impTypeFlags & IMPLTYPEFLAG_FSOURCE)
{
WXOLE_TRACEOUT("Default Event Sink");
WXOLE_TRACEOUT(wxT("Default Event Sink"));
defEventSink = true;
}
else
{
WXOLE_TRACEOUT("Default Interface");
WXOLE_TRACEOUT(wxT("Default Interface"));
}
};
@@ -804,7 +804,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
if (ta->typekind == TKIND_DISPATCH)
{
WXOLE_TRACEOUT("GUID = " << GetIIDName(ta->guid).c_str());
WXOLE_TRACEOUT(wxT("GUID = ") << GetIIDName(ta->guid).c_str());
if (defEventSink)
{
@@ -831,7 +831,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
{
wxString name = anames[0];
WXOLE_TRACEOUT("Name " << i << " = " << name.c_str());
WXOLE_TRACEOUT(wxT("Name ") << i << wxT(" = ") << name.c_str());
SysFreeString(anames[0]);
if (defEventSink)
@@ -901,11 +901,11 @@ HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *events)
wxAutoOleInterface<IConnectionPointContainer> cpContainer(IID_IConnectionPointContainer, m_ActiveX);
if (! cpContainer.Ok())
return E_FAIL;
HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef());
if (! SUCCEEDED(hret))
return hret;
hret = cp->Advise(events, &adviseCookie);
if (SUCCEEDED(hret))
@@ -979,7 +979,7 @@ void wxActiveX::OnSize(wxSizeEvent& event)
m_oleObject->SetExtent(DVASPECT_CONTENT, &sz);
};
if (m_oleInPlaceObject.Ok())
if (m_oleInPlaceObject.Ok())
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
}
@@ -1002,7 +1002,7 @@ void wxActiveX::OnPaint(wxPaintEvent& event)
::RedrawWindow(m_oleObjectHWND, NULL, NULL, RDW_INTERNALPAINT);
{
RECTL *prcBounds = (RECTL *) &posRect;
m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
(HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0);
}
}
@@ -1018,11 +1018,11 @@ void wxActiveX::OnPaint(wxPaintEvent& event)
void wxActiveX::OnMouse(wxMouseEvent& event)
{
if (m_oleObjectHWND == NULL)
{
wxLogTrace(wxT("no oleInPlaceObject"));
event.Skip();
return;
if (m_oleObjectHWND == NULL)
{
wxLogTrace(wxT("no oleInPlaceObject"));
event.Skip();
return;
}
wxLogTrace(wxT("mouse event"));
@@ -1031,52 +1031,52 @@ void wxActiveX::OnMouse(wxMouseEvent& event)
LPARAM lParam = 0;
LRESULT lResult = 0;
if (event.m_metaDown)
if (event.m_metaDown)
wParam |= MK_CONTROL;
if (event.m_shiftDown)
if (event.m_shiftDown)
wParam |= MK_SHIFT;
if (event.m_leftDown)
if (event.m_leftDown)
wParam |= MK_LBUTTON;
if (event.m_middleDown)
if (event.m_middleDown)
wParam |= MK_MBUTTON;
if (event.m_rightDown)
if (event.m_rightDown)
wParam |= MK_RBUTTON;
lParam = event.m_x << 16;
lParam |= event.m_y;
if (event.LeftDown())
if (event.LeftDown())
msg = WM_LBUTTONDOWN;
else if (event.LeftDClick())
else if (event.LeftDClick())
msg = WM_LBUTTONDBLCLK;
else if (event.LeftUp())
else if (event.LeftUp())
msg = WM_LBUTTONUP;
else if (event.MiddleDown())
else if (event.MiddleDown())
msg = WM_MBUTTONDOWN;
else if (event.MiddleDClick())
else if (event.MiddleDClick())
msg = WM_MBUTTONDBLCLK;
else if (event.MiddleUp())
else if (event.MiddleUp())
msg = WM_MBUTTONUP;
else if (event.RightDown())
else if (event.RightDown())
msg = WM_RBUTTONDOWN;
else if (event.RightDClick())
else if (event.RightDClick())
msg = WM_RBUTTONDBLCLK;
else if (event.RightUp())
else if (event.RightUp())
msg = WM_RBUTTONUP;
else if (event.Moving() || event.Dragging())
else if (event.Moving() || event.Dragging())
msg = WM_MOUSEMOVE;
wxString log;
if (msg == 0)
{
if (msg == 0)
{
wxLogTrace(wxT("no message"));
event.Skip(); return;
event.Skip(); return;
};
if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam))
{
if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam))
{
wxLogTrace(wxT("msg not delivered"));
event.Skip();
return;
event.Skip();
return;
};
wxLogTrace(wxT("msg sent"));
@@ -1106,13 +1106,13 @@ long wxActiveX::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
void wxActiveX::OnSetFocus(wxFocusEvent& event)
{
if (m_oleInPlaceActiveObject.Ok())
if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
}
void wxActiveX::OnKillFocus(wxFocusEvent& event)
{
if (m_oleInPlaceActiveObject.Ok())
if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
}
@@ -1132,7 +1132,7 @@ FrameSite::FrameSite(wxActiveX * win)
m_bAmbientShowHatching = true;
m_bAmbientShowGrabHandles = true;
m_bAmbientAppearance = true;
m_hDCBuffer = NULL;
m_hWndParent = (HWND)m_window->GetHWND();
}
@@ -1175,7 +1175,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
HRESULT hr;
if (pVarResult == NULL)
if (pVarResult == NULL)
return E_INVALIDARG;
//The most common case is boolean, use as an initial type
@@ -1251,7 +1251,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
HRESULT FrameSite::GetWindow(HWND * phwnd)
{
WXOLE_TRACE("IOleWindow::GetWindow");
if (phwnd == NULL)
if (phwnd == NULL)
return E_INVALIDARG;
(*phwnd) = m_hWndParent;
return S_OK;
@@ -1268,7 +1268,7 @@ HRESULT FrameSite::ContextSensitiveHelp(BOOL fEnterMode)
HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
{
WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder");
if (lprectBorder == NULL)
if (lprectBorder == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
@@ -1276,7 +1276,7 @@ HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
{
WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace");
if (pborderwidths == NULL)
if (pborderwidths == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
@@ -1373,9 +1373,9 @@ HRESULT FrameSite::GetWindowContext(IOleInPlaceFrame **ppFrame,
if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL ||
lprcClipRect == NULL || lpFrameInfo == NULL)
{
if (ppFrame != NULL)
if (ppFrame != NULL)
(*ppFrame) = NULL;
if (ppDoc != NULL)
if (ppDoc != NULL)
(*ppDoc) = NULL;
return E_INVALIDARG;
}
@@ -1465,7 +1465,7 @@ HRESULT FrameSite::OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD dwFlags)
{
WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx");
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
if (pfNoRedraw)
if (pfNoRedraw)
(*pfNoRedraw) = FALSE;
return S_OK;
}
@@ -1502,9 +1502,9 @@ HRESULT FrameSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker,
HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer)
{
WXOLE_TRACE("IOleClientSite::GetContainer");
if (ppContainer == NULL)
if (ppContainer == NULL)
return E_INVALIDARG;
HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer));
wxASSERT(SUCCEEDED(hr));
@@ -1557,26 +1557,26 @@ HRESULT FrameSite::LockContainer(BOOL fLock)
//IOleItemContainer
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
IBindCtx * pbc, REFIID riid, void ** ppvObject)
{
WXOLE_TRACE("IOleItemContainer::GetObject");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
if (ppvObject == NULL)
if (ppvObject == NULL)
return E_INVALIDARG;
*ppvObject = NULL;
return MK_E_NOOBJECT;
}
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
REFIID riid, void ** ppvStorage)
{
WXOLE_TRACE("IOleItemContainer::GetObjectStorage");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
if (ppvStorage == NULL)
if (ppvStorage == NULL)
return E_INVALIDARG;
*ppvStorage = NULL;
@@ -1586,7 +1586,7 @@ HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
HRESULT FrameSite::IsRunning(LPOLESTR pszItem)
{
WXOLE_TRACE("IOleItemContainer::IsRunning");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
return MK_E_NOOBJECT;
@@ -1651,7 +1651,7 @@ HRESULT FrameSite::ShowPropertyFrame()
//IOleCommandTarget
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
OLECMD * prgCmds, OLECMDTEXT * pCmdTet)
{
WXOLE_TRACE("IOleCommandTarget::QueryStatus");
@@ -1670,8 +1670,8 @@ HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
return S_OK;
}
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
VARIANTARG * pVaOut)
{
WXOLE_TRACE("IOleCommandTarget::Exec");
@@ -1775,49 +1775,49 @@ wxString OLEHResultToString(HRESULT hr)
switch (hr)
{
case S_OK:
return "";
return wxEmptyString;
case OLECMDERR_E_UNKNOWNGROUP:
return "The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.";
return wxT("The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.");
case OLECMDERR_E_NOTSUPPORTED:
return "The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.";
return wxT("The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.");
case OLECMDERR_E_DISABLED:
return "The command identified by nCmdID is currently disabled and cannot be executed.";
return wxT("The command identified by nCmdID is currently disabled and cannot be executed.");
case OLECMDERR_E_NOHELP:
return "The caller has asked for help on the command identified by nCmdID, but no help is available.";
return wxT("The caller has asked for help on the command identified by nCmdID, but no help is available.");
case OLECMDERR_E_CANCELED:
return "The user canceled the execution of the command.";
return wxT("The user canceled the execution of the command.");
case E_INVALIDARG:
return "E_INVALIDARG";
return wxT("E_INVALIDARG");
case E_OUTOFMEMORY:
return "E_OUTOFMEMORY";
return wxT("E_OUTOFMEMORY");
case E_NOINTERFACE:
return "E_NOINTERFACE";
return wxT("E_NOINTERFACE");
case E_UNEXPECTED:
return "E_UNEXPECTED";
return wxT("E_UNEXPECTED");
case STG_E_INVALIDFLAG:
return "STG_E_INVALIDFLAG";
return wxT("STG_E_INVALIDFLAG");
case E_FAIL:
return "E_FAIL";
return wxT("E_FAIL");
case E_NOTIMPL:
return "E_NOTIMPL";
return wxT("E_NOTIMPL");
default:
{
char buf[64];
sprintf(buf, "Unknown - 0x%X", hr);
return wxString(buf);
wxString buf;
buf.Printf(wxT("Unknown - 0x%X"), hr);
return buf;
}
};
};
@@ -1826,7 +1826,7 @@ wxString OLEHResultToString(HRESULT hr)
wxString GetIIDName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
struct KNOWN_IID
struct KNOWN_IID
{
const IID *pIid;
const wxChar *szName;
@@ -1836,7 +1836,7 @@ wxString GetIIDName(REFIID riid)
#define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
#define ADD_KNOWN_GUID(name) { &name, _T(#name) }
static const KNOWN_IID aKnownIids[] =
static const KNOWN_IID aKnownIids[] =
{
ADD_KNOWN_IID(AdviseSink),
ADD_KNOWN_IID(AdviseSink2),
@@ -1930,9 +1930,9 @@ wxString GetIIDName(REFIID riid)
#undef ADD_KNOWN_GUID
// try to find the interface in the table
for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
{
if ( riid == *aKnownIids[ui].pIid )
if ( riid == *aKnownIids[ui].pIid )
{
return aKnownIids[ui].szName;
}
@@ -1948,5 +1948,5 @@ wxString GetIIDName(REFIID riid)
return s;
}
else
return "StringFromIID() error";
return wxT("StringFromIID() error");
}

View File

@@ -391,16 +391,17 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
PyObject * _resultobj;
bool _result;
wxPseudoMetaFile * _arg0;
char * _arg1;
wxString * _arg1;
double * _arg2;
double * _arg3;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo2 = 0;
PyObject * _argo3 = 0;
char *_kwnames[] = { "self","filename","width","height", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OsOO:wxPseudoMetaFile_LoadFromMetaFile",_kwnames,&_argo0,&_arg1,&_argo2,&_argo3))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxPseudoMetaFile_LoadFromMetaFile",_kwnames,&_argo0,&_obj1,&_argo2,&_argo3))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -409,6 +410,11 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_double_p")) {
@@ -425,11 +431,15 @@ static PyObject *_wrap_wxPseudoMetaFile_LoadFromMetaFile(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxPseudoMetaFile_LoadFromMetaFile(_arg0,_arg1,_arg2,_arg3);
_result = (bool )wxPseudoMetaFile_LoadFromMetaFile(_arg0,*_arg1,_arg2,_arg3);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
@@ -5938,12 +5948,13 @@ static PyObject *_wrap_wxPyDrawnShape_LoadFromMetaFile(PyObject *self, PyObject
PyObject * _resultobj;
bool _result;
wxPyDrawnShape * _arg0;
char * _arg1;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","filename", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxPyDrawnShape_LoadFromMetaFile",_kwnames,&_argo0,&_arg1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDrawnShape_LoadFromMetaFile",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -5952,13 +5963,22 @@ static PyObject *_wrap_wxPyDrawnShape_LoadFromMetaFile(PyObject *self, PyObject
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxPyDrawnShape_LoadFromMetaFile(_arg0,_arg1);
_result = (bool )wxPyDrawnShape_LoadFromMetaFile(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}

View File

@@ -56,7 +56,7 @@ public:
void ScaleTo(double w, double h);
void Translate(double x, double y);
void Rotate(double x, double y, double theta);
bool LoadFromMetaFile(char* filename, double *width, double *height);
bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
void CalculateSize(wxPyDrawnShape* shape);
@@ -281,7 +281,7 @@ public:
wxPseudoMetaFile& GetMetaFile();
double GetRotation();
bool LoadFromMetaFile(char * filename);
bool LoadFromMetaFile(const wxString& filename);
void Rotate(double x, double y, double theta);
void SetClippingRect(const wxRect& rect);
void SetDrawnBackgroundColour(const wxColour& colour);

View File

@@ -291,7 +291,7 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() {
void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
wxPyBeginBlockThreads();
if (m_myInst.findCallback("SetBitmap")) {
PyObject* bo = wxPyConstructObject((void*)&bitmap, "wxBitmap");
PyObject* bo = wxPyConstructObject((void*)&bitmap, wxT("wxBitmap"));
m_myInst.callCallback(Py_BuildValue("(O)", bo));
Py_DECREF(bo);
}

View File

@@ -1102,8 +1102,8 @@ public:
bool found;
wxPyBeginBlockThreads();
if ((found = m_myInst.findCallback("OnCompareItems"))) {
PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId");
PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId");
PyObject *o1 = wxPyConstructObject((void*)&item1, wxT("wxTreeItemId"));
PyObject *o2 = wxPyConstructObject((void*)&item2, wxT("wxTreeItemId"));
rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2));
Py_DECREF(o1);
Py_DECREF(o2);
@@ -1244,7 +1244,7 @@ public:
num = self->GetSelections(array);
for (x=0; x < num; x++) {
wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
PyObject* item = wxPyConstructObject((void*)tii, wxT("wxTreeItemId"), TRUE);
PyList_Append(rval, item);
}
wxPyEndBlockThreads();
@@ -1335,7 +1335,7 @@ public:
if (self->GetBoundingRect(item, rect, textOnly)) {
wxPyBeginBlockThreads();
wxRect* r = new wxRect(rect);
PyObject* val = wxPyConstructObject((void*)r, "wxRect");
PyObject* val = wxPyConstructObject((void*)r, wxT("wxRect"));
wxPyEndBlockThreads();
return val;
}

View File

@@ -70,7 +70,7 @@ PyObject* wxPyMake_##TYPE(TYPE* source) { \
/* Otherwise make a new wrapper for it the old fashioned way and \
give it the OOR treatment */ \
if (! target) { \
target = wxPyConstructObject(source, #TYPE, FALSE); \
target = wxPyConstructObject(source, wxT(#TYPE), FALSE); \
if (target) \
source->SetClientObject(new wxPyOORClientData(target)); \
} \
@@ -571,7 +571,7 @@ public:
PyObject* go = wxPyMake_wxObject(&grid);
PyObject* dco = wxPyMake_wxObject(&dc);
PyObject* ao = wxPyMake_wxGridCellAttr(&attr);
PyObject* ro = wxPyConstructObject((void*)&rect, "wxRect", 0);
PyObject* ro = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", go, ao, dco, ro,
row, col, isSelected));
@@ -856,7 +856,7 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) {
PyObject* ao = wxPyMake_wxGridCellAttr(attr);
PyObject* ro = wxPyConstructObject((void*)&rectCell, "wxRect", 0);
PyObject* ro = wxPyConstructObject((void*)&rectCell, wxT("wxRect"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", ro, ao));

View File

@@ -527,7 +527,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHW_SCROLLBAR_AUTO,
const wxString& name = "htmlWindow")
const wxString& name = wxPyHtmlWindowNameStr)
: wxHtmlWindow(parent, id, pos, size, style, name) {};
wxPyHtmlWindow() : wxHtmlWindow() {};
@@ -563,7 +563,7 @@ void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
bool found;
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "OnLinkClicked"))) {
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0);
PyObject* obj = wxPyConstructObject((void*)&link, wxT("wxHtmlLinkInfo"), 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
Py_DECREF(obj);
}

View File

@@ -318,7 +318,7 @@ public:
if (dest != wxRect(0,0,0,0)) {
wxPyBeginBlockThreads();
wxRect* newRect = new wxRect(dest);
obj = wxPyConstructObject((void*)newRect, "wxRect");
obj = wxPyConstructObject((void*)newRect, wxT("wxRect"));
PyObject* one = PyInt_FromLong(1);
PyObject_SetAttrString(obj, "thisown", one);
Py_DECREF(one);

View File

@@ -1257,7 +1257,7 @@ public:
wxPyBeginBlockThreads();
PyObject* tuple = PyTuple_New(3);
PyTuple_SetItem(tuple, 0, wxPyConstructObject(new wxIcon(icon),
"wxIcon", TRUE));
wxT("wxIcon"), TRUE));
#if wxUSE_UNICODE
PyTuple_SetItem(tuple, 1, PyUnicode_FromUnicode(iconFile.c_str(), iconFile.Len()));
#else
@@ -1527,7 +1527,7 @@ public:
wxBitmap rval = wxNullBitmap;
wxPyBeginBlockThreads();
if ((wxPyCBH_findCallback(m_myInst, "CreateBitmap"))) {
PyObject* so = wxPyConstructObject((void*)&size, "wxSize", 0);
PyObject* so = wxPyConstructObject((void*)&size, wxT("wxSize"), 0);
PyObject* ro;
wxBitmap* ptr;
PyObject* s1, *s2;

View File

@@ -61,7 +61,7 @@
if ($source) {
_ptr = new wxPyInputStream($source);
}
$target = wxPyConstructObject(_ptr, "wxInputStream", TRUE);
$target = wxPyConstructObject(_ptr, wxT("wxInputStream"), TRUE);
}
//----------------------------------------------------------------------