]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/dcclient.cpp
more fixes to radio menu items: fixed Check() for them; allow separators inside the...
[wxWidgets.git] / src / x11 / dcclient.cpp
index 8307fe264c847e11bceead70b8b456125282aa27..23629d550058d5ac524692e34e95159a0e3ad834 100644 (file)
@@ -1375,7 +1375,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
         slen = strlen(text);
         XCharStruct overall_return;
 
         slen = strlen(text);
         XCharStruct overall_return;
 
-        (void)XTextExtents(xfont, text.c_str(), slen, &direction,
+        (void)XTextExtents(xfont, (char*) text.c_str(), slen, &direction,
                                  &ascent, &descent, &overall_return);
 
         cx = overall_return.width;
                                  &ascent, &descent, &overall_return);
 
         cx = overall_return.width;
@@ -2030,53 +2030,24 @@ int wxWindowDC::GetDepth() const
     return -1;
 }
 
     return -1;
 }
 
-// ----------------------------------------------------------------------------
-// wxPaintDC
-// ----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC)
-
-wxPaintDC::wxPaintDC(wxWindow* win)
-  : wxClientDC(win)
-{
-#if USE_PAINT_REGION
-    if (!win->GetClipPaintRegion())
-        return;
-
-    m_paintClippingRegion = win->GetUpdateRegion();
-    Region region = (Region) m_paintClippingRegion.GetX11Region();
-    if (region)
-    {
-        m_paintClippingRegion = win->GetUpdateRegion();
-        Region region2 = (Region) m_paintClippingRegion.GetX11Region();
-        if (region2)
-        {
-            m_currentClippingRegion.Union( m_paintClippingRegion );
-
-            XSetRegion( (Display*) m_display, (GC) m_penGC, region2 );
-            XSetRegion( (Display*) m_display, (GC) m_brushGC, region2 );
-            XSetRegion( (Display*) m_display, (GC) m_textGC, region2 );
-            XSetRegion( (Display*) m_display, (GC) m_bgGC, region2 );
-        }
-    }
-#endif // USE_PAINT_REGION
-}
-
 //-----------------------------------------------------------------------------
 // wxClientDC
 //-----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
 
 //-----------------------------------------------------------------------------
 // wxClientDC
 //-----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
 
-wxClientDC::wxClientDC( wxWindow *win )
-          : wxWindowDC( win )
+wxClientDC::wxClientDC( wxWindow *window )
+          : wxWindowDC( window )
 {
 {
-    wxCHECK_RET( win, _T("NULL window in wxClientDC::wxClientDC") );
+    wxCHECK_RET( window, _T("NULL window in wxClientDC::wxClientDC") );
     
     
-#ifdef __WXUNIVERSAL__
-    wxPoint ptOrigin = win->GetClientAreaOrigin();
+    m_window = (WXWindow*) window->GetClientWindow();
+    
+#if wxUSE_TWO_WINDOWS
+#else
+    wxPoint ptOrigin = window->GetClientAreaOrigin();
     SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
     SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
-    wxSize size = win->GetClientSize();
+    wxSize size = window->GetClientSize();
     SetClippingRegion(wxPoint(0, 0), size);
 #endif // __WXUNIVERSAL__
 }
     SetClippingRegion(wxPoint(0, 0), size);
 #endif // __WXUNIVERSAL__
 }
@@ -2088,6 +2059,33 @@ void wxClientDC::DoGetSize(int *width, int *height) const
     m_owner->GetClientSize( width, height );
 }
 
     m_owner->GetClientSize( width, height );
 }
 
+// ----------------------------------------------------------------------------
+// wxPaintDC
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC)
+
+wxPaintDC::wxPaintDC(wxWindow* window)
+  : wxClientDC(window)
+{
+#if USE_PAINT_REGION
+    if (!window->GetClipPaintRegion())
+        return;
+
+    m_paintClippingRegion = window->GetUpdateRegion();
+    Region region = (Region) m_paintClippingRegion.GetX11Region();
+    if (region)
+    {
+            m_currentClippingRegion.Union( m_paintClippingRegion );
+
+            XSetRegion( (Display*) m_display, (GC) m_penGC, region );
+            XSetRegion( (Display*) m_display, (GC) m_brushGC, region );
+            XSetRegion( (Display*) m_display, (GC) m_textGC, region );
+            XSetRegion( (Display*) m_display, (GC) m_bgGC, region );
+    }
+#endif // USE_PAINT_REGION
+}
+
 // ----------------------------------------------------------------------------
 // wxDCModule
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxDCModule
 // ----------------------------------------------------------------------------