]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/stdrend.cpp
Remove unnecessary comparison of unsigned variable with 0.
[wxWidgets.git] / src / univ / stdrend.cpp
index f392add9cca7083e4ad95921ea885ce329d28746..d9253ac5e35acd56a790167ca8a7009aad8df969 100644 (file)
@@ -151,7 +151,7 @@ wxStdRenderer::ArrowDirection wxStdRenderer::GetArrowDirection(wxDirection dir)
             return Arrow_Down;
 
         default:
-            wxFAIL_MSG(_T("unknown arrow direction"));
+            wxFAIL_MSG(wxT("unknown arrow direction"));
     }
 
     return Arrow_Max;
@@ -413,13 +413,17 @@ void wxStdRenderer::DrawBorder(wxDC& dc,
     switch ( border )
     {
         case wxBORDER_SUNKEN:
+        case wxBORDER_THEME:
             DrawSunkenBorder(dc, &rect);
             break;
 
+        // wxBORDER_DOUBLE and wxBORDER_THEME are currently the same value.
+#if 0
         case wxBORDER_DOUBLE:
             DrawAntiSunkenBorder(dc, &rect);
             DrawExtraBorder(dc, &rect);
             break;
+#endif
 
         case wxBORDER_STATIC:
             DrawStaticBorder(dc, &rect);
@@ -434,7 +438,7 @@ void wxStdRenderer::DrawBorder(wxDC& dc,
             break;
 
         default:
-            wxFAIL_MSG(_T("unknown border type"));
+            wxFAIL_MSG(wxT("unknown border type"));
             // fall through
 
         case wxBORDER_DEFAULT:
@@ -458,15 +462,16 @@ wxRect wxStdRenderer::GetBorderDimensions(wxBorder border) const
 
         case wxBORDER_RAISED:
         case wxBORDER_SUNKEN:
+        case wxBORDER_THEME:
             width = 2;
             break;
-
+#if 0
         case wxBORDER_DOUBLE:
             width = 3;
             break;
-
+#endif
         default:
-            wxFAIL_MSG(_T("unknown border type"));
+            wxFAIL_MSG(wxT("unknown border type"));
             // fall through
 
         case wxBORDER_DEFAULT:
@@ -673,9 +678,10 @@ void wxStdRenderer::DrawCheckButton(wxDC& dc,
                                     wxAlignment align,
                                     int indexAccel)
 {
-    wxBitmap bmp(bitmap.Ok() ? bitmap : GetCheckBitmap(flags));
-
-    DrawCheckOrRadioButton(dc, label, bmp, rect, flags, align, indexAccel);
+    if (bitmap.Ok())
+        DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel);
+    else
+        DrawCheckOrRadioButton(dc, label, GetCheckBitmap(flags), rect, flags, align, indexAccel);
 }
 
 void wxStdRenderer::DrawRadioButton(wxDC& dc,
@@ -686,9 +692,11 @@ void wxStdRenderer::DrawRadioButton(wxDC& dc,
                                     wxAlignment align,
                                     int indexAccel)
 {
-    wxBitmap bmp(bitmap.Ok() ? bitmap : GetRadioBitmap(flags));
+    if (bitmap.Ok())
+        DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel);
+    else
+        DrawCheckOrRadioButton(dc, label, GetRadioBitmap(flags), rect, flags, align, indexAccel);
 
-    DrawCheckOrRadioButton(dc, label, bmp, rect, flags, align, indexAccel);
 }
 
 void wxStdRenderer::DrawCheckOrRadioButton(wxDC& dc,
@@ -854,7 +862,7 @@ wxSize wxStdRenderer::GetStatusBarBorders() const
     wxRect flat = GetBorderDimensions(wxBORDER_STATIC);
     wxASSERT_MSG( raised.x == raised.width && raised.y == raised.height &&
                   flat.x == flat.width && flat.y == flat.height,
-                  _T("this code expects uniform borders, you must override GetStatusBarBorders") );
+                  wxT("this code expects uniform borders, you must override GetStatusBarBorders") );
 
     // take the larger of flat/raised values:
     wxSize border(wxMax(raised.x, flat.x), wxMax(raised.y, flat.y));
@@ -884,6 +892,8 @@ void wxStdRenderer::DrawStatusField(wxDC& dc,
         DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rectIn);
     else if ( style != wxSB_FLAT )
         DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn);
+    else
+        rectIn = rect;
 
     rectIn.Deflate(GetStatusBarFieldMargins());