]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/containr.cpp
Better alphabetized the event handler macros
[wxWidgets.git] / src / common / containr.cpp
index a17f646fe5c0b36ac7906b60997df268e96cfade..5bfc812f78726e1ca91a3d7b2499191c7d657803 100644 (file)
@@ -291,25 +291,25 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
 
         wxWindow *child = node->GetData();
 
-#ifdef __WXMSW__
-        bool is_not_msw_rb = ! wxIsKindOf(m_winLastFocused,wxRadioButton);
+#if defined(__WXMSW__) && !defined(__PALMOS__)
+        bool is_not_msw_rb = !m_winLastFocused ||
+                                !wxIsKindOf(m_winLastFocused,wxRadioButton);
 #else
-        bool is_not_msw_rb = true;
+        static const bool is_not_msw_rb = true;
 #endif
 
-        if ( child->AcceptsFocusFromKeyboard() && is_not_msw_rb)
+        if ( child->AcceptsFocusFromKeyboard() && is_not_msw_rb )
         {
             // if we're setting the focus to a child panel we should prevent it
             // from giving it to the child which had the focus the last time
             // and instead give it to the first/last child depending from which
             // direction we're coming
             event.SetEventObject(m_winParent);
-            
-#ifdef __WXMSW__
+
+#if defined(__WXMSW__) && !defined(__PALMOS__)
             // we need to hop to the next activated
             // radio button, not just the next radio
-            // button under MSW 
+            // button under MSW
             if (wxIsKindOf(child,wxRadioButton))
             {
                 wxRadioButton *rb = (wxRadioButton*) child;
@@ -318,19 +318,23 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
                     for (;;)
                     {
                         wxWindowList::compatibility_iterator node = children.Find( child );
-                        if (forward) 
+                        if (forward)
                             node = node->GetNext();
                         else
                             node = node->GetPrevious();
-                        if (!node) return; // this would probably an error
+                        if (!node)
+                            return; // this would probably an error
                         child = node->GetData();
-                        if (!wxIsKindOf(child,wxRadioButton)) continue;
+                        if (!wxIsKindOf(child,wxRadioButton))
+                            continue;
                         rb = (wxRadioButton*) child;
-                        if (rb->GetValue()) break;
+                        if (rb->GetValue())
+                            break;
                     }
                 }
             }
-#endif            
+#endif // __WXMSW__
+
             // disable propagation for this call as otherwise the event might
             // bounce back to us.
             wxPropagationDisabler disableProp(event);