]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_font.i
reSWIGged
[wxWidgets.git] / wxPython / src / _font.i
index bd059a236e3e7cbd14e8bc7091c1bece9288f81d..2e858aacca0e34cc22e289e065cfb66239e0777e 100644 (file)
@@ -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);
         }
     }
 };