]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_graphics.i
GetNumberOfLines on GTK doesn't count wrapped lines again...
[wxWidgets.git] / wxPython / src / _graphics.i
index 2eafd0be1b18b3295821ebb45181ab05b3c48450..07f7db2e239315008448e7ad627e40f241915763 100644 (file)
@@ -285,6 +285,13 @@ public:
         wxPyEndBlockThreads(blocked);
      }
 
+    wxGCDC(const wxWindow*) {
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();
+        PyErr_SetString(PyExc_NotImplementedError,
+                        "wxGCDC is not available on this platform.");
+        wxPyEndBlockThreads(blocked);
+     }
+
     wxGCDC() {
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         PyErr_SetString(PyExc_NotImplementedError,
@@ -628,6 +635,10 @@ public:
     static wxGraphicsContext* Create( const wxWindowDC& dc);
     static wxGraphicsContext* Create( wxWindow* window ) ;
 
+    DocDeclStrName(
+        static wxGraphicsContext* , Create(),
+        "Create a lightwieght context that can be used for measuring text only.", "",
+        CreateMeasuringContext);
     
     %newobject CreateFromNative;
     DocDeclStr(
@@ -790,15 +801,31 @@ this context.", "");
         "Draws the path by first filling and then stroking.", "");
 
 
-    DocDeclStr(
-        virtual void , DrawText( const wxString &str, wxDouble x, wxDouble y ),
-        "Draws a text at the defined position.", "");
-
+    %extend {
+        DocStr(DrawText,
+               "Draws a text string at the defined position.", "");
+        void DrawText( const wxString &str, wxDouble x, wxDouble y,
+                       const wxGraphicsBrush& backgroundBrush = wxNullGraphicsBrush )
+        {
+            if ( !backgroundBrush.IsNull() )
+                self->DrawText(str, x, y, backgroundBrush);
+            else
+                self->DrawText(str, x, y);
+        }
 
-    DocDeclStrName(
-        virtual void , DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ),
-        "Draws a text at the defined position, at the given angle.", "",
-        DrawRotatedText);
+        DocStr(DrawRotatedText,
+               "Draws a text string at the defined position, at the specified angle,
+which is given in radians.", "");
+        void DrawRotatedText(  const wxString &str, wxDouble x, wxDouble y, wxDouble angle,
+                               const wxGraphicsBrush& backgroundBrush = wxNullGraphicsBrush )
+        {
+            if ( !backgroundBrush.IsNull() )
+                self->DrawText(str, x, y, angle, backgroundBrush);
+            else
+                self->DrawText(str, x, y, angle);
+        }
+    }
+   
 
 
     DocDeclAStrName(
@@ -939,6 +966,9 @@ public :
     virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) ;
     virtual wxGraphicsContext * CreateContext( wxWindow* window );
     
+    // create a context that can be used for measuring texts only, no drawing allowed
+    virtual wxGraphicsContext * CreateMeasuringContext();
+    
     %newobject CreateContextFromNativeContext;
     virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
 
@@ -976,9 +1006,11 @@ public :
 class wxGCDC: public wxDC
 {
 public:
+    %nokwargs wxGCDC;
     %pythonAppend wxGCDC
         "self.__dc = args[0] # save a ref so the other dc will not be deleted before self";
     wxGCDC(const wxWindowDC& dc);
+    wxGCDC(wxWindow* window);
     //wxGCDC();
     virtual ~wxGCDC();