]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_dc.i
call PKG_PROG_PKG_CONFIG before checking for gnomeprintui, gnomevfs and hildon librar...
[wxWidgets.git] / wxPython / src / _dc.i
index 7c24e09d2a7f481b508f7bb083a0ad344e9ede54..9dbb9a3dbc389cd17931ac67f5c5d292331e9e10 100644 (file)
@@ -352,6 +352,12 @@ position.", "
     :param srcPtMask:   Source position on the mask. 
 ",
         BlitPointSize);
     :param srcPtMask:   Source position on the mask. 
 ",
         BlitPointSize);
+
+
+    DocDeclStr(
+        wxBitmap , GetAsBitmap(const wxRect *subrect = NULL) const,
+        "", "");
+    
     
 
     DocStr(
     
 
     DocStr(
@@ -1235,6 +1241,64 @@ static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) {
 %}
 
 
 %}
 
 
+//---------------------------------------------------------------------------
+%newgroup
+
+DocStr(wxDCTextColourChanger,
+"wx.DCTextColourChanger can be used to temporarily change the DC text
+colour and restore it automatically when the object goes out of scope", "");
+
+class wxDCTextColourChanger
+{
+public:
+    wxDCTextColourChanger(wxDC& dc, const wxColour& col);
+    ~wxDCTextColourChanger();
+};
+
+
+DocStr(wxDCPenChanger,
+"wx.DCPenChanger can be used to temporarily change the DC pen and
+restore it automatically when the object goes out of scope", "");
+
+class  wxDCPenChanger
+{
+public:
+    wxDCPenChanger(wxDC& dc, const wxPen& pen);
+    ~wxDCPenChanger();
+};
+
+
+
+DocStr(wxDCBrushChanger,
+"wx.DCBrushChanger can be used to temporarily change the DC brush and
+restore it automatically when the object goes out of scope", "");
+
+class wxDCBrushChanger
+{
+public:
+    wxDCBrushChanger(wxDC& dc, const wxBrush& brush);
+    ~wxDCBrushChanger();
+};
+
+
+DocStr(wxDCClipper,
+"wx.wxDCClipper sets the DC's clipping region when it is constructed,
+and then automatically destroys the clipping region when the clipper
+goes out of scope.", "");
+
+class wxDCClipper
+{
+public:
+    %nokwargs wxDCClipper;
+    wxDCClipper(wxDC& dc, const wxRegion& r);
+    wxDCClipper(wxDC& dc, const wxRect& r);
+    wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h);
+    ~wxDCClipper();
+};
+
+
+
+
 //---------------------------------------------------------------------------
 %newgroup
 
 //---------------------------------------------------------------------------
 %newgroup
 
@@ -1258,7 +1322,7 @@ of it) before a bitmap can be reselected into another memory DC.
 class wxMemoryDC : public wxDC {
 public:
     DocCtorStr(
 class wxMemoryDC : public wxDC {
 public:
     DocCtorStr(
-        wxMemoryDC(const wxBitmap& bitmap = wxNullBitmap),
+        wxMemoryDC(wxBitmap& bitmap = wxNullBitmap),
         "Constructs a new memory device context.
 
 Use the Ok member to test whether the constructor was successful in
         "Constructs a new memory device context.
 
 Use the Ok member to test whether the constructor was successful in
@@ -1275,7 +1339,7 @@ drawing on it.", "
 
     
     DocDeclStr(
 
     
     DocDeclStr(
-        void , SelectObject(const wxBitmap& bitmap),
+        void , SelectObject(wxBitmap& bitmap),
         "Selects the bitmap into the device context, to use as the memory
 bitmap. Selecting the bitmap into a memory DC allows you to draw into
 the DC, and therefore the bitmap, and also to use Blit to copy the
         "Selects the bitmap into the device context, to use as the memory
 bitmap. Selecting the bitmap into a memory DC allows you to draw into
 the DC, and therefore the bitmap, and also to use Blit to copy the
@@ -1285,6 +1349,12 @@ If the argument is wx.NullBitmap (or some other uninitialised
 `wx.Bitmap`) the current bitmap is selected out of the device context,
 and the original bitmap restored, allowing the current bitmap to be
 destroyed safely.", "");
 `wx.Bitmap`) the current bitmap is selected out of the device context,
 and the original bitmap restored, allowing the current bitmap to be
 destroyed safely.", "");
+
+    
+    DocDeclStr(
+        void , SelectObjectAsSource(const wxBitmap& bmp),
+        "", "");
+    
     
 };
 
     
 };
 
@@ -1425,16 +1495,26 @@ DocStr(wxBufferedDC,
 "This simple class provides a simple way to avoid flicker: when drawing
 on it, everything is in fact first drawn on an in-memory buffer (a
 `wx.Bitmap`) and then copied to the screen only once, when this object
 "This simple class provides a simple way to avoid flicker: when drawing
 on it, everything is in fact first drawn on an in-memory buffer (a
 `wx.Bitmap`) and then copied to the screen only once, when this object
-is destroyed.
+is destroyed.  You can either provide a buffer bitmap yourself, and
+reuse it the next time something needs painted, or you can let the
+buffered DC create and provide a buffer bitmap itself.
 
 
-It can be used in the same way as any other device context.
+Buffered DCs can be used in the same way as any other device context.
 wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
 use it in your EVT_PAINT handler, you should look at
 wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
 use it in your EVT_PAINT handler, you should look at
-`wx.BufferedPaintDC`.
+`wx.BufferedPaintDC`.  You can also use a wx.BufferedDC without
+providing a target DC.  In this case the operations done on the dc
+will only be written to the buffer bitmap and *not* to any window, so
+you will want to have provided the buffer bitmap and then reuse it
+when it needs painted to the window.
 
 Please note that GTK+ 2.0 and OS X provide double buffering themselves
 
 Please note that GTK+ 2.0 and OS X provide double buffering themselves
-natively. wxBufferedDC is aware of this however, and will bypass the buffering
-unless an explicit buffer bitmap is given.
+natively.  You may want to use `wx.Window.IsDoubleBuffered` to
+determine whether you need to use buffering or not, or use
+`wx.AutoBufferedPaintDC` to avoid needless double buffering on systems
+that already do it automatically.
+
+
 ", "");
 
 class wxBufferedDC : public wxMemoryDC
 ", "");
 
 class wxBufferedDC : public wxMemoryDC