Generic tree control fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-08-04 15:23:28 +00:00
parent 941830cbe5
commit 233058c7ab
4 changed files with 48 additions and 5 deletions

View File

@@ -580,6 +580,15 @@ BEGIN_EVENT_TABLE(wxGenericTreeCtrl,wxScrolledWindow)
EVT_IDLE (wxGenericTreeCtrl::OnIdle)
END_EVENT_TABLE()
#if !defined(__WXMSW__) || defined(__WIN16__)
/*
* wxTreeCtrl has to be a real class or we have problems with
* the run-time information.
*/
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxGenericTreeCtrl)
#endif
// -----------------------------------------------------------------------------
// construction/destruction
// -----------------------------------------------------------------------------
@@ -1687,6 +1696,8 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
int exposed_x = dc.LogicalToDeviceX( 0 );
int exposed_y = dc.LogicalToDeviceY( item->GetY() );
bool drawLines = ((GetWindowStyle() & wxTR_NO_LINES) == 0);
if (IsExposed( exposed_x, exposed_y, 10000, GetLineHeight(item) )) // 10000 = very much
{
int startX = horizX;
@@ -1695,11 +1706,13 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
// if (!item->HasChildren()) endX += (m_indent+5);
if (!item->HasChildren()) endX += 20;
dc.DrawLine( startX, y, endX, y );
if (drawLines)
dc.DrawLine( startX, y, endX, y );
if (item->HasPlus())
{
dc.DrawLine( horizX+(m_indent+5), y, horizX+(m_indent+15), y );
if (drawLines)
dc.DrawLine( horizX+(m_indent+5), y, horizX+(m_indent+15), y );
dc.SetPen( *wxGREY_PEN );
dc.SetBrush( *wxWHITE_BRUSH );
dc.DrawRectangle( horizX+(m_indent-5), y-4, 11, 9 );
@@ -1766,7 +1779,8 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
if (count > 0)
{
semiOldY+=GetLineHeight(children[--n])/2;
dc.DrawLine( horizX+m_indent, oldY+5, horizX+m_indent, semiOldY );
if (drawLines)
dc.DrawLine( horizX+m_indent, oldY+5, horizX+m_indent, semiOldY );
}
}
}