]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
ignore files produced by CodeWarrior
[wxWidgets.git] / src / generic / treectlg.cpp
index fe255add4ce93e15ea69d07fcd37a497ae7f9ace..2650eac81d69d983d4f94be744644f1b4768e1b9 100644 (file)
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-#pragma hdrstop
+    #pragma hdrstop
 #endif
 
+#if wxUSE_TREECTRL
+
 #include "wx/generic/treectlg.h"
 #include "wx/imaglist.h"
 #include "wx/settings.h"
@@ -663,9 +665,7 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, wxWindowID id,
     SetValidator( validator );
 #endif
 
-#ifndef __WXMAC__
     SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
-#endif
 
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
     m_dottedPen = wxPen( "grey", 0, 0 );
@@ -1485,6 +1485,17 @@ void wxGenericTreeCtrl::SelectItem(const wxTreeItemId& itemId,
     if ( GetEventHandler()->ProcessEvent( event ) && !event.IsAllowed() )
       return;
 
+    wxTreeItemId parent = GetParent( itemId );
+    while (parent.IsOk())
+    {
+        if (!IsExpanded(parent))
+            Expand( parent );
+            
+        parent = GetParent( parent );
+    }
+    
+    EnsureVisible( itemId );
+    
     // ctrl press
     if (unselect_others)
     {
@@ -1584,7 +1595,7 @@ void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item)
 
     int start_x = 0;
     int start_y = 0;
-    ViewStart( &start_x, &start_y );
+    GetViewStart( &start_x, &start_y );
     start_y *= PIXELS_PER_UNIT;
 
     int client_h = 0;
@@ -1841,7 +1852,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
     int exposed_x = dc.LogicalToDeviceX( 0 );
     int exposed_y = dc.LogicalToDeviceY( item->GetY() );
 
-    bool drawLines = (HasFlag(wxTR_NO_LINES) && !HasFlag(wxTR_MAC_BUTTONS));
+    bool drawLines = (!HasFlag(wxTR_NO_LINES) && !HasFlag(wxTR_MAC_BUTTONS));
 
     if (IsExposed( exposed_x, exposed_y, 10000, GetLineHeight(item) ))  // 10000 = very much
     {
@@ -1910,8 +1921,13 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
         {
             colText = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT );
 
+#ifdef __WXMAC__
+               // no rect outline, we already have the background color
+            pen = wxTRANSPARENT_PEN;
+#else
             if ( m_hasFocus )
                pen = wxBLACK_PEN;
+#endif
 
         }
         else
@@ -2743,3 +2759,4 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
     Refresh( TRUE, &rect );
 }
 
+#endif // wxUSE_TREECTRL