wxStyledTextCtrl can now be built and used when wxUSE_UNICODE==1.

When in unicode mode Scintilla uses UTF-8 internally so the wxSTC
wrapper only needs to convert to/from UTF-8 in the right places.
Still need to figure out to get unicode characters from key/char
events...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-03-20 20:43:39 +00:00
parent ef1cae87cd
commit 10ef30eb53
22 changed files with 1033 additions and 534 deletions

View File

@@ -188,6 +188,32 @@ $function
//---------------------------------------------------------------------------
%typemap(python, in) wxMemoryBuffer& {
if (!PyString_Check($source)) {
PyErr_SetString(PyExc_TypeError, "String buffer expected");
return NULL;
}
char* str = PyString_AS_STRING($source);
int len = PyString_GET_SIZE($source);
$target = new wxMemoryBuffer(len);
memcpy($target->GetData(), str, len);
}
%typemap(python, freearg) wxMemoryBuffer& {
if ($target)
delete $source;
}
%typemap(python, out) wxMemoryBuffer {
$target = PyString_FromStringAndSize((char*)$source->GetData(), $source->GetDataLen());
}
%typemap(python, ret) wxMemoryBuffer {
delete $source;
}
//---------------------------------------------------------------------------