]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
Support encodings in wxGTK_CONV_BACK() in the same way as we do it in
[wxWidgets.git] / src / common / containr.cpp
index 4f05ea60f21daa85073a1d12608426c69fc5c9dc..3333232ec59e31e61aa101a4d06750037aff463a 100644 (file)
@@ -68,18 +68,17 @@ bool wxControlContainer::AcceptsFocus() const
         while ( node )
         {
             wxWindow *child = node->GetData();
+            node = node->GetNext();
 
+#ifdef __WXMAC__
+            if ( m_winParent->MacIsWindowScrollbar( child ) )
+                continue;
+            hasRealChildren = true ;
+#endif
             if ( child->AcceptsFocus() )
             {
                 return true;
             }
-
-#ifdef __WXMAC__
-            wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ;
-            if ( sb == NULL || !m_winParent->MacIsWindowScrollbar( sb ) )
-                hasRealChildren = true ;
-#endif
-            node = node->GetNext();
         }
 
 #ifdef __WXMAC__
@@ -308,8 +307,15 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
             }
         }
 
-        if ( bookctrl && bookctrl->GetEventHandler()->ProcessEvent(event) )
-            return;
+        if ( bookctrl )
+        {
+            // make sure that we don't bubble up the event again from the book
+            // control resulting in infinite recursion
+            wxNavigationKeyEvent eventCopy(event);
+            eventCopy.SetEventObject(m_winParent);
+            if ( bookctrl->GetEventHandler()->ProcessEvent(eventCopy) )
+                return;
+        }
     }
 
     // there is not much to do if we don't have children and we're not
@@ -637,7 +643,13 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
     while ( node )
     {
         wxWindow *child = node->GetData();
+        node = node->GetNext();
 
+#ifdef __WXMAC__
+        if ( child->GetParent()->MacIsWindowScrollbar( child ) )
+            continue;
+#endif
+        
         if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() )
         {
 #ifdef __WXMSW__
@@ -660,8 +672,6 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
             child->SetFocusFromKbd();
             return true;
         }
-
-        node = node->GetNext();
     }
 
     return false;