]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dcclient.cpp
Added gridsel.cpp
[wxWidgets.git] / src / gtk1 / dcclient.cpp
index 8c72dd103b4888350a1f63d924e772f5795aee70..15b1c16e4b0cd3b15c90f80546fbb21043d6e13b 100644 (file)
@@ -153,6 +153,10 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
         {
             wxGCPool[i].m_gc = gdk_gc_new( window );
             gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
+            // This allows you to e.g. copy from the screen
+            // without clipping the windows on it.
+            gdk_gc_set_subwindow( wxGCPool[i].m_gc, 
+                                 GDK_INCLUDE_INFERIORS );
             wxGCPool[i].m_type = type;
             wxGCPool[i].m_used = FALSE;
         }
@@ -342,10 +346,18 @@ void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
     wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
 }
 
-bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
+bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
 {
-    wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
-    return FALSE;
+    // Generic (and therefore rather inefficient) method.
+    // Could be improved.
+    wxMemoryDC memdc;
+    wxBitmap bitmap(1, 1);
+    memdc.SelectObject(bitmap);
+    memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
+    memdc.SelectObject(wxNullBitmap);
+    wxImage image(bitmap);
+    col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
+    return TRUE;
 }
 
 void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )