Unicode compilation fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2005-06-12 12:12:21 +00:00
parent be283c77a0
commit 2173b18fc8
9 changed files with 40 additions and 32 deletions

View File

@@ -651,7 +651,7 @@ void wxApp::WakeUpIdle()
// //
// Should never happen // Should never happen
// //
wxLogLastError("PostMessage(WM_NULL)"); wxLogLastError(wxT("PostMessage(WM_NULL)"));
} }
} }
} // end of wxWakeUpIdle } // end of wxWakeUpIdle

View File

@@ -65,13 +65,13 @@ void wxBitmapRefData::Free()
{ {
if ( m_pSelectedInto ) if ( m_pSelectedInto )
{ {
wxLogLastError("GpiDeleteBitmap(hbitmap)"); wxLogLastError(wxT("GpiDeleteBitmap(hbitmap)"));
} }
if (m_hBitmap) if (m_hBitmap)
{ {
if (!::GpiDeleteBitmap((HBITMAP)m_hBitmap)) if (!::GpiDeleteBitmap((HBITMAP)m_hBitmap))
{ {
wxLogLastError("GpiDeleteBitmap(hbitmap)"); wxLogLastError(wxT("GpiDeleteBitmap(hbitmap)"));
} }
} }
if (m_pBitmapMask) if (m_pBitmapMask)
@@ -186,7 +186,7 @@ wxBitmap::wxBitmap(
hPs = ::GpiCreatePS(vHabmain, hDc, &vSize, GPIA_ASSOC | PU_PELS); hPs = ::GpiCreatePS(vHabmain, hDc, &vSize, GPIA_ASSOC | PU_PELS);
if (hPs == 0) if (hPs == 0)
{ {
wxLogLastError("GpiCreatePS Failure"); wxLogLastError(wxT("GpiCreatePS Failure"));
} }
if (nDepth == 1) if (nDepth == 1)
@@ -256,7 +256,7 @@ wxBitmap::wxBitmap(
if (!hBmp) if (!hBmp)
{ {
wxLogLastError("CreateBitmap"); wxLogLastError(wxT("CreateBitmap"));
} }
::GpiDestroyPS(hPs); ::GpiDestroyPS(hPs);
::DevCloseDC(hDc); ::DevCloseDC(hDc);

View File

@@ -413,7 +413,7 @@ bool wxFontRefData::Alloc(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogLastError("CreateFont"); wxLogLastError(wxT("CreateFont"));
} }
::GpiSetCharSet(m_hPS, flId); // sets font for presentation space ::GpiSetCharSet(m_hPS, flId); // sets font for presentation space

View File

@@ -355,7 +355,7 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue)
// szValue, m_strLocalFilename) != 0; // szValue, m_strLocalFilename) != 0;
if ( !bOk ) if ( !bOk )
wxLogLastError("WritePrivateProfileString"); wxLogLastError(wxT("WritePrivateProfileString"));
return bOk; return bOk;
} }
@@ -400,7 +400,7 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
// NULL, m_strLocalFilename) != 0; // NULL, m_strLocalFilename) != 0;
if ( !bOk ) if ( !bOk )
wxLogLastError("WritePrivateProfileString"); wxLogLastError(wxT("WritePrivateProfileString"));
return bOk; return bOk;
} }
@@ -415,7 +415,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
// NULL, m_strLocalFilename) != 0; // NULL, m_strLocalFilename) != 0;
if ( !bOk ) if ( !bOk )
wxLogLastError("WritePrivateProfileString"); wxLogLastError(wxT("WritePrivateProfileString"));
return bOk; return bOk;
} }
@@ -434,7 +434,7 @@ bool wxIniConfig::DeleteAll()
size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 ) if ( nRc == 0 )
{ {
wxLogLastError("GetWindowsDirectory"); wxLogLastError(wxT("GetWindowsDirectory"));
} }
else if ( nRc > WXSIZEOF(szBuf) ) else if ( nRc > WXSIZEOF(szBuf) )
{ {

View File

@@ -95,7 +95,7 @@ void wxMenu::Init()
,NULL ,NULL
)) == 0) )) == 0)
{ {
wxLogLastError("WinLoadMenu"); wxLogLastError(wxT("WinLoadMenu"));
} }
m_vMenuData.iPosition = 0; m_vMenuData.iPosition = 0;
m_vMenuData.afStyle = MIS_SUBMENU | MIS_TEXT; m_vMenuData.afStyle = MIS_SUBMENU | MIS_TEXT;
@@ -131,7 +131,7 @@ wxMenu::~wxMenu()
{ {
if (!::WinDestroyWindow((HWND)GetHmenu()) ) if (!::WinDestroyWindow((HWND)GetHmenu()) )
{ {
wxLogLastError("WinDestroyWindow"); wxLogLastError(wxT("WinDestroyWindow"));
} }
} }
@@ -354,7 +354,7 @@ bool wxMenu::DoInsertOrAppend(
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError(wxT("Error inserting or appending a menuitem. Error: %s\n"), sError.c_str()); 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; return FALSE;
} }
else else
@@ -562,7 +562,7 @@ void wxMenu::SetTitle(
{ {
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str())) 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())) if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{ {
wxLogLastError("SetMenuTitle"); wxLogLastError(wxT("SetMenuTitle"));
} }
} }
} }
@@ -769,7 +769,7 @@ WXHMENU wxMenuBar::Create()
,NULL ,NULL
)) == 0) )) == 0)
{ {
wxLogLastError("WinLoadMenu"); wxLogLastError(wxT("WinLoadMenu"));
} }
else else
{ {
@@ -840,7 +840,7 @@ void wxMenuBar::EnableTop(
nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0)); nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
if (nId == MIT_ERROR) if (nId == MIT_ERROR)
{ {
wxLogLastError("LogLastError"); wxLogLastError(wxT("LogLastError"));
return; return;
} }
::WinSendMsg((HWND)m_hMenu, MM_SETITEMATTR, MPFROM2SHORT(nId, TRUE), MPFROM2SHORT(MIA_DISABLED, uFlag)); ::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)); nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
if (nId == MIT_ERROR) if (nId == MIT_ERROR)
{ {
wxLogLastError("LogLastError"); wxLogLastError(wxT("LogLastError"));
return; return;
} }
if(!::WinSendMsg( (HWND)m_hMenu if(!::WinSendMsg( (HWND)m_hMenu
@@ -875,13 +875,13 @@ void wxMenuBar::SetLabelTop(
,MPARAM(&vItem) ,MPARAM(&vItem)
)) ))
{ {
wxLogLastError("QueryItem"); wxLogLastError(wxT("QueryItem"));
} }
nId = vItem.id; nId = vItem.id;
if (::WinSendMsg(GetHmenu(), MM_SETITEMTEXT, MPFROMSHORT(nId), (MPARAM)rLabel.c_str())); if (::WinSendMsg(GetHmenu(), MM_SETITEMTEXT, MPFROMSHORT(nId), (MPARAM)rLabel.c_str()));
{ {
wxLogLastError("ModifyMenu"); wxLogLastError(wxT("ModifyMenu"));
} }
Refresh(); Refresh();
} // end of wxMenuBar::SetLabelTop } // end of wxMenuBar::SetLabelTop
@@ -916,7 +916,7 @@ wxMenu* wxMenuBar::Replace(
nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0)); nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
if (nId == MIT_ERROR) if (nId == MIT_ERROR)
{ {
wxLogLastError("LogLastError"); wxLogLastError(wxT("LogLastError"));
return NULL; return NULL;
} }
if (!pMenuOld) if (!pMenuOld)
@@ -1030,7 +1030,7 @@ wxMenu* wxMenuBar::Remove(
); );
if (nId == MIT_ERROR) if (nId == MIT_ERROR)
{ {
wxLogLastError("LogLastError"); wxLogLastError(wxT("LogLastError"));
return NULL; return NULL;
} }
if (IsAttached()) if (IsAttached())
@@ -1105,7 +1105,7 @@ void wxMenuBar::Attach(
,m_vAccelTable.GetHACCEL() ,m_vAccelTable.GetHACCEL()
,(HWND)pFrame->GetFrame() ,(HWND)pFrame->GetFrame()
)) ))
wxLogLastError("WinSetAccelTable"); wxLogLastError(wxT("WinSetAccelTable"));
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
} // end of wxMenuBar::Attach } // end of wxMenuBar::Attach

