]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
added conversion to mac native filenames from local filesystem handler
[wxWidgets.git] / src / generic / treectlg.cpp
index f2b3ca9dde89d3af36e5720f41b46d284d60b949..cb51d15b54e54b16e2044202b374bdd09376395a 100644 (file)
@@ -2018,7 +2018,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
             wxTRANSPARENT_PEN;
 
         wxColour colText;
-        if (item->IsSelected() && m_hasFocus)
+        if ( item->IsSelected() )
         {
             colText = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
         }
@@ -2183,7 +2183,11 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
     wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
     te.m_code = (int)event.KeyCode();
     te.SetEventObject( this );
-    GetEventHandler()->ProcessEvent( te );
+    if ( GetEventHandler()->ProcessEvent( te ) )
+    {
+        // intercepted by the user code
+        return;
+    }
 
     if ( (m_current == 0) || (m_key_current == 0) )
     {
@@ -2727,23 +2731,23 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
                 m_renameTimer->Stop();
                 m_lastOnSame = FALSE;
 
-                if (item->HasPlus())
+                // send activate event first
+                wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
+                nevent.m_item = (long) item;
+                nevent.m_code = 0;
+                CalcScrolledPosition(x, y,
+                                     &nevent.m_pointDrag.x,
+                                     &nevent.m_pointDrag.y);
+                nevent.SetEventObject( this );
+                if ( !GetEventHandler()->ProcessEvent( nevent ) )
                 {
-                    // for a "directory" node, toggle expansion
-                    Toggle(item);
-                }
-                else
-                {
-                    // for a "file" node, activate it
-                    wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
-                                        GetId() );
-                    nevent.m_item = (long) item;
-                    nevent.m_code = 0;
-                    CalcScrolledPosition(x, y,
-                                         &nevent.m_pointDrag.x,
-                                         &nevent.m_pointDrag.y);
-                    nevent.SetEventObject( this );
-                    GetEventHandler()->ProcessEvent( nevent );
+                    // if the user code didn't process the activate event,
+                    // handle it ourselves by toggling the item when it is
+                    // double clicked
+                    if ( item->HasPlus() )
+                    {
+                        Toggle(item);
+                    }
                 }
             }
         }