]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/gtk.cpp
1. Added m_count and maintain its value in InsertItem, RemoveItem
[wxWidgets.git] / src / univ / themes / gtk.cpp
index ab9a0db5b4a5df946c981a20106404806add9b6d..9ad98cbcd597a4a517fb381890d9a22e5ab7684d 100644 (file)
@@ -184,21 +184,25 @@ public:
 
     virtual void DrawSliderShaft(wxDC& dc,
                                  const wxRect& rect,
 
     virtual void DrawSliderShaft(wxDC& dc,
                                  const wxRect& rect,
+                                 int lenThumb,
                                  wxOrientation orient,
                                  int flags = 0,
                                  wxOrientation orient,
                                  int flags = 0,
+                                 long style = 0,
                                  wxRect *rectShaft = NULL);
     virtual void DrawSliderThumb(wxDC& dc,
                                  const wxRect& rect,
                                  wxOrientation orient,
                                  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,
     virtual void DrawSliderTicks(wxDC& dc,
                                  const wxRect& rect,
-                                 const wxSize& sizeThumb,
+                                 int lenThumb,
                                  wxOrientation orient,
                                  int start,
                                  int end,
                                  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
     }
     {
         // we don't have the ticks in GTK version
     }
@@ -305,8 +309,11 @@ public:
     virtual wxCoord GetSliderDim() const { return 15; }
     virtual wxCoord GetSliderTickLen() const { return 0; }
     virtual wxRect GetSliderShaftRect(const wxRect& rect,
     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,
     virtual wxSize GetSliderThumbSize(const wxRect& rect,
+                                      int lenThumb,
                                       wxOrientation orient) const;
     virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
 
                                       wxOrientation orient) const;
     virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
 
@@ -1610,6 +1617,10 @@ void wxGTKRenderer::DrawRadioButton(wxDC& dc,
         dc.SetBackground(*wxLIGHT_GREY_BRUSH);
         dc.Clear();
         DrawRadioBitmap(dc, rect, flags);
         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));
     }
 
         bitmap.SetMask(new wxMask(bitmap, *wxLIGHT_GREY));
     }
 
@@ -1861,13 +1872,14 @@ void wxGTKRenderer::DrawTab(wxDC& dc,
 // ----------------------------------------------------------------------------
 
 wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
 // ----------------------------------------------------------------------------
 
 wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
+                                         int lenThumb,
                                          wxOrientation orient) const
 {
     static const wxCoord SLIDER_THUMB_LENGTH = 30;
 
     wxSize size;
 
                                          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);
     if ( orient == wxHORIZONTAL )
     {
         size.x = wxMin(SLIDER_THUMB_LENGTH, rectShaft.width);
@@ -1883,15 +1895,19 @@ wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect,
 }
 
 wxRect wxGTKRenderer::GetSliderShaftRect(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,
 {
     return rect.Deflate(2*BORDER_THICKNESS, 2*BORDER_THICKNESS);
 }
 
 void wxGTKRenderer::DrawSliderShaft(wxDC& dc,
                                     const wxRect& rectOrig,
+                                    int lenThumb,
                                     wxOrientation orient,
                                     int flags,
                                     wxOrientation orient,
                                     int flags,
+                                    long style,
                                     wxRect *rectShaft)
 {
     wxRect rect = rectOrig;
                                     wxRect *rectShaft)
 {
     wxRect rect = rectOrig;
@@ -1918,7 +1934,8 @@ void wxGTKRenderer::DrawSliderShaft(wxDC& dc,
 void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
                                     const wxRect& rectOrig,
                                     wxOrientation orient,
 void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
                                     const wxRect& rectOrig,
                                     wxOrientation orient,
-                                    int flags)
+                                    int flags,
+                                    long style)
 {
     // draw the thumb border
     wxRect rect = rectOrig;
 {
     // draw the thumb border
     wxRect rect = rectOrig;
@@ -2810,7 +2827,7 @@ int wxGTKRenderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags
 // standard icons
 // ----------------------------------------------------------------------------
 
 // standard icons
 // ----------------------------------------------------------------------------
 
-static char *error_xpm[] = {
+static const char *error_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 537 2",
 "   c Gray0",
 /* columns rows colors chars-per-pixel */
 "48 48 537 2",
 "   c Gray0",
@@ -3401,7 +3418,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+"
 };
 
 "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",
 /* columns rows colors chars-per-pixel */
 "48 48 478 2",
 "   c Gray0",
@@ -3934,7 +3951,7 @@ static char *info_xpm[] = {
 };
 
 /* XPM */
 };
 
 /* XPM */
-static char *warning_xpm[] = {
+static const char *warning_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 270 2",
 "   c Gray0",
 /* columns rows colors chars-per-pixel */
 "48 48 270 2",
 "   c Gray0",
@@ -4259,7 +4276,7 @@ static char *warning_xpm[] = {
 };
 
 /* XPM */
 };
 
 /* XPM */
-static char *question_xpm[] = {
+static const char *question_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "48 48 101 2",
 "   c Gray0",
 /* columns rows colors chars-per-pixel */
 "48 48 101 2",
 "   c Gray0",