]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode compilation fixes.
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 12 Jun 2005 12:12:21 +0000 (12:12 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 12 Jun 2005 12:12:21 +0000 (12:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/app.cpp
src/os2/bitmap.cpp
src/os2/font.cpp
src/os2/iniconf.cpp
src/os2/menu.cpp
src/os2/menuitem.cpp
src/os2/utils.cpp
src/os2/utilsexc.cpp
src/os2/window.cpp

index 7193a4379ed6f1d1870304f0162ee1b48d1b04c7..33d8af6bbffa46d9f1ce2ea8e058bfc9788c5be0 100644 (file)
@@ -651,7 +651,7 @@ void wxApp::WakeUpIdle()
             //
             // Should never happen
             //
-            wxLogLastError("PostMessage(WM_NULL)");
+            wxLogLastError(wxT("PostMessage(WM_NULL)"));
         }
     }
 } // end of wxWakeUpIdle
index 46b88b5eb8b26f47f4dbbf4fe8083246e9dbd309..341a87887f1956c206737847e35735c531186c63 100644 (file)
@@ -65,13 +65,13 @@ void wxBitmapRefData::Free()
 {
     if ( m_pSelectedInto )
     {
-        wxLogLastError("GpiDeleteBitmap(hbitmap)");
+        wxLogLastError(wxT("GpiDeleteBitmap(hbitmap)"));
     }
     if (m_hBitmap)
     {
         if (!::GpiDeleteBitmap((HBITMAP)m_hBitmap))
         {
-            wxLogLastError("GpiDeleteBitmap(hbitmap)");
+            wxLogLastError(wxT("GpiDeleteBitmap(hbitmap)"));
         }
     }
     if (m_pBitmapMask)
@@ -186,7 +186,7 @@ wxBitmap::wxBitmap(
     hPs = ::GpiCreatePS(vHabmain, hDc, &vSize, GPIA_ASSOC | PU_PELS);
     if (hPs == 0)
     {
-        wxLogLastError("GpiCreatePS Failure");
+        wxLogLastError(wxT("GpiCreatePS Failure"));
     }
 
     if (nDepth == 1)
@@ -256,7 +256,7 @@ wxBitmap::wxBitmap(
 
     if (!hBmp)
     {
-        wxLogLastError("CreateBitmap");
+        wxLogLastError(wxT("CreateBitmap"));
     }
     ::GpiDestroyPS(hPs);
     ::DevCloseDC(hDc);
index dfa8111a51959434c5477941dd3f28e7a092bde6..cbb29b48a59d7eb35c22b53cf8f9b2a87768665c 100644 (file)
@@ -413,7 +413,7 @@ bool wxFontRefData::Alloc(
     {
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
-        wxLogLastError("CreateFont");
+        wxLogLastError(wxT("CreateFont"));
     }
 
     ::GpiSetCharSet(m_hPS, flId); // sets font for presentation space
index df53ce5f2139ca591c916be4468d6428b41dffb0..214defa20d016029101455fb2acab37f6fb1cdd4 100644 (file)
@@ -355,7 +355,7 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue)
 //                                       szValue, m_strLocalFilename) != 0;
 
   if ( !bOk )
-    wxLogLastError("WritePrivateProfileString");
+    wxLogLastError(wxT("WritePrivateProfileString"));
 
   return bOk;
 }
@@ -400,7 +400,7 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
 //                                       NULL, m_strLocalFilename) != 0;
 
   if ( !bOk )
-    wxLogLastError("WritePrivateProfileString");
+    wxLogLastError(wxT("WritePrivateProfileString"));
 
   return bOk;
 }
@@ -415,7 +415,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
   //                                     NULL, m_strLocalFilename) != 0;
 
   if ( !bOk )
-    wxLogLastError("WritePrivateProfileString");
+    wxLogLastError(wxT("WritePrivateProfileString"));
 
   return bOk;
 }
@@ -434,7 +434,7 @@ bool wxIniConfig::DeleteAll()
   size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
   if ( nRc == 0 )
   {
-    wxLogLastError("GetWindowsDirectory");
+    wxLogLastError(wxT("GetWindowsDirectory"));
   }
   else if ( nRc > WXSIZEOF(szBuf) )
   {
index ae9fb9d429af3a20db19015707764b59699c1797..c4567c4253d4ba0cd5e65c0e6befda30c6e2c0f6 100644 (file)
@@ -95,7 +95,7 @@ void wxMenu::Init()
                                       ,NULL
                                      )) == 0)
     {
-        wxLogLastError("WinLoadMenu");
+        wxLogLastError(wxT("WinLoadMenu"));
     }
     m_vMenuData.iPosition   = 0;
     m_vMenuData.afStyle     = MIS_SUBMENU | MIS_TEXT;
@@ -131,7 +131,7 @@ wxMenu::~wxMenu()
     {
         if (!::WinDestroyWindow((HWND)GetHmenu()) )
         {
-            wxLogLastError("WinDestroyWindow");
+            wxLogLastError(wxT("WinDestroyWindow"));
         }
     }
 
@@ -354,7 +354,7 @@ bool wxMenu::DoInsertOrAppend(
         vError = ::WinGetLastError(vHabmain);
         sError = wxPMErrorToStr(vError);
         wxLogError(wxT("Error inserting or appending a menuitem. Error: %s\n"), sError.c_str());
-        wxLogLastError("Insert or AppendMenu");
+        wxLogLastError(wxT("Insert or AppendMenu"));
         return FALSE;
     }
     else
@@ -562,7 +562,7 @@ void wxMenu::SetTitle(
         {
             if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
             {
-                wxLogLastError("SetMenuTitle");
+                wxLogLastError(wxT("SetMenuTitle"));
             }
         }
     }
@@ -583,7 +583,7 @@ void wxMenu::SetTitle(
             //
             if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
             {
-                wxLogLastError("SetMenuTitle");
+                wxLogLastError(wxT("SetMenuTitle"));
             }
         }
     }
@@ -769,7 +769,7 @@ WXHMENU wxMenuBar::Create()
                                       ,NULL
                                      )) == 0)
     {
-        wxLogLastError("WinLoadMenu");
+        wxLogLastError(wxT("WinLoadMenu"));
     }
     else
     {
@@ -840,7 +840,7 @@ void wxMenuBar::EnableTop(
     nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
     if (nId == MIT_ERROR)
     {
-        wxLogLastError("LogLastError");
+        wxLogLastError(wxT("LogLastError"));
         return;
     }
     ::WinSendMsg((HWND)m_hMenu, MM_SETITEMATTR, MPFROM2SHORT(nId, TRUE), MPFROM2SHORT(MIA_DISABLED, uFlag));
@@ -866,7 +866,7 @@ void wxMenuBar::SetLabelTop(
     nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
     if (nId == MIT_ERROR)
     {
-        wxLogLastError("LogLastError");
+        wxLogLastError(wxT("LogLastError"));
         return;
     }
     if(!::WinSendMsg( (HWND)m_hMenu
@@ -875,13 +875,13 @@ void wxMenuBar::SetLabelTop(
                      ,MPARAM(&vItem)
                     ))
     {
-        wxLogLastError("QueryItem");
+        wxLogLastError(wxT("QueryItem"));
     }
     nId = vItem.id;
 
     if (::WinSendMsg(GetHmenu(), MM_SETITEMTEXT, MPFROMSHORT(nId), (MPARAM)rLabel.c_str()));
     {
-        wxLogLastError("ModifyMenu");
+        wxLogLastError(wxT("ModifyMenu"));
     }
     Refresh();
 } // end of wxMenuBar::SetLabelTop
@@ -916,7 +916,7 @@ wxMenu* wxMenuBar::Replace(
     nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
     if (nId == MIT_ERROR)
     {
-        wxLogLastError("LogLastError");
+        wxLogLastError(wxT("LogLastError"));
         return NULL;
     }
     if (!pMenuOld)
@@ -1030,7 +1030,7 @@ wxMenu* wxMenuBar::Remove(
                                    );
     if (nId == MIT_ERROR)
     {
-        wxLogLastError("LogLastError");
+        wxLogLastError(wxT("LogLastError"));
         return NULL;
     }
     if (IsAttached())
@@ -1105,7 +1105,7 @@ void wxMenuBar::Attach(
                             ,m_vAccelTable.GetHACCEL()
                             ,(HWND)pFrame->GetFrame()
                            ))
-        wxLogLastError("WinSetAccelTable");
+        wxLogLastError(wxT("WinSetAccelTable"));
 #endif // wxUSE_ACCEL
 } // end of wxMenuBar::Attach
 
index 6b9a515788f3f0c23b3699b079999640cd171b8d..c02de983458150314ffaf529a01a9d74b0dcc10d 100644 (file)
@@ -260,7 +260,7 @@ void wxMenuItem::Enable(
                                 );
     if (!bOk)
     {
-        wxLogLastError("EnableMenuItem");
+        wxLogLastError(wxT("EnableMenuItem"));
     }
     wxMenuItemBase::Enable(bEnable);
 } // end of wxMenuItem::Enable
@@ -362,7 +362,7 @@ void wxMenuItem::Check(
     }
     if (!bOk)
     {
-        wxLogLastError("CheckMenuItem");
+        wxLogLastError(wxT("CheckMenuItem"));
     }
     wxMenuItemBase::Check(bCheck);
 } // end of wxMenuItem::Check
@@ -403,7 +403,7 @@ void wxMenuItem::SetText(
                       ,(MPARAM)&vItem
                      ))
     {
-        wxLogLastError("GetMenuState");
+        wxLogLastError(wxT("GetMenuState"));
     }
     else
     {
index a2f9dafe5ad45ad92ab0a7960eb69ba11c9c58cc..d77c05e60de94c53e12546bdf28a79f2f77f2907 100644 (file)
@@ -428,9 +428,11 @@ const wxChar* wxGetHomeDir(
 }
 
 // Hack for OS/2
-wxChar* wxGetUserHome (
-  const wxString&                   rUser
-)
+#if wxUSE_UNICODE
+const wxMB2WXbuf wxGetUserHome( const wxString &rUser )
+#else // just for binary compatibility -- there is no 'const' here
+wxChar* wxGetUserHome ( const wxString &rUser )
+#endif
 {
     wxChar*                         zHome;
     wxString                        sUser1(rUser);
@@ -465,9 +467,15 @@ wxChar* wxGetUserHome (
         {
             wxStrcpy(wxBuffer, zHome);
             wxUnix2DosFilename(wxBuffer);
+#if wxUSE_UNICODE
+           wxWCharBuffer retBuffer (wxBuffer);
+            delete[] wxBuffer;
+            return retBuffer;
+#else      
             wxStrcpy(zHome, wxBuffer);
             delete[] wxBuffer;
             return zHome;
+#endif
         }
     }
     delete[] wxBuffer;
index 3e9d94a0bfa67d25e54da9e04f8e58bdbc91343f..da80a3b2139f75c43ae089913e2eddee1f832cea 100644 (file)
@@ -88,7 +88,7 @@ static ULONG wxExecuteThread(
                          );
     if (ulRc != NO_ERROR)
     {
-        wxLogLastError("DosWaitChild");
+        wxLogLastError(wxT("DosWaitChild"));
     }
     delete pData;
     return 0;
@@ -195,7 +195,7 @@ long wxExecute(
                           );
     if (rc != NO_ERROR)
     {
-        wxLogLastError("CreateThread in wxExecute");
+        wxLogLastError(wxT("CreateThread in wxExecute"));
         delete pData;
 
         // the process still started up successfully...
index bac428084893af6ecdcde8ba139bc0fadc340e04..f5f5361c5a8d8968722142287265b6e12f295ea2 100644 (file)
@@ -3720,7 +3720,7 @@ bool wxWindowOS2::HandlePaint()
 
     if (::WinQueryUpdateRegion(GetHwnd(), hRgn) == RGN_ERROR)
     {
-         wxLogLastError("CreateRectRgn");
+         wxLogLastError(wxT("CreateRectRgn"));
          return FALSE;
     }