]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed and refactored wxPropertyGridManager decsription text box painting
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 7 Feb 2009 13:35:26 +0000 (13:35 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 7 Feb 2009 13:35:26 +0000 (13:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/manager.h
src/propgrid/manager.cpp

index de264eecae932fb2f900ece5edae93bf29a8f811..f0addd43ed8672d1d2a05a39590a6c3ba89f2998 100644 (file)
@@ -722,11 +722,10 @@ protected:
 
     void UpdateDescriptionBox( int new_splittery, int new_width, int new_height );
 
-    void RepaintSplitter( wxDC& dc,
-                          int new_splittery,
-                          int new_width,
-                          int new_height,
-                          bool desc_too );
+    void RepaintDescBoxDecorations( wxDC& dc,
+                                    int newSplitterY,
+                                    int newWidth,
+                                    int newHeight );
 
     void SetDescribedProperty( wxPGProperty* p );
 
index e3487b5c80599a71e6e30e9636305980b97b02eb..d844503d3899f916ab129246cf0208b41646e91f 100644 (file)
@@ -981,26 +981,24 @@ bool wxPropertyGridManager::ProcessEvent( wxEvent& event )
 
 // -----------------------------------------------------------------------
 
-void wxPropertyGridManager::RepaintSplitter( wxDC& dc, int new_splittery, int new_width,
-                                             int new_height, bool desc_too )
+void wxPropertyGridManager::RepaintDescBoxDecorations( wxDC& dc,
+                                                       int newSplitterY,
+                                                       int newWidth,
+                                                       int newHeight )
 {
-    int use_hei = new_height;
-
     // Draw background
     wxColour bgcol = GetBackgroundColour();
-    dc.SetBrush( bgcol );
-    dc.SetPen( bgcol );
-    int rect_hei = use_hei-new_splittery;
-    if ( !desc_too )
-        rect_hei = m_splitterHeight;
-    dc.DrawRectangle(0,new_splittery,new_width,rect_hei);
-    dc.SetPen ( wxSystemSettings::GetColour ( wxSYS_COLOUR_3DDKSHADOW ) );
-    int splitter_bottom = new_splittery+m_splitterHeight - 1;
-    int box_height = use_hei-splitter_bottom;
-    if ( box_height > 1 )
-        dc.DrawRectangle(0,splitter_bottom,new_width,box_height);
+    dc.SetBrush(bgcol);
+    dc.SetPen(bgcol);
+    int rectHeight = m_splitterHeight;
+    dc.DrawRectangle(0, newSplitterY, newWidth, rectHeight);
+    dc.SetPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW) );
+    int splitterBottom = newSplitterY + m_splitterHeight - 1;
+    int boxHeight = newHeight - splitterBottom;
+    if ( boxHeight > 1 )
+        dc.DrawRectangle(0, splitterBottom, newWidth, boxHeight);
     else
-        dc.DrawLine(0,splitter_bottom,new_width,splitter_bottom);
+        dc.DrawLine(0, splitterBottom, newWidth, splitterBottom);
 }
 
 // -----------------------------------------------------------------------
@@ -1143,11 +1141,9 @@ void wxPropertyGridManager::OnPaint( wxPaintEvent& WXUNUSED(event) )
     // Update everything inside the box
     wxRect r = GetUpdateRegion().GetBox();
 
-    // Repaint splitter?
-    int r_bottom = r.y + r.height;
-    int splitter_bottom = m_splitterY + m_splitterHeight;
-    if ( r.y < splitter_bottom && r_bottom >= m_splitterY )
-        RepaintSplitter( dc, m_splitterY, m_width, m_height, false );
+    // Repaint splitter and any other description box decorations
+    if ( (r.y + r.height) >= m_splitterY )
+        RepaintDescBoxDecorations( dc, m_splitterY, m_width, m_height );
 }
 
 // -----------------------------------------------------------------------