X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56e63286ac78b9089525820aa0b3c5f74474fb2f..b94aea930437cd4d488ac13dbb283693389408c6:/wxPython/src/_font.i diff --git a/wxPython/src/_font.i b/wxPython/src/_font.i index bd059a236e..2e858aacca 100644 --- a/wxPython/src/_font.i +++ b/wxPython/src/_font.i @@ -430,8 +430,14 @@ public: %newgroup +MustHaveApp(wxFont); +MustHaveApp(wxFont::GetDefaultEncoding); +MustHaveApp(wxFont::SetDefaultEncoding); + class wxFont : public wxGDIObject { public: + %pythonPrepend wxFont "if kwargs.has_key('faceName'): kwargs['face'] = kwargs['faceName'];del kwargs['faceName']" + wxFont( int pointSize, int family, int style, int weight, bool underline=False, const wxString& face = wxPyEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); @@ -446,10 +452,10 @@ public: } %name(Font2) wxFont(int pointSize, - wxFontFamily family, - int flags = wxFONTFLAG_DEFAULT, - const wxString& face = wxPyEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { + wxFontFamily family, + int flags = wxFONTFLAG_DEFAULT, + const wxString& face = wxPyEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { return wxFont::New(pointSize, family, flags, face, encoding); } } @@ -500,7 +506,7 @@ public: // Unofficial API, don't use virtual void SetNoAntiAliasing( bool no = True ); - virtual bool GetNoAntiAliasing(); + virtual bool GetNoAntiAliasing() const; // the default encoding is used for creating all fonts with default // encoding parameter @@ -531,6 +537,8 @@ IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEnc %} +MustHaveApp(wxPyFontEnumerator); + %name(FontEnumerator) class wxPyFontEnumerator { public: %pythonAppend wxPyFontEnumerator "self._setCallbackInfo(self, FontEnumerator, 0)" @@ -550,12 +558,18 @@ public: %extend { PyObject* GetEncodings() { wxArrayString* arr = self->GetEncodings(); - return wxArrayString2PyList_helper(*arr); + if (arr) + return wxArrayString2PyList_helper(*arr); + else + return PyList_New(0); } PyObject* GetFacenames() { wxArrayString* arr = self->GetFacenames(); - return wxArrayString2PyList_helper(*arr); + if (arr) + return wxArrayString2PyList_helper(*arr); + else + return PyList_New(0); } } };