From 5679f3353ca517404f6f55178388e92930e312d4 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 15 Apr 1999 19:10:29 +0000 Subject: [PATCH] small mods to tree ctrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/minimal/minimal.cpp | 2 ++ src/generic/treectrl.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 978db2a254..88f5648111 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -165,6 +165,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText("Welcome to wxWindows!"); + +// SetSizeHints( size.x, size.y, size.x, size.y ); } diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 804148c710..0322373916 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -287,6 +287,7 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point, if ((point.y > m_y) && (point.y < m_y + m_height)) { // FIXME why +5? + // Because that is the size of the plus sign, RR if ((point.x > m_xCross-5) && (point.x < m_xCross+5) && (point.y > m_yCross-5) && (point.y < m_yCross+5) && (IsExpanded() || HasPlus())) @@ -295,8 +296,10 @@ wxGenericTreeItem *wxGenericTreeItem::HitTest( const wxPoint& point, return this; } + /* TODO: we should do a query here like + m_imageListNormal->GetSize( item->GetImage(), image_w, image_h ); */ int w = m_width; - if (m_image != -1) w += 20; + if (m_image != -1) w += 24; if ((point.x > m_x) && (point.x < m_x+w)) { @@ -1113,7 +1116,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) int total_h = (image_h > text_h) ? image_h : text_h; if(m_lineHeight > total_h) total_h = m_lineHeight; - dc.DrawRectangle( item->GetX()-2, item->GetY(), image_w+text_w+2, total_h ); + dc.DrawRectangle( item->GetX()-2, item->GetY(), image_w+text_w+4, total_h ); if ((item->IsExpanded()) && (item->GetSelectedImage() != -1)) { -- 2.45.2