]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Use GTK+ functions for wxDisplay implementation.
[wxWidgets.git] / src / generic / treectlg.cpp
index b88ba3851ab790f11308206035328c9fe4f3ff8b..70f6bfcd3c109f1fadcc2aa56933f1482c399331 100644 (file)
@@ -3076,6 +3076,21 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
     // end   : go to last item without opening parents
     // alnum : start or continue searching for the item with this prefix
     int keyCode = event.GetKeyCode();
+
+#ifdef __WXOSX__
+    // Make the keys work as they do in the native control:
+    // right => expand
+    // left => collapse if current item is expanded
+    if (keyCode == WXK_RIGHT)
+    {
+        keyCode = '+';
+    }
+    else if (keyCode == WXK_LEFT && IsExpanded(m_current))
+    {
+        keyCode = '-';
+    }
+#endif // __WXOSX__
+
     switch ( keyCode )
     {
         case '+':