]> git.saurik.com Git - wxWidgets.git/commitdiff
small mods to tree ctrl
authorRobert Roebling <robert@roebling.de>
Thu, 15 Apr 1999 19:10:29 +0000 (19:10 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 15 Apr 1999 19:10:29 +0000 (19:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/minimal/minimal.cpp
src/generic/treectrl.cpp

index 978db2a25476b94343ae71715c8621575ade4ce3..88f56481111280f37d2c967aa2a0583e4cf723d7 100644 (file)
@@ -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 );
 }
 
 
index 804148c710fcd255cbfcdfa035135520431ec485..0322373916e171f95508746149223dbfaba9ef40 100644 (file)
@@ -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))
     {