]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
Fix [ 1574240 ] wx.RadioButton doesn't navigate correctly
[wxWidgets.git] / src / common / appbase.cpp
index efc2c45cbdd055868d09595d805eeff3bbf23ebe..d727ffeafd9ae47d05640d0585143bd0ab87a15b 100644 (file)
 #endif
 
 #ifndef WX_PRECOMP
+    #ifdef __WXMSW__
+        #include  "wx/msw/wrapwin.h"  // includes windows.h for MessageBox()
+    #endif
     #include "wx/list.h"
     #include "wx/app.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
-#include "wx/utils.h"
 #include "wx/apptrait.h"
 #include "wx/cmdline.h"
 #include "wx/confbase.h"
   #include  <signal.h>      // for SIGTRAP used by wxTrap()
 #endif  //Win/Unix
 
-#if defined(__WXMSW__)
-  #include  "wx/msw/wrapwin.h"  // includes windows.h for MessageBox()
-#endif
-
 #if wxUSE_FONTMAP
     #include "wx/fontmap.h"
 #endif // wxUSE_FONTMAP
@@ -216,6 +215,24 @@ void wxAppConsole::Exit()
     exit(-1);
 }
 
+wxLayoutDirection wxAppConsole::GetLayoutDirection() const
+{
+#if wxUSE_INTL
+    const wxLocale *const locale = wxGetLocale();
+    if ( locale )
+    {
+        const wxLanguageInfo *const
+            info = wxLocale::GetLanguageInfo(locale->GetLanguage());
+
+        if ( info )
+            return info->LayoutDirection;
+    }
+#endif // wxUSE_INTL
+
+    // we don't know
+    return wxLayout_Default;
+}
+
 // ----------------------------------------------------------------------------
 // traits stuff
 // ----------------------------------------------------------------------------
@@ -281,6 +298,15 @@ void wxAppConsole::ProcessPendingEvents()
 
     // iterate until the list becomes empty
     wxList::compatibility_iterator node = wxPendingEvents->GetFirst();
+    
+    while (node && 
+           ((wxEvtHandler *)node->GetData())->IsEventHandlingInProgress() &&
+           ((wxEvtHandler *)node->GetData())->IsReentranceAllowed() == false)
+    {   
+        // skip over event
+        node = node->GetNext();
+    }
+    
     while (node)
     {
         wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
@@ -295,6 +321,14 @@ void wxAppConsole::ProcessPendingEvents()
         wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
         node = wxPendingEvents->GetFirst();
+        
+        while (node && 
+               ((wxEvtHandler *)node->GetData())->IsEventHandlingInProgress() &&
+               ((wxEvtHandler *)node->GetData())->IsReentranceAllowed() == false)
+        {   
+            // skip over event
+            node = node->GetNext();
+        }
     }
 
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );