]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/manager.cpp
Converted wxVariant to use wxObject's reference counting facilities. Should make...
[wxWidgets.git] / src / propgrid / manager.cpp
index 025e7be8456877c47ed3717194c45757008065d9..444902899c880c5c32ae1bfeb7e99e8c8bd07ecf 100644 (file)
@@ -528,6 +528,18 @@ void wxPropertyGridManager::SetWindowStyleFlag( long style )
 
 // -----------------------------------------------------------------------
 
+bool wxPropertyGridManager::Reparent( wxWindowBase *newParent )
+{
+    if ( m_pPropGrid )
+        m_pPropGrid->OnTLPChanging((wxWindow*)newParent);
+
+    bool res = wxPanel::Reparent(newParent);
+
+    return res;
+}
+
+// -----------------------------------------------------------------------
+
 // Actually shows given page.
 bool wxPropertyGridManager::DoSelectPage( int index )
 {
@@ -657,6 +669,8 @@ wxPropertyGridPageState* wxPropertyGridManager::GetPageState( int page ) const
 
 void wxPropertyGridManager::Clear()
 {
+    m_pPropGrid->ClearSelection(false);
+
     m_pPropGrid->Freeze();
 
     int i;
@@ -981,26 +995,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 +1155,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 );
 }
 
 // -----------------------------------------------------------------------
@@ -1191,6 +1201,7 @@ void wxPropertyGridManager::RecreateControls()
                                        wxDefaultPosition,wxDefaultSize,
                                        ((GetExtraStyle()&wxPG_EX_NO_FLAT_TOOLBAR)?0:wxTB_FLAT)
                                         /*| wxTB_HORIZONTAL | wxNO_BORDER*/ );
+            m_pToolbar->SetToolBitmapSize(wxSize(16, 15));
 
         #if defined(__WXMSW__)
             // Eliminate toolbar flicker on XP
@@ -1482,7 +1493,7 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages )
     else
     {
         wxClientDC dc(this);
-        dc.SetFont(m_pPropGrid->m_font);
+        dc.SetFont(m_pPropGrid->GetFont());
 
         int highest = 0;
         unsigned int i;