]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed ComboDropDown button under GTK+ so that it
authorRobert Roebling <robert@roebling.de>
Mon, 28 Feb 2005 14:38:47 +0000 (14:38 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 28 Feb 2005 14:38:47 +0000 (14:38 +0000)
    will create a transparent button. This works for
    the date control, but should be generalized somehow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datectlg.cpp
src/gtk/renderer.cpp
src/gtk1/renderer.cpp

index c035731aab81f388ebf889c45876e153bfb6e7ab..8a1c2bcf2ee02fb22df5707611a66015f6083a86 100644 (file)
@@ -194,12 +194,33 @@ void wxDropdownButton::DoMoveWindow(int x, int y, int w, int h)
 
         wxRect r(0,0,bw, bh);
         wxRendererNative& renderer = wxRendererNative::Get();
+        
+#ifdef __WXGTK__
+        wxColour magic(255,0,255);
+        dc.SetBrush( wxBrush( magic ) );
+        dc.SetPen( *wxTRANSPARENT_PEN );
+        dc.DrawRectangle(0,0,bw,bh);
+        renderer.DrawComboBoxDropButton(this, dc, r);
+        wxMask *mask = new wxMask( bmp, magic );
+        bmp.SetMask( mask );
+#else
         renderer.DrawComboBoxDropButton(this, dc, r);
+#endif
         SetBitmapLabel(bmp);
 
         wxBitmap bmpSel(bw, bh);
         dc.SelectObject(bmpSel);
+        
+#ifdef __WXGTK__
+        dc.SetBrush( wxBrush( magic ) );
+        dc.SetPen( *wxTRANSPARENT_PEN );
+        dc.DrawRectangle(0,0,bw,bh);
+        renderer.DrawComboBoxDropButton(this, dc, r, wxCONTROL_PRESSED);
+        mask = new wxMask( bmpSel, magic );
+        bmpSel.SetMask( mask );
+#else
         renderer.DrawComboBoxDropButton(this, dc, r, wxCONTROL_PRESSED);
+#endif        
         SetBitmapSelected(bmpSel);
     }
 
index c6e3f69cdcd64dd2c375922704165fd8119c9239..1094858d740a7d4ca58cf503d3f9e3d0405d31e6 100644 (file)
@@ -396,19 +396,6 @@ void wxRendererGTK::DrawComboBoxDropButton(wxWindow *win,
     else
         state = GTK_STATE_NORMAL;
 
-    // erase background first
-    gtk_paint_box
-    (
-        button->style,
-        wdc.m_window,
-        state,
-        GTK_SHADOW_NONE,
-        NULL,
-        button,
-        "button",
-        rect.x, rect.y, rect.width, rect.height
-    );
-
     // draw arrow on button
     gtk_paint_arrow
     (
index c6e3f69cdcd64dd2c375922704165fd8119c9239..1094858d740a7d4ca58cf503d3f9e3d0405d31e6 100644 (file)
@@ -396,19 +396,6 @@ void wxRendererGTK::DrawComboBoxDropButton(wxWindow *win,
     else
         state = GTK_STATE_NORMAL;
 
-    // erase background first
-    gtk_paint_box
-    (
-        button->style,
-        wdc.m_window,
-        state,
-        GTK_SHADOW_NONE,
-        NULL,
-        button,
-        "button",
-        rect.x, rect.y, rect.width, rect.height
-    );
-
     // draw arrow on button
     gtk_paint_arrow
     (