]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed unused param warning and code cleanup/simplification in DrawItemSelectionRect()
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Apr 2006 18:00:52 +0000 (18:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Apr 2006 18:00:52 +0000 (18:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/renderg.cpp

index 2c07be9d820ed1c87bf29455df38d3d1d907fd94..217cbbf19daf8fcbacf5033a2ecd4e6a09eb8d33 100644 (file)
@@ -92,7 +92,7 @@ public:
                                        wxDC& dc,
                                        const wxRect& rect,
                                        int flags = 0);
-                                       
+
     virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
 
     virtual wxRendererVersion GetVersion() const
@@ -401,7 +401,7 @@ wxRendererGeneric::DrawDropArrow(wxWindow *win,
     dc.DrawPolygon(WXSIZEOF(pt), pt, rect.x, rect.y);
 }
 
-void 
+void
 wxRendererGeneric::DrawCheckButton(wxWindow *WXUNUSED(win),
                                    wxDC& dc,
                                    const wxRect& rect,
@@ -433,49 +433,33 @@ wxRendererGeneric::DrawPushButton(wxWindow *win,
     dc.DrawRectangle(rect);
 }
 
-void 
-wxRendererGeneric::DrawItemSelectionRect(wxWindow *win,
-                                       wxDC& dc,
-                                       const wxRect& rect,
-                                       int flags )
+void
+wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win),
+                                         wxDC& dc,
+                                         const wxRect& rect,
+                                         int flags)
 {
-    if (flags & wxCONTROL_SELECTED)
+    wxBrush brush;
+    if ( flags & wxCONTROL_SELECTED )
     {
-        if (flags & wxCONTROL_FOCUSED)
+        if ( flags & wxCONTROL_FOCUSED )
         {
-            wxBrush brush( 
-                            wxSystemSettings::GetColour
-                            (
-                                wxSYS_COLOUR_HIGHLIGHT
-                            ),
-                            wxSOLID
-                        );
-            dc.SetBrush( brush );
+            brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
         }
-        else
+        else // !focused
         {
-            wxBrush brush( 
-                            wxSystemSettings::GetColour
-                            (
-                                wxSYS_COLOUR_BTNSHADOW
-                            ),
-                            wxSOLID
-                        );
-            dc.SetBrush( brush );
+            brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
         }
     }
-    else
+    else // !selected
     {
-        dc.SetBrush( *wxTRANSPARENT_BRUSH );
+        brush = *wxTRANSPARENT_BRUSH;
     }
-    
-    
-    if (flags & wxCONTROL_CURRENT)
-        dc.SetPen( *wxBLACK_PEN );
-    else
-        dc.SetPen( *wxTRANSPARENT_PEN );
-        
-    dc.DrawRectangle( rect );    
+
+    dc.SetBrush(brush);
+    dc.SetPen(flags & wxCONTROL_CURRENT ? *wxBLACK_PEN : *wxTRANSPARENT_PEN);
+
+    dc.DrawRectangle( rect );
 }