X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/253b70f1aa1a32096d295896855cef4c00ac768c..4e916e61ea24c165fb55e78172f1093bf7481b48:/src/propgrid/manager.cpp diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index cb2c519d70..096228ac54 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -657,6 +657,8 @@ wxPropertyGridPageState* wxPropertyGridManager::GetPageState( int page ) const void wxPropertyGridManager::Clear() { + m_pPropGrid->ClearSelection(false); + m_pPropGrid->Freeze(); int i; @@ -981,26 +983,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); } // ----------------------------------------------------------------------- @@ -1061,24 +1061,7 @@ void wxPropertyGridManager::RecalculatePositions( int width, int height ) #if wxUSE_TOOLBAR if ( m_pToolbar ) { - int tbHeight; - - #if ( wxMINOR_VERSION < 6 || (wxMINOR_VERSION == 6 && wxRELEASE_NUMBER < 2) ) - tbHeight = -1; - #else - // In wxWidgets 2.6.2+, Toolbar default height may be broken - #if defined(__WXMSW__) - tbHeight = 24; - #elif defined(__WXGTK__) - tbHeight = -1; // 22; - #elif defined(__WXMAC__) - tbHeight = 22; - #else - tbHeight = 22; - #endif - #endif - - m_pToolbar->SetSize(0,0,width,tbHeight); + m_pToolbar->SetSize(0, 0, width, -1); propgridY += m_pToolbar->GetSize().y; } #endif @@ -1160,11 +1143,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 ); } // ----------------------------------------------------------------------- @@ -1208,6 +1189,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 @@ -1499,7 +1481,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;