Fixed wxPropertyGrid empty space rendering
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1944,7 +1944,7 @@ protected:
|
|||||||
void CorrectEditorWidgetPosY();
|
void CorrectEditorWidgetPosY();
|
||||||
|
|
||||||
int DoDrawItems( wxDC& dc,
|
int DoDrawItems( wxDC& dc,
|
||||||
const wxRect* clipRect,
|
const wxRect* drawRect,
|
||||||
bool isBuffered ) const;
|
bool isBuffered ) const;
|
||||||
|
|
||||||
/** Draws an expand/collapse (ie. +/-) button.
|
/** Draws an expand/collapse (ie. +/-) button.
|
||||||
|
@@ -1833,18 +1833,20 @@ void wxPropertyGrid::DrawExpanderButton( wxDC& dc, const wxRect& rect,
|
|||||||
void wxPropertyGrid::DrawItems( wxDC& dc,
|
void wxPropertyGrid::DrawItems( wxDC& dc,
|
||||||
unsigned int topy,
|
unsigned int topy,
|
||||||
unsigned int bottomy,
|
unsigned int bottomy,
|
||||||
const wxRect* clipRect )
|
const wxRect* drawRect )
|
||||||
{
|
{
|
||||||
if ( m_frozen || m_height < 1 || bottomy < topy || !m_pState )
|
if ( m_frozen || m_height < 1 || bottomy < topy || !m_pState )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_pState->EnsureVirtualHeight();
|
m_pState->EnsureVirtualHeight();
|
||||||
|
|
||||||
wxRect tempClipRect;
|
wxRect tempDrawRect;
|
||||||
if ( !clipRect )
|
if ( !drawRect )
|
||||||
{
|
{
|
||||||
tempClipRect = wxRect(0,topy,m_pState->m_width,bottomy);
|
tempDrawRect = wxRect(0, topy,
|
||||||
clipRect = &tempClipRect;
|
m_pState->m_width,
|
||||||
|
bottomy);
|
||||||
|
drawRect = &tempDrawRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
// items added check
|
// items added check
|
||||||
@@ -1864,7 +1866,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
|
|||||||
{
|
{
|
||||||
if ( !m_doubleBuffer )
|
if ( !m_doubleBuffer )
|
||||||
{
|
{
|
||||||
paintFinishY = clipRect->y;
|
paintFinishY = drawRect->y;
|
||||||
dcPtr = NULL;
|
dcPtr = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1882,26 +1884,29 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
|
|||||||
|
|
||||||
if ( dcPtr )
|
if ( dcPtr )
|
||||||
{
|
{
|
||||||
dc.SetClippingRegion( *clipRect );
|
dc.SetClippingRegion( *drawRect );
|
||||||
paintFinishY = DoDrawItems( *dcPtr, clipRect, isBuffered );
|
paintFinishY = DoDrawItems( *dcPtr, drawRect, isBuffered );
|
||||||
|
int drawBottomY = drawRect->y + drawRect->height;
|
||||||
|
|
||||||
// Clear area beyond bottomY?
|
// Clear area beyond bottomY?
|
||||||
if ( paintFinishY < (clipRect->y+clipRect->height) )
|
if ( paintFinishY < drawBottomY )
|
||||||
{
|
{
|
||||||
dcPtr->SetPen(m_colEmptySpace);
|
dcPtr->SetPen(m_colEmptySpace);
|
||||||
dcPtr->SetBrush(m_colEmptySpace);
|
dcPtr->SetBrush(m_colEmptySpace);
|
||||||
dcPtr->DrawRectangle( 0, paintFinishY, m_width,
|
dcPtr->DrawRectangle(0, paintFinishY,
|
||||||
(clipRect->y+clipRect->height) );
|
m_width,
|
||||||
|
drawBottomY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dc.DestroyClippingRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxPG_DOUBLE_BUFFER
|
#if wxPG_DOUBLE_BUFFER
|
||||||
if ( bufferDC )
|
if ( bufferDC )
|
||||||
{
|
{
|
||||||
dc.Blit( clipRect->x, clipRect->y, clipRect->width,
|
dc.Blit( drawRect->x, drawRect->y, drawRect->width,
|
||||||
clipRect->height,
|
drawRect->height,
|
||||||
bufferDC, 0, 0, wxCOPY );
|
bufferDC, 0, 0, wxCOPY );
|
||||||
dc.DestroyClippingRegion(); // Is this really necessary?
|
|
||||||
delete bufferDC;
|
delete bufferDC;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1911,7 +1916,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
|
|||||||
// Just clear the area
|
// Just clear the area
|
||||||
dc.SetPen(m_colEmptySpace);
|
dc.SetPen(m_colEmptySpace);
|
||||||
dc.SetBrush(m_colEmptySpace);
|
dc.SetBrush(m_colEmptySpace);
|
||||||
dc.DrawRectangle(*clipRect);
|
dc.DrawRectangle(*drawRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2384,7 +2389,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return y + yRelMod;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user