]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/gtk.cpp
pc 2 mac conversion for file operations
[wxWidgets.git] / src / univ / themes / gtk.cpp
index ab9a0db5b4a5df946c981a20106404806add9b6d..a2d98dd2990a4f728dff7eec1bf4b4e76a5d0d5a 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     06.08.00
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
@@ -165,7 +165,8 @@ public:
                                    const wxString& label,
                                    const wxBitmap& bitmap,
                                    const wxRect& rect,
-                                   int flags);
+                                   int flags = 0,
+                                   long style = 0);
 
     virtual void DrawTextLine(wxDC& dc,
                               const wxString& text,
@@ -184,21 +185,25 @@ public:
 
     virtual void DrawSliderShaft(wxDC& dc,
                                  const wxRect& rect,
+                                 int lenThumb,
                                  wxOrientation orient,
                                  int flags = 0,
+                                 long style = 0,
                                  wxRect *rectShaft = NULL);
     virtual void DrawSliderThumb(wxDC& dc,
                                  const wxRect& rect,
                                  wxOrientation orient,
-                                 int flags = 0);
+                                 int flags = 0,
+                                 long style = 0);
     virtual void DrawSliderTicks(wxDC& dc,
                                  const wxRect& rect,
-                                 const wxSize& sizeThumb,
+                                 int lenThumb,
                                  wxOrientation orient,
                                  int start,
                                  int end,
-                                 int step,
-                                 int flags)
+                                 int step = 1,
+                                 int flags = 0,
+                                 long style = 0)
     {
         // we don't have the ticks in GTK version
     }
@@ -305,8 +310,11 @@ public:
     virtual wxCoord GetSliderDim() const { return 15; }
     virtual wxCoord GetSliderTickLen() const { return 0; }
     virtual wxRect GetSliderShaftRect(const wxRect& rect,
-                                      wxOrientation orient) const;
+                                      int lenThumb,
+                                      wxOrientation orient,
+                                      long style = 0) const;
     virtual wxSize GetSliderThumbSize(const wxRect& rect,
+                                      int lenThumb,
                                       wxOrientation orient) const;
     virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
 
@@ -1610,6 +1618,10 @@ void wxGTKRenderer::DrawRadioButton(wxDC& dc,
         dc.SetBackground(*wxLIGHT_GREY_BRUSH);
         dc.Clear();
         DrawRadioBitmap(dc, rect, flags);
+
+        // must unselect the bitmap before setting a mask for it because of the
+        // MSW limitations
+        dc.SelectObject(wxNullBitmap);
         bitmap.SetMask(new wxMask(bitmap, *wxLIGHT_GREY));
     }
 
@@ -1621,7 +1633,8 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc,
                                       const wxString& label,
                                       const wxBitmap& bitmap,
                                       const wxRect& rectOrig,
-                                      int flags)
+                                      int flags,
+                                      long style)
 {
     // we don't draw the separators at all
     if ( !label.empty() || bitmap.Ok() )
@@ -1861,13 +1874,14 @@ void wxGTKRenderer::DrawTab(wxDC& dc,
 // ----------------------------------------------------------------------------
 
 wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
+                                         int lenThumb,
                                          wxOrientation orient) const
 {
     static const wxCoord SLIDER_THUMB_LENGTH = 30;
 
     wxSize size;
 
-    wxRect rectShaft = GetSliderShaftRect(rect, orient);
+    wxRect rectShaft = GetSliderShaftRect(rect, lenThumb, orient);
     if ( orient == wxHORIZONTAL )
     {
         size.x = wxMin(SLIDER_THUMB_LENGTH, rectShaft.width);
@@ -1883,15 +1897,19 @@ wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
 }
 
 wxRect wxGTKRenderer::GetSliderShaftRect(const wxRect& rect,
-                                         wxOrientation WXUNUSED(orient)) const
+                                         int lenThumb,
+                                         wxOrientation WXUNUSED(orient),
+                                         long style) const
 {
     return rect.Deflate(2*BORDER_THICKNESS, 2*BORDER_THICKNESS);
 }
 
 void wxGTKRenderer::DrawSliderShaft(wxDC& dc,
                                     const wxRect& rectOrig,
+                                    int lenThumb,
                                     wxOrientation orient,
                                     int flags,
+                                    long style,
                                     wxRect *rectShaft)
 {
     wxRect rect = rectOrig;
@@ -1918,7 +1936,8 @@ void wxGTKRenderer::DrawSliderShaft(wxDC& dc,
 void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
                                     const wxRect& rectOrig,
                                     wxOrientation orient,
-                                    int flags)
+                                    int flags,
+                                    long style)
 {
     // draw the thumb border
     wxRect rect = rectOrig;
@@ -2810,7 +2829,7 @@ int wxGTKRenderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags
 // standard icons
 // ----------------------------------------------------------------------------
 
-static char *error_xpm[] = {
+static const char *error_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 537 2",
 "   c Gray0",
@@ -3401,7 +3420,7 @@ static char *error_xpm[] = {
 "W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+W+"
 };
 
-static char *info_xpm[] = {
+static const char *info_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 478 2",
 "   c Gray0",
@@ -3934,7 +3953,7 @@ static char *info_xpm[] = {
 };
 
 /* XPM */
-static char *warning_xpm[] = {
+static const char *warning_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 270 2",
 "   c Gray0",
@@ -4259,7 +4278,7 @@ static char *warning_xpm[] = {
 };
 
 /* XPM */
-static char *question_xpm[] = {
+static const char *question_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 101 2",
 "   c Gray0",