]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
fixing the usage of hishape
[wxWidgets.git] / src / common / appbase.cpp
index 119622bb8b164ae5d9c9fae44617dd027ffc0456..0a33d3b00f966a95587b053b3565e47a33418c1b 100644 (file)
@@ -330,16 +330,13 @@ bool wxAppConsoleBase::Dispatch()
 
 bool wxAppConsoleBase::HasPendingEvents() const
 {
 
 bool wxAppConsoleBase::HasPendingEvents() const
 {
-    // ensure that we're the only thread to modify the pending events list
     wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
     wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
-    if ( !wxPendingEvents )
-    {
-        wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
-        return false;
-    }
+    bool has = wxPendingEvents && !wxPendingEvents->IsEmpty();
+
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
-    return true;
+
+    return has;
 }
 
 /* static */
 }
 
 /* static */
@@ -357,27 +354,27 @@ void wxAppConsoleBase::ProcessPendingEvents()
         return;
 #endif
 
         return;
 #endif
 
-    if ( !HasPendingEvents() )
-        return;
-
     wxENTER_CRIT_SECT( *wxPendingEventsLocker );
 
     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 );
     }
 
     wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
@@ -469,7 +466,7 @@ bool wxAppConsoleBase::OnExceptionInMainLoop()
 
 #if wxUSE_CMDLINE_PARSER
 
 
 #if wxUSE_CMDLINE_PARSER
 
-#define OPTION_VERBOSE _T("verbose")
+#define OPTION_VERBOSE "verbose"
 
 void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 {
 
 void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 {
@@ -478,8 +475,8 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
     {
         {
             wxCMD_LINE_SWITCH,
     {
         {
             wxCMD_LINE_SWITCH,
-            _T("h"),
-            _T("help"),
+            "h",
+            "help",
             gettext_noop("show this help message"),
             wxCMD_LINE_VAL_NONE,
             wxCMD_LINE_OPTION_HELP
             gettext_noop("show this help message"),
             wxCMD_LINE_VAL_NONE,
             wxCMD_LINE_OPTION_HELP
@@ -488,7 +485,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 #if wxUSE_LOG
         {
             wxCMD_LINE_SWITCH,
 #if wxUSE_LOG
         {
             wxCMD_LINE_SWITCH,
-            wxEmptyString,
+            NULL,
             OPTION_VERBOSE,
             gettext_noop("generate verbose log messages"),
             wxCMD_LINE_VAL_NONE,
             OPTION_VERBOSE,
             gettext_noop("generate verbose log messages"),
             wxCMD_LINE_VAL_NONE,
@@ -497,14 +494,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser)
 #endif // wxUSE_LOG
 
         // terminator
 #endif // wxUSE_LOG
 
         // terminator
-        {
-            wxCMD_LINE_NONE,
-            wxEmptyString,
-            wxEmptyString,
-            wxEmptyString,
-            wxCMD_LINE_VAL_NONE,
-            0x0
-        }
+        wxCMD_LINE_DESC_END
     };
 
     parser.SetDesc(cmdLineDesc);
     };
 
     parser.SetDesc(cmdLineDesc);
@@ -668,7 +658,7 @@ GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable()
 #if wxUSE_INTL
 void wxAppTraitsBase::SetLocale()
 {
 #if wxUSE_INTL
 void wxAppTraitsBase::SetLocale()
 {
-    setlocale(LC_ALL, "");
+    wxSetlocale(LC_ALL, "");
     wxUpdateLocaleIsUtf8();
 }
 #endif
     wxUpdateLocaleIsUtf8();
 }
 #endif
@@ -800,12 +790,6 @@ void wxTrap()
 {
 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
     DebugBreak();
 {
 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
     DebugBreak();
-#elif defined(__WXMAC__) && !defined(__DARWIN__)
-    #if __powerc
-        Debugger();
-    #else
-        SysBreak();
-    #endif
 #elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
     Debugger();
 #elif defined(__UNIX__)
 #elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
     Debugger();
 #elif defined(__UNIX__)
@@ -947,6 +931,7 @@ static void LINKAGEMODE SetTraceMasks()
 #endif // wxUSE_LOG
 }
 
 #endif // wxUSE_LOG
 }
 
+static
 bool DoShowAssertDialog(const wxString& msg)
 {
     // under MSW we can show the dialog even in the console mode
 bool DoShowAssertDialog(const wxString& msg)
 {
     // under MSW we can show the dialog even in the console mode