View File

@@ -260,7 +260,7 @@ void wxMenuItem::Enable(
); );
if (!bOk) if (!bOk)
{ {
wxLogLastError("EnableMenuItem"); wxLogLastError(wxT("EnableMenuItem"));
} }
wxMenuItemBase::Enable(bEnable); wxMenuItemBase::Enable(bEnable);
} // end of wxMenuItem::Enable } // end of wxMenuItem::Enable
@@ -362,7 +362,7 @@ void wxMenuItem::Check(
} }
if (!bOk) if (!bOk)
{ {
wxLogLastError("CheckMenuItem"); wxLogLastError(wxT("CheckMenuItem"));
} }
wxMenuItemBase::Check(bCheck); wxMenuItemBase::Check(bCheck);
} // end of wxMenuItem::Check } // end of wxMenuItem::Check
@@ -403,7 +403,7 @@ void wxMenuItem::SetText(
,(MPARAM)&vItem ,(MPARAM)&vItem
)) ))
{ {
wxLogLastError("GetMenuState"); wxLogLastError(wxT("GetMenuState"));
} }
else else
{ {

View File

@@ -428,9 +428,11 @@ const wxChar* wxGetHomeDir(
} }
// Hack for OS/2 // Hack for OS/2
wxChar* wxGetUserHome ( #if wxUSE_UNICODE
const wxString& rUser const wxMB2WXbuf wxGetUserHome( const wxString &rUser )
) #else // just for binary compatibility -- there is no 'const' here
wxChar* wxGetUserHome ( const wxString &rUser )
#endif
{ {
wxChar* zHome; wxChar* zHome;
wxString sUser1(rUser); wxString sUser1(rUser);
@@ -465,9 +467,15 @@ wxChar* wxGetUserHome (
{ {
wxStrcpy(wxBuffer, zHome); wxStrcpy(wxBuffer, zHome);
wxUnix2DosFilename(wxBuffer); wxUnix2DosFilename(wxBuffer);
#if wxUSE_UNICODE
wxWCharBuffer retBuffer (wxBuffer);
delete[] wxBuffer;
return retBuffer;
#else
wxStrcpy(zHome, wxBuffer); wxStrcpy(zHome, wxBuffer);
delete[] wxBuffer; delete[] wxBuffer;
return zHome; return zHome;
#endif
} }
} }
delete[] wxBuffer; delete[] wxBuffer;

View File

@@ -88,7 +88,7 @@ static ULONG wxExecuteThread(
); );
if (ulRc != NO_ERROR) if (ulRc != NO_ERROR)
{ {
wxLogLastError("DosWaitChild"); wxLogLastError(wxT("DosWaitChild"));
} }
delete pData; delete pData;
return 0; return 0;
@@ -195,7 +195,7 @@ long wxExecute(
); );
if (rc != NO_ERROR) if (rc != NO_ERROR)
{ {
wxLogLastError("CreateThread in wxExecute"); wxLogLastError(wxT("CreateThread in wxExecute"));
delete pData; delete pData;
// the process still started up successfully... // the process still started up successfully...

View File

@@ -3720,7 +3720,7 @@ bool wxWindowOS2::HandlePaint()
if (::WinQueryUpdateRegion(GetHwnd(), hRgn) == RGN_ERROR) if (::WinQueryUpdateRegion(GetHwnd(), hRgn) == RGN_ERROR)
{ {
wxLogLastError("CreateRectRgn"); wxLogLastError(wxT("CreateRectRgn"));
return FALSE; return FALSE;
} }