]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
update button style to include BS_MULTILINE when a multiline label is set
[wxWidgets.git] / src / common / appbase.cpp
index 119622bb8b164ae5d9c9fae44617dd027ffc0456..339fe276c4e5df373e25c1ac2cf50985c58bb67c 100644 (file)
@@ -330,16 +330,13 @@ bool wxAppConsoleBase::Dispatch()
 
 bool wxAppConsoleBase::HasPendingEvents() const
 {
-    // ensure that we're the only thread to modify the pending events list
     wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
-    if ( !wxPendingEvents )
-    {
-        wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
-        return false;
-    }
+    bool has = wxPendingEvents && !wxPendingEvents->IsEmpty();
+
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
-    return true;
+
+    return has;
 }
 
 /* static */
@@ -357,27 +354,27 @@ void wxAppConsoleBase::ProcessPendingEvents()
         return;
 #endif
 
-    if ( !HasPendingEvents() )
-        return;
-
     wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
-    // iterate until the list becomes empty
-    wxList::compatibility_iterator node = wxPendingEvents->GetFirst();
-    while (node)
+    if (wxPendingEvents)
     {
-        wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
-        wxPendingEvents->Erase(node);
+        // iterate until the list becomes empty
+        wxList::compatibility_iterator node = wxPendingEvents->GetFirst();
+        while (node)
+        {
+            wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
+            wxPendingEvents->Erase(node);
 
-        // In ProcessPendingEvents(), new handlers might be add
-        // and we can safely leave the critical section here.
-        wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
+            // In ProcessPendingEvents(), new handlers might be add
+            // and we can safely leave the critical section here.
+            wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
 
-        handler->ProcessPendingEvents();
+            handler->ProcessPendingEvents();
 
-        wxENTER_CRIT_SECT( *wxPendingEventsLocker );
+            wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
-        node = wxPendingEvents->GetFirst();
+            node = wxPendingEvents->GetFirst();
+        }
     }
 
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
@@ -668,7 +665,7 @@ GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable()
 #if wxUSE_INTL
 void wxAppTraitsBase::SetLocale()
 {
-    setlocale(LC_ALL, "");
+    wxSetlocale(LC_ALL, "");
     wxUpdateLocaleIsUtf8();
 }
 #endif