Unicode fixes for OS/2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2005-04-27 01:19:43 +00:00
parent 18ed8e0032
commit 0fba44b410
46 changed files with 243 additions and 241 deletions

View File

@@ -268,7 +268,7 @@ bool wxApp::RegisterWindowClasses(
wxString sError; wxString sError;
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxFrameClassName ,(PSZ)wxFrameClassName
,wxFrameWndProc ,wxFrameWndProc
,CS_SIZEREDRAW | CS_SYNCPAINT ,CS_SIZEREDRAW | CS_SYNCPAINT
,sizeof(ULONG) ,sizeof(ULONG)
@@ -281,7 +281,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxFrameClassNameNoRedraw ,(PSZ)wxFrameClassNameNoRedraw
,wxWndProc ,wxWndProc
,0 ,0
,sizeof(ULONG) ,sizeof(ULONG)
@@ -294,7 +294,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxMDIFrameClassName ,(PSZ)wxMDIFrameClassName
,wxWndProc ,wxWndProc
,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
,sizeof(ULONG) ,sizeof(ULONG)
@@ -307,7 +307,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxMDIFrameClassNameNoRedraw ,(PSZ)wxMDIFrameClassNameNoRedraw
,wxWndProc ,wxWndProc
,0 ,0
,sizeof(ULONG) ,sizeof(ULONG)
@@ -320,7 +320,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxMDIChildFrameClassName ,(PSZ)wxMDIChildFrameClassName
,wxWndProc ,wxWndProc
,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST
,sizeof(ULONG) ,sizeof(ULONG)
@@ -333,7 +333,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxMDIChildFrameClassNameNoRedraw ,(PSZ)wxMDIChildFrameClassNameNoRedraw
,wxWndProc ,wxWndProc
,CS_HITTEST ,CS_HITTEST
,sizeof(ULONG) ,sizeof(ULONG)
@@ -346,7 +346,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxPanelClassName ,(PSZ)wxPanelClassName
,wxWndProc ,wxWndProc
,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT
,sizeof(ULONG) ,sizeof(ULONG)
@@ -359,7 +359,7 @@ bool wxApp::RegisterWindowClasses(
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxCanvasClassName ,(PSZ)wxCanvasClassName
,wxWndProc ,wxWndProc
,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT ,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT
,sizeof(ULONG) ,sizeof(ULONG)
@@ -371,7 +371,7 @@ bool wxApp::RegisterWindowClasses(
return FALSE; return FALSE;
} }
if (!::WinRegisterClass( vHab if (!::WinRegisterClass( vHab
,wxCanvasClassNameNR ,(PSZ)wxCanvasClassNameNR
,wxWndProc ,wxWndProc
,CS_HITTEST | CS_SYNCPAINT ,CS_HITTEST | CS_SYNCPAINT
,sizeof(ULONG) ,sizeof(ULONG)

View File

@@ -860,7 +860,7 @@ wxImage wxBitmap::ConvertToImage() const
HBITMAP hOldBitmap; HBITMAP hOldBitmap;
DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L}; DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
SIZEL vSizlPage = {0,0}; SIZEL vSizlPage = {0,0};
HDC hDCMem; HDC hDCMem = NULLHANDLE;;
vImage.Create( nWidth vImage.Create( nWidth
,nHeight ,nHeight

View File

@@ -77,7 +77,7 @@ bool wxBitmapButton::Create(
m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent) m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent)
,WC_BUTTON ,WC_BUTTON
,wxT("") ,(PSZ)wxEmptyString
,ulOS2Style ,ulOS2Style
,0, 0, 0, 0 ,0, 0, 0, 0
,GetHwndOf(pParent) ,GetHwndOf(pParent)

View File

@@ -138,7 +138,7 @@ bool wxBrush::RealizeResource()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table to RGB mode. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
@@ -220,7 +220,7 @@ bool wxBrush::RealizeResource()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n", sError.c_str()); wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
} }
return bOk; return bOk;
} }

View File

@@ -106,7 +106,7 @@ void wxCheckBox::SetLabel(
const wxString& rsLabel const wxString& rsLabel
) )
{ {
::WinSetWindowText(GetHwnd(), rsLabel.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rsLabel.c_str());
} // end of wxCheckBox::SetLabel } // end of wxCheckBox::SetLabel
wxSize wxCheckBox::DoGetBestSize() const wxSize wxCheckBox::DoGetBestSize() const

View File

@@ -88,7 +88,7 @@ wxCheckListBoxItem::wxCheckListBoxItem (
wxCheckListBox* pParent wxCheckListBox* pParent
, size_t nIndex , size_t nIndex
) )
: wxOwnerDrawn( "" : wxOwnerDrawn( wxEmptyString
,TRUE // checkable ,TRUE // checkable
) )
{ {

View File

@@ -216,7 +216,7 @@ int wxChoice::FindString(
nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0)); nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
zStr = new char[nTextLength + 1]; zStr = new char[nTextLength + 1];
::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr); ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr);
if (rsStr == (char*)zStr) if (rsStr == (wxChar*)zStr)
{ {
delete [] zStr; delete [] zStr;
break; break;
@@ -268,13 +268,13 @@ wxString wxChoice::GetString(
) const ) const
{ {
int nLen = 0; int nLen = 0;
wxString sStr = ""; wxString sStr = wxEmptyString;
char* zBuf; wxChar* zBuf;
nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0)); nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
if (nLen != LIT_ERROR && nLen > 0) if (nLen != LIT_ERROR && nLen > 0)
{ {
zBuf = new char[nLen + 1]; zBuf = new wxChar[nLen + 1];
::WinSendMsg( GetHwnd() ::WinSendMsg( GetHwnd()
,LM_QUERYITEMTEXT ,LM_QUERYITEMTEXT
,MPFROM2SHORT((SHORT)n, (SHORT)nLen) ,MPFROM2SHORT((SHORT)n, (SHORT)nLen)
@@ -436,7 +436,7 @@ bool wxChoice::OS2Command(
vEvent.SetInt(n); vEvent.SetInt(n);
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
vEvent.SetString((char*)GetStringSelection().c_str()); vEvent.SetString(GetStringSelection());
if (HasClientObjectData()) if (HasClientObjectData())
vEvent.SetClientObject(GetClientObject(n)); vEvent.SetClientObject(GetClientObject(n));
else if (HasClientUntypedData()) else if (HasClientUntypedData())

View File

@@ -58,7 +58,7 @@ bool wxComboBox::OS2Command(
vEvent.SetInt(GetSelection()); vEvent.SetInt(GetSelection());
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
vEvent.SetString((char*)GetStringSelection().c_str()); vEvent.SetString(GetStringSelection());
ProcessCommand(vEvent); ProcessCommand(vEvent);
} }
break; break;
@@ -73,7 +73,7 @@ bool wxComboBox::OS2Command(
sValue = GetValue(); sValue = GetValue();
else else
SetValue(sValue); SetValue(sValue);
vEvent.SetString((char*)GetValue().c_str()); vEvent.SetString(GetValue());
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
ProcessCommand(vEvent); ProcessCommand(vEvent);
} }
@@ -147,7 +147,7 @@ bool wxComboBox::Create(
lSstyle |= CBS_DROPDOWN; lSstyle |= CBS_DROPDOWN;
if (!OS2CreateControl( "COMBOBOX" if (!OS2CreateControl( _T("COMBOBOX")
,lSstyle ,lSstyle
)) ))
return false; return false;
@@ -190,7 +190,7 @@ void wxComboBox::SetValue(
if ( HasFlag(wxCB_READONLY) ) if ( HasFlag(wxCB_READONLY) )
SetStringSelection(rsValue); SetStringSelection(rsValue);
else else
::WinSetWindowText(GetHwnd(), rsValue.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
} // end of wxComboBox::SetValue } // end of wxComboBox::SetValue
// //

View File

@@ -120,15 +120,15 @@ bool wxControl::OS2CreateControl(
if (!pParent) if (!pParent)
return FALSE; return FALSE;
if ((strcmp(zClassname, "COMBOBOX")) == 0) if ((wxStrcmp(zClassname, _T("COMBOBOX"))) == 0)
zClass = WC_COMBOBOX; zClass = WC_COMBOBOX;
else if ((strcmp(zClassname, "STATIC")) == 0) else if ((wxStrcmp(zClassname, _T("STATIC"))) == 0)
zClass = WC_STATIC; zClass = WC_STATIC;
else if ((strcmp(zClassname, "BUTTON")) == 0) else if ((wxStrcmp(zClassname, _T("BUTTON"))) == 0)
zClass = WC_BUTTON; zClass = WC_BUTTON;
else if ((strcmp(zClassname, "NOTEBOOK")) == 0) else if ((wxStrcmp(zClassname, _T("NOTEBOOK"))) == 0)
zClass = WC_NOTEBOOK; zClass = WC_NOTEBOOK;
else if ((strcmp(zClassname, "CONTAINER")) == 0) else if ((wxStrcmp(zClassname, _T("CONTAINER"))) == 0)
zClass = WC_CONTAINER; zClass = WC_CONTAINER;
dwStyle |= WS_VISIBLE; dwStyle |= WS_VISIBLE;
@@ -251,7 +251,7 @@ void wxControl::SetLabel(
{ {
wxString sLabel = ::wxPMTextToLabel(rsLabel); wxString sLabel = ::wxPMTextToLabel(rsLabel);
::WinSetWindowText(GetHwnd(), sLabel.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)sLabel.c_str());
} // end of wxControl::SetLabel } // end of wxControl::SetLabel
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@@ -47,12 +47,12 @@
wxString wxDataFormat::GetId() const wxString wxDataFormat::GetId() const
{ {
char zBuf[256]; wxChar zBuf[256];
wxString sRet; wxString sRet;
::WinQueryAtomName( ::WinQuerySystemAtomTable() ::WinQueryAtomName( ::WinQuerySystemAtomTable()
,m_uFormat ,m_uFormat
,zBuf ,(PSZ)zBuf
,256 ,256
); );
sRet = zBuf; sRet = zBuf;
@@ -64,7 +64,7 @@ void wxDataFormat::SetId (
) )
{ {
m_uFormat = ::WinAddAtom( ::WinQuerySystemAtomTable() m_uFormat = ::WinAddAtom( ::WinQuerySystemAtomTable()
,zId ,(PSZ)zId
); );
} // end of wxDataFormat::SetId } // end of wxDataFormat::SetId
@@ -261,7 +261,7 @@ bool wxFileDataObject::SetData(
{ {
/* TODO */ /* TODO */
wxString sFile( (const char *)pBuf); /* char, not wxChar */ wxString sFile((const wxChar *)pBuf); /* char, not wxChar */
AddFile(sFile); AddFile(sFile);

View File

@@ -2238,24 +2238,22 @@ void wxDC::DoGetTextExtent(
int l; int l;
FONTMETRICS vFM; // metrics structure FONTMETRICS vFM; // metrics structure
BOOL bRc; BOOL bRc;
char* pStr;
ERRORID vErrorCode; // last error id code ERRORID vErrorCode; // last error id code
wxFont* pFontToUse = (wxFont*)pTheFont; wxFont* pFontToUse = (wxFont*)pTheFont;
char zMsg[128]; // DEBUG wxChar zMsg[128]; // DEBUG
wxString sError; wxString sError;
if (!pFontToUse) if (!pFontToUse)
pFontToUse = (wxFont*)&m_font; pFontToUse = (wxFont*)&m_font;
l = rsString.length(); l = rsString.length();
pStr = (PCH) rsString.c_str();
// //
// In world coordinates. // In world coordinates.
// //
bRc = ::GpiQueryTextBox( m_hPS bRc = ::GpiQueryTextBox( m_hPS
,l ,l
,pStr ,(PCH)rsString.c_str()
,TXTBOX_COUNT // return maximum information ,TXTBOX_COUNT // return maximum information
,avPoint // array of coordinates points ,avPoint // array of coordinates points
); );
@@ -2264,8 +2262,8 @@ void wxDC::DoGetTextExtent(
vErrorCode = ::WinGetLastError(wxGetInstance()); vErrorCode = ::WinGetLastError(wxGetInstance());
sError = wxPMErrorToStr(vErrorCode); sError = wxPMErrorToStr(vErrorCode);
// DEBUG // DEBUG
sprintf(zMsg, "GpiQueryTextBox for %s: failed with Error: %lx - %s", pStr, vErrorCode, sError.c_str()); wxSprintf(zMsg, _T("GpiQueryTextBox for %s: failed with Error: %lx - %s"), rsString.c_str(), vErrorCode, sError.c_str());
(void)wxMessageBox( "wxWidgets Menu sample" (void)wxMessageBox( _T("wxWidgets Menu sample")
,zMsg ,zMsg
,wxICON_INFORMATION ,wxICON_INFORMATION
); );

View File

@@ -119,7 +119,7 @@ wxWindowDC::wxWindowDC(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to create presentation space. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to create presentation space. Error: %s\n"), sError.c_str());
} }
::GpiAssociate(m_hPS, NULLHANDLE); ::GpiAssociate(m_hPS, NULLHANDLE);
::GpiAssociate(m_hPS, m_hDC); ::GpiAssociate(m_hPS, m_hDC);
@@ -137,7 +137,7 @@ wxWindowDC::wxWindowDC(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
} }
::GpiCreateLogColorTable( m_hPS ::GpiCreateLogColorTable( m_hPS
,0L ,0L
@@ -237,7 +237,7 @@ wxClientDC::wxClientDC(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
} }
::GpiCreateLogColorTable( m_hPS ::GpiCreateLogColorTable( m_hPS
,0L ,0L

View File

@@ -263,7 +263,7 @@ bool wxDialog::Show(
wxDialogBase::Show(bShow); wxDialogBase::Show(bShow);
if (GetTitle().c_str()) if (GetTitle().c_str())
::WinSetWindowText((HWND)GetHwnd(), GetTitle().c_str()); ::WinSetWindowText((HWND)GetHwnd(), (PSZ)GetTitle().c_str());
if ( bShow ) if ( bShow )
{ {

View File

@@ -79,7 +79,7 @@ static inline FIND_DATA FindFirst(
FIND_DATA hDir = HDIR_CREATE; FIND_DATA hDir = HDIR_CREATE;
FIND_ATTR rc; FIND_ATTR rc;
rc = ::DosFindFirst( rsSpec.c_str() rc = ::DosFindFirst( (PSZ)rsSpec.c_str()
,&hDir ,&hDir
,0x37 // was: FILE_NORMAL ,0x37 // was: FILE_NORMAL
,pFinddata ,pFinddata
@@ -110,7 +110,7 @@ static const wxChar* GetNameFromFindData(
FIND_STRUCT* pFinddata FIND_STRUCT* pFinddata
) )
{ {
return pFinddata->achName; return (wxChar*)pFinddata->achName;
} }
static const FIND_ATTR GetAttrFromFindData( static const FIND_ATTR GetAttrFromFindData(

View File

@@ -327,44 +327,44 @@ wxDataFormat wxDropTarget::GetSupportedFormat (
case wxDF_TEXT: case wxDF_TEXT:
case wxDF_FILENAME: case wxDF_FILENAME:
case wxDF_HTML: case wxDF_HTML:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_TEXT"; sFormat = _T("DRF_TEXT");
break; break;
case wxDF_OEMTEXT: case wxDF_OEMTEXT:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_OEMTEXT"; sFormat = _T("DRF_OEMTEXT");
break; break;
case wxDF_BITMAP: case wxDF_BITMAP:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_BITMAP"; sFormat = _T("DRF_BITMAP");
break; break;
case wxDF_METAFILE: case wxDF_METAFILE:
case wxDF_ENHMETAFILE: case wxDF_ENHMETAFILE:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_METAFILE"; sFormat = _T("DRF_METAFILE");
break; break;
case wxDF_TIFF: case wxDF_TIFF:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_TIFF"; sFormat = _T("DRF_TIFF");
break; break;
case wxDF_SYLK: case wxDF_SYLK:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_SYLK"; sFormat = _T("DRF_SYLK");
break; break;
case wxDF_DIF: case wxDF_DIF:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_DIF"; sFormat = _T("DRF_DIF");
break; break;
case wxDF_DIB: case wxDF_DIB:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_DIB"; sFormat = _T("DRF_DIB");
break; break;
case wxDF_PALETTE: case wxDF_PALETTE:
@@ -373,19 +373,19 @@ wxDataFormat wxDropTarget::GetSupportedFormat (
case wxDF_WAVE: case wxDF_WAVE:
case wxDF_UNICODETEXT: case wxDF_UNICODETEXT:
case wxDF_LOCALE: case wxDF_LOCALE:
sMechanism = "DRM_OS2FILE"; sMechanism = _T("DRM_OS2FILE");
sFormat = "DRF_UNKNOWN"; sFormat = _T("DRF_UNKNOWN");
break; break;
case wxDF_PRIVATE: case wxDF_PRIVATE:
sMechanism = "DRM_OBJECT"; sMechanism = _T("DRM_OBJECT");
sFormat = "DRF_UNKNOWN"; sFormat = _T("DRF_UNKNOWN");
break; break;
} }
for (i = 0; i < ulItems; i++) for (i = 0; i < ulItems; i++)
{ {
pDragItem = ::DrgQueryDragitemPtr(pDataSource, i); pDragItem = ::DrgQueryDragitemPtr(pDataSource, i);
if (::DrgVerifyRMF(pDragItem, sMechanism.c_str(), sFormat.c_str())) if (::DrgVerifyRMF(pDragItem, (PSZ)sMechanism.c_str(), (PSZ)sFormat.c_str()))
{ {
bValid = TRUE; bValid = TRUE;
break; break;
@@ -552,10 +552,10 @@ void wxDropSource::Init ()
HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN); HSTR hStrType = ::DrgAddStrHandle(DRT_UNKNOWN);
HSTR hStrRMF; HSTR hStrRMF;
HSTR hStrContainer; HSTR hStrContainer;
char zFormats[128]; wxChar zFormats[128];
char zContainer[128]; wxChar zContainer[128];
USHORT uSize = GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1; USHORT uSize = GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()) + 1;
char* pzBuffer = new char[uSize]; wxChar* pzBuffer = new wxChar[uSize];
memset(pzBuffer, '\0', GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())); memset(pzBuffer, '\0', GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat()));
pzBuffer[GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())] = '\0'; pzBuffer[GetDataObject()->GetDataSize(GetDataObject()->GetPreferredFormat())] = '\0';
@@ -563,11 +563,11 @@ void wxDropSource::Init ()
,(void*)pzBuffer ,(void*)pzBuffer
); );
strcpy(zFormats, "<DRM_OS2FILE, DRF_UNKNOWN>"); wxStrcpy(zFormats, _T("<DRM_OS2FILE, DRF_UNKNOWN>"));
strcpy(zContainer, GetDataObject()->GetPreferredFormat().GetId().c_str()); wxStrcpy(zContainer, GetDataObject()->GetPreferredFormat().GetId());
hStrRMF = ::DrgAddStrHandle(zFormats); hStrRMF = ::DrgAddStrHandle((PSZ)zFormats);
hStrContainer = ::DrgAddStrHandle(zContainer); hStrContainer = ::DrgAddStrHandle((PSZ)zContainer);
m_pDragItem = new DRAGITEM[m_ulItems]; m_pDragItem = new DRAGITEM[m_ulItems];
for (ULONG i = 0; i < m_ulItems; i++) for (ULONG i = 0; i < m_ulItems; i++)
@@ -578,7 +578,7 @@ void wxDropSource::Init ()
m_pDragItem[i].hstrContainerName = hStrContainer; m_pDragItem[i].hstrContainerName = hStrContainer;
m_pDragItem[i].fsControl = 0; m_pDragItem[i].fsControl = 0;
m_pDragItem[i].fsSupportedOps = DO_COPYABLE | DO_MOVEABLE | DO_LINKABLE; m_pDragItem[i].fsSupportedOps = DO_COPYABLE | DO_MOVEABLE | DO_LINKABLE;
m_pDragItem[i].hstrSourceName = ::DrgAddStrHandle(pzBuffer); m_pDragItem[i].hstrSourceName = ::DrgAddStrHandle((PSZ)pzBuffer);
m_pDragItem[i].hstrTargetName = m_pDragItem[i].hstrSourceName; m_pDragItem[i].hstrTargetName = m_pDragItem[i].hstrSourceName;
m_pDragItem[i].ulItemID = i; m_pDragItem[i].ulItemID = i;
::DrgSetDragitem( m_pDragInfo ::DrgSetDragitem( m_pDragInfo

View File

@@ -138,7 +138,7 @@ int wxFileDialog::ShowModal()
vFileDlg.cbSize = sizeof(FILEDLG); vFileDlg.cbSize = sizeof(FILEDLG);
vFileDlg.fl = lFlags; vFileDlg.fl = lFlags;
vFileDlg.pszTitle = zTitleBuffer; vFileDlg.pszTitle = (PSZ)zTitleBuffer;
// //
// Convert forward slashes to backslashes (file selector doesn't like // Convert forward slashes to backslashes (file selector doesn't like
@@ -189,11 +189,11 @@ int wxFileDialog::ShowModal()
} }
} }
if ( wxStrlen(m_wildCard) == 0 ) if ( wxStrlen(m_wildCard) == 0 )
sTheFilter = ""; sTheFilter = wxEmptyString;
else else
sTheFilter = m_wildCard; sTheFilter = m_wildCard;
pzFilterBuffer = strtok((char*)sTheFilter.c_str(), "|"); wxStrtok((wxChar*)sTheFilter.c_str(), wxT("|"), &pzFilterBuffer);
while(pzFilterBuffer != NULL) while(pzFilterBuffer != NULL)
{ {
if (nCount > 0 && !(nCount % 2)) if (nCount > 0 && !(nCount % 2))
@@ -202,14 +202,14 @@ int wxFileDialog::ShowModal()
{ {
sDir += pzFilterBuffer; sDir += pzFilterBuffer;
} }
pzFilterBuffer = strtok(NULL, "|"); wxStrtok(NULL, wxT("|"), &pzFilterBuffer);
nCount++; nCount++;
} }
if (nCount == 0) if (nCount == 0)
sDir += m_fileName; sDir += m_fileName;
if (sDir.IsEmpty()) if (sDir.IsEmpty())
sDir = "*.*"; sDir = wxT("*.*");
wxStrcpy(vFileDlg.szFullFile, sDir.c_str()); wxStrcpy((wxChar*)vFileDlg.szFullFile, sDir);
sFilterBuffer = sDir; sFilterBuffer = sDir;
hWnd = ::WinFileDlg( HWND_DESKTOP hWnd = ::WinFileDlg( HWND_DESKTOP
@@ -225,25 +225,25 @@ int wxFileDialog::ShowModal()
{ {
if (i == 0) if (i == 0)
{ {
m_dir = wxPathOnly(wxString((const char*)*vFileDlg.papszFQFilename[0])); m_dir = wxPathOnly(wxString((const wxChar*)*vFileDlg.papszFQFilename[0]));
m_path = (const char*)*vFileDlg.papszFQFilename[0]; m_path = (const wxChar*)*vFileDlg.papszFQFilename[0];
} }
m_fileName = wxFileNameFromPath(wxString((const char*)*vFileDlg.papszFQFilename[i])); m_fileName = wxFileNameFromPath(wxString((const wxChar*)*vFileDlg.papszFQFilename[i]));
m_fileNames.Add(m_fileName); m_fileNames.Add(m_fileName);
} }
::WinFreeFileDlgList(vFileDlg.papszFQFilename); ::WinFreeFileDlgList(vFileDlg.papszFQFilename);
} }
else if (!(m_dialogStyle & wxSAVE)) else if (!(m_dialogStyle & wxSAVE))
{ {
m_path = vFileDlg.szFullFile; m_path = (wxChar*)vFileDlg.szFullFile;
m_fileName = wxFileNameFromPath(vFileDlg.szFullFile); m_fileName = wxFileNameFromPath(wxString((const wxChar*)vFileDlg.szFullFile));
m_dir = wxPathOnly(vFileDlg.szFullFile); m_dir = wxPathOnly((const wxChar*)vFileDlg.szFullFile);
} }
else // save file else // save file
{ {
const wxChar* pzExtension = NULL; const wxChar* pzExtension = NULL;
wxStrcpy(zFileNameBuffer, vFileDlg.szFullFile); wxStrcpy(zFileNameBuffer, (const wxChar*)vFileDlg.szFullFile);
int nIdx = wxStrlen(zFileNameBuffer) - 1; int nIdx = wxStrlen(zFileNameBuffer) - 1;
wxString sExt; wxString sExt;
@@ -290,10 +290,10 @@ int wxFileDialog::ShowModal()
} }
else else
{ {
m_path = vFileDlg.szFullFile; m_path = (wxChar*)vFileDlg.szFullFile;
} }
m_fileName = wxFileNameFromPath(vFileDlg.szFullFile); m_fileName = wxFileNameFromPath((const wxChar*)vFileDlg.szFullFile);
m_dir = wxPathOnly(vFileDlg.szFullFile); m_dir = wxPathOnly((const wxChar*)vFileDlg.szFullFile);
// //
// === Simulating the wxOVERWRITE_PROMPT >>============================ // === Simulating the wxOVERWRITE_PROMPT >>============================

View File

@@ -51,7 +51,7 @@ public:
wxFontRefData() wxFontRefData()
{ {
Init(-1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, FALSE, Init(-1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, FALSE,
"", wxFONTENCODING_DEFAULT); wxEmptyString, wxFONTENCODING_DEFAULT);
} }
wxFontRefData( int nSize wxFontRefData( int nSize
@@ -494,7 +494,7 @@ bool wxFontRefData::Alloc(
m_nWeight = wxFONTWEIGHT_NORMAL; m_nWeight = wxFONTWEIGHT_NORMAL;
} }
m_bUnderlined = ((m_vNativeFontInfo.fa.fsSelection & FATTR_SEL_UNDERSCORE) != 0); m_bUnderlined = ((m_vNativeFontInfo.fa.fsSelection & FATTR_SEL_UNDERSCORE) != 0);
m_sFaceName = m_vNativeFontInfo.fa.szFacename; m_sFaceName = (wxChar*)m_vNativeFontInfo.fa.szFacename;
m_vEncoding = wxGetFontEncFromCharSet(m_vNativeFontInfo.fa.usCodePage); m_vEncoding = wxGetFontEncFromCharSet(m_vNativeFontInfo.fa.usCodePage);
// //
@@ -582,7 +582,7 @@ bool wxNativeFontInfo::GetUnderlined() const
wxString wxNativeFontInfo::GetFaceName() const wxString wxNativeFontInfo::GetFaceName() const
{ {
return fm.szFacename; return (wxChar*)fm.szFacename;
} // end of wxNativeFontInfo::GetFaceName } // end of wxNativeFontInfo::GetFaceName
wxFontFamily wxNativeFontInfo::GetFamily() const wxFontFamily wxNativeFontInfo::GetFamily() const
@@ -695,7 +695,7 @@ void wxNativeFontInfo::SetFaceName(
wxString sFacename wxString sFacename
) )
{ {
wxStrncpy(fa.szFacename, sFacename, WXSIZEOF(fa.szFacename)); wxStrncpy((wxChar*)fa.szFacename, sFacename, WXSIZEOF(fa.szFacename));
} // end of wxNativeFontInfo::SetFaceName } // end of wxNativeFontInfo::SetFaceName
void wxNativeFontInfo::SetFamily( void wxNativeFontInfo::SetFamily(
@@ -735,7 +735,7 @@ void wxNativeFontInfo::SetFamily(
sFacename = wxT("System VIO") ; sFacename = wxT("System VIO") ;
} }
if (!wxStrlen(fa.szFacename) ) if (!wxStrlen((wxChar*)fa.szFacename) )
{ {
SetFaceName(sFacename); SetFaceName(sFacename);
} }
@@ -838,7 +838,7 @@ bool wxNativeFontInfo::FromString(
sToken = vTokenizer.GetNextToken(); sToken = vTokenizer.GetNextToken();
if(!sToken) if(!sToken)
return FALSE; return FALSE;
wxStrcpy(fa.szFacename, sToken.c_str()); wxStrcpy((wxChar*)fa.szFacename, sToken.c_str());
return TRUE; return TRUE;
} // end of wxNativeFontInfo::FromString } // end of wxNativeFontInfo::FromString

View File

@@ -91,7 +91,7 @@ int wxFontDialog::ShowModal()
vChosenFont.SetPointSize(nPointSize); vChosenFont.SetPointSize(nPointSize);
m_fontData.m_chosenFont = vChosenFont; m_fontData.m_chosenFont = vChosenFont;
m_fontData.EncodingInfo().facename = vFontDlg.fAttrs.szFacename; m_fontData.EncodingInfo().facename = (wxChar*)vFontDlg.fAttrs.szFacename;
m_fontData.EncodingInfo().charset = vFontDlg.fAttrs.usCodePage; m_fontData.EncodingInfo().charset = vFontDlg.fAttrs.usCodePage;
return wxID_OK; return wxID_OK;

View File

@@ -240,7 +240,7 @@ bool wxTestFontEncoding(
vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed vLogFont.fsFontUse = FATTR_FONTUSE_OUTLINE | // only outline fonts allowed
FATTR_FONTUSE_TRANSFORMABLE; // may be transformed FATTR_FONTUSE_TRANSFORMABLE; // may be transformed
strncpy(vLogFont.szFacename, rInfo.facename.c_str(), sizeof(vLogFont.szFacename)); wxStrncpy((wxChar*)vLogFont.szFacename, rInfo.facename.c_str(), WXSIZEOF(vLogFont.szFacename));
if (!::GpiCreateLogFont( hPS if (!::GpiCreateLogFont( hPS
,NULL ,NULL
@@ -447,7 +447,7 @@ void wxFillLogFont(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
} }
sFaceName = zFacename; sFaceName = (wxChar*)zFacename;
*pbInternalPS = bInternalPS; *pbInternalPS = bInternalPS;
// //
@@ -470,7 +470,7 @@ void wxOS2SelectMatchingFontByName(
int anDiff[16]; int anDiff[16];
int anMinDiff[16]; int anMinDiff[16];
int nIndex = 0; int nIndex = 0;
char zFontFaceName[FACESIZE]; wxChar zFontFaceName[FACESIZE];
wxString sFaceName; wxString sFaceName;
USHORT usWeightClass; USHORT usWeightClass;
int fsSelection = 0; int fsSelection = 0;
@@ -565,7 +565,7 @@ void wxOS2SelectMatchingFontByName(
int nEmHeight = 0; int nEmHeight = 0;
int nXHeight = 0; int nXHeight = 0;
anDiff[0] = wxGpiStrcmp(pFM[i].szFacename, zFontFaceName); anDiff[0] = wxGpiStrcmp((wxChar*)pFM[i].szFacename, zFontFaceName);
anDiff[1] = abs(pFM[i].lEmHeight - nPointSize); anDiff[1] = abs(pFM[i].lEmHeight - nPointSize);
anDiff[2] = abs(pFM[i].usWeightClass - usWeightClass); anDiff[2] = abs(pFM[i].usWeightClass - usWeightClass);
anDiff[3] = abs((pFM[i].fsSelection & 0x2f) - fsSelection); anDiff[3] = abs((pFM[i].fsSelection & 0x2f) - fsSelection);
@@ -641,7 +641,7 @@ void wxOS2SelectMatchingFontByName(
pFattrs->fsType = 0; pFattrs->fsType = 0;
pFattrs->lMaxBaselineExt = 0; pFattrs->lMaxBaselineExt = 0;
pFattrs->lAveCharWidth = 0; pFattrs->lAveCharWidth = 0;
wxStrcpy(pFattrs->szFacename, pFM[nIndex].szFacename); wxStrcpy((wxChar*)pFattrs->szFacename, (wxChar*)pFM[nIndex].szFacename);
if (pFont->GetWeight() == wxNORMAL) if (pFont->GetWeight() == wxNORMAL)
pFattrs->fsSelection = 0; pFattrs->fsSelection = 0;
else else
@@ -669,8 +669,8 @@ wxFont wxCreateFontFromLogFont(
} // end of wxCreateFontFromLogFont } // end of wxCreateFontFromLogFont
int wxGpiStrcmp( int wxGpiStrcmp(
char* s0 wxChar* s0
, char* s1 , wxChar* s1
) )
{ int l0; { int l0;
int l1; int l1;
@@ -691,8 +691,8 @@ int wxGpiStrcmp(
else if(s1 == NULL) else if(s1 == NULL)
return 32; return 32;
l0 = strlen(s0); l0 = wxStrlen(s0);
l1 = strlen(s1); l1 = wxStrlen(s1);
l = l0; l = l0;
if(l0 != l1) if(l0 != l1)
{ {
@@ -705,7 +705,7 @@ int wxGpiStrcmp(
d = s0[i]-s1[i]; d = s0[i]-s1[i];
if(!d) if(!d)
continue; continue;
d1 = toupper(s0[i]) - toupper(s1[i]); d1 = wxToupper(s0[i]) - wxToupper(s1[i]);
if(!d1) if(!d1)
continue; continue;
rc += abs(d); rc += abs(d);

View File

@@ -231,7 +231,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
// Set the height according to the font and the border size // Set the height according to the font and the border size
// //
vDC.SetFont(pStatusBar->GetFont()); // Screws up the menues for some reason vDC.SetFont(pStatusBar->GetFont()); // Screws up the menues for some reason
vDC.GetTextExtent( "X" vDC.GetTextExtent( wxT("X")
,NULL ,NULL
,&nY ,&nY
); );
@@ -304,7 +304,7 @@ void wxFrame::PositionStatusBar()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for StautsBar. Error: %s\n", sError.c_str()); wxLogError(_T("Error setting parent for StautsBar. Error: %s\n"), sError.c_str());
return; return;
} }
} }
@@ -437,14 +437,14 @@ void wxFrame::InternalSetMenuBar()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError.c_str()); wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
} }
if (!::WinSetOwner(m_hMenu, m_hFrame)) if (!::WinSetOwner(m_hMenu, m_hFrame))
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError.c_str()); wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
} }
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
} // end of wxFrame::InternalSetMenuBar } // end of wxFrame::InternalSetMenuBar

View File

@@ -154,8 +154,8 @@ bool wxGauge::Create(
#endif #endif
if (pParent) if (pParent)
pParent->AddChild(this); pParent->AddChild(this);
m_backgroundColour.Set(wxString("LIGHT GREY")); m_backgroundColour.Set(wxString(wxT("LIGHT GREY")));
m_foregroundColour.Set(wxString("NAVY")); m_foregroundColour.Set(wxString(wxT("NAVY")));
m_nRangeMax = nRange; m_nRangeMax = nRange;
m_nGaugePos = 0; m_nGaugePos = 0;

View File

@@ -32,7 +32,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase)
wxWinHelpController::wxWinHelpController() wxWinHelpController::wxWinHelpController()
{ {
m_helpFile = ""; m_helpFile = wxEmptyString;
} }
wxWinHelpController::~wxWinHelpController() wxWinHelpController::~wxWinHelpController()
@@ -96,7 +96,7 @@ bool wxWinHelpController::DisplayBlock(long block)
wxString str = m_helpFile; wxString str = m_helpFile;
size_t len = str.Length(); size_t len = str.Length();
if (!(str[(size_t)(len-1)] == 'p' && str[(size_t)(len-2)] == 'l' && str[(size_t)(len-3)] == 'h' && str[(size_t)(len-4)] == '.')) if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
str += wxT(".hlp"); str += wxT(".hlp");
if (wxTheApp->GetTopWindow()) if (wxTheApp->GetTopWindow())
@@ -111,7 +111,7 @@ bool wxWinHelpController::DisplayBlock(long block)
bool wxWinHelpController::KeywordSearch(const wxString& k, bool wxWinHelpController::KeywordSearch(const wxString& k,
wxHelpSearchMode WXUNUSED(mode)) wxHelpSearchMode WXUNUSED(mode))
{ {
if (m_helpFile == "") return FALSE; if (m_helpFile == wxEmptyString) return FALSE;
wxString str = m_helpFile; wxString str = m_helpFile;
size_t len = str.Length(); size_t len = str.Length();

View File

@@ -79,7 +79,7 @@ wxIcon::wxIcon(
// //
wxString sOs2Name = rIconFile.Mid(0, rIconFile.Length() - 3); wxString sOs2Name = rIconFile.Mid(0, rIconFile.Length() - 3);
sOs2Name += "Os2.ico"; sOs2Name += wxT("Os2.ico");
LoadFile( sOs2Name LoadFile( sOs2Name
,lFlags ,lFlags
,nDesiredWidth ,nDesiredWidth

View File

@@ -60,7 +60,7 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
m_strLocalFilename = localFilename; m_strLocalFilename = localFilename;
if (m_strLocalFilename.IsEmpty()) if (m_strLocalFilename.IsEmpty())
{ {
m_strLocalFilename = GetAppName() + ".ini"; m_strLocalFilename = GetAppName() + wxT(".ini");
} }
// append the extension if none given and it's not an absolute file name // append the extension if none given and it's not an absolute file name
@@ -68,11 +68,11 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
if ( !wxIsPathSeparator(m_strLocalFilename[(size_t) 0]) && if ( !wxIsPathSeparator(m_strLocalFilename[(size_t) 0]) &&
m_strLocalFilename.Find('.') == wxNOT_FOUND ) m_strLocalFilename.Find('.') == wxNOT_FOUND )
{ {
m_strLocalFilename << ".ini"; m_strLocalFilename << wxT(".ini");
} }
// set root path // set root path
SetPath(""); SetPath(wxT(""));
} }
wxIniConfig::~wxIniConfig() wxIniConfig::~wxIniConfig()
@@ -105,7 +105,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
m_strPath.Empty(); m_strPath.Empty();
if ( nPartsCount == 0 ) { if ( nPartsCount == 0 ) {
// go to the root // go to the root
m_strGroup = PATH_SEP_REPLACE; m_strGroup = (wxChar*)PATH_SEP_REPLACE;
} }
else { else {
// translate // translate
@@ -120,7 +120,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
// other functions assume that all this is true, i.e. there are no trailing // other functions assume that all this is true, i.e. there are no trailing
// underscores at the end except if the group is the root one // underscores at the end except if the group is the root one
wxASSERT( (m_strPath.IsEmpty() || m_strPath.Last() != PATH_SEP_REPLACE) && wxASSERT( (m_strPath.IsEmpty() || m_strPath.Last() != PATH_SEP_REPLACE) &&
(m_strGroup == wxString(PATH_SEP_REPLACE) || (m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ||
m_strGroup.Last() != PATH_SEP_REPLACE) ); m_strGroup.Last() != PATH_SEP_REPLACE) );
} }
@@ -131,14 +131,14 @@ const wxString& wxIniConfig::GetPath() const
// always return abs path // always return abs path
s_str = wxCONFIG_PATH_SEPARATOR; s_str = wxCONFIG_PATH_SEPARATOR;
if ( m_strGroup == wxString(PATH_SEP_REPLACE) ) { if ( m_strGroup == wxString((wxChar)PATH_SEP_REPLACE) ) {
// we're at the root level, nothing to do // we're at the root level, nothing to do
} }
else { else {
s_str << m_strGroup; s_str << m_strGroup;
if ( !m_strPath.IsEmpty() ) if ( !m_strPath.IsEmpty() )
s_str << wxCONFIG_PATH_SEPARATOR; s_str << wxCONFIG_PATH_SEPARATOR;
for ( const char *p = m_strPath; *p != '\0'; p++ ) { for ( const wxChar *p = m_strPath; *p != '\0'; p++ ) {
s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p); s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p);
} }
} }
@@ -162,7 +162,7 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
{ {
wxString strKey; wxString strKey;
if ( m_strGroup != wxString(PATH_SEP_REPLACE) ) if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
strKey << m_strGroup << PATH_SEP_REPLACE; strKey << m_strGroup << PATH_SEP_REPLACE;
if ( !m_strPath.IsEmpty() ) if ( !m_strPath.IsEmpty() )
strKey << m_strPath << PATH_SEP_REPLACE; strKey << m_strPath << PATH_SEP_REPLACE;
@@ -179,28 +179,28 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
// not implemented // not implemented
bool wxIniConfig::GetFirstGroup(wxString& str, long& lIndex) const bool wxIniConfig::GetFirstGroup(wxString& str, long& lIndex) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
bool wxIniConfig::GetNextGroup (wxString& str, long& lIndex) const bool wxIniConfig::GetNextGroup (wxString& str, long& lIndex) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
bool wxIniConfig::GetFirstEntry(wxString& str, long& lIndex) const bool wxIniConfig::GetFirstEntry(wxString& str, long& lIndex) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
@@ -212,28 +212,28 @@ bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
// not implemented // not implemented
size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return (size_t)-1; return (size_t)-1;
} }
size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return (size_t)-1; return (size_t)-1;
} }
bool wxIniConfig::HasGroup(const wxString& strName) const bool wxIniConfig::HasGroup(const wxString& strName) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
bool wxIniConfig::HasEntry(const wxString& strName) const bool wxIniConfig::HasEntry(const wxString& strName) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(wxT("not implemeted"));
return FALSE; return FALSE;
} }
@@ -264,20 +264,20 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr) const
wxConfigPathChanger path(this, szKey); wxConfigPathChanger path(this, szKey);
wxString strKey = GetPrivateKeyName(path.Name()); wxString strKey = GetPrivateKeyName(path.Name());
char szBuf[1024]; // @@ should dynamically allocate memory... wxChar szBuf[1024]; // @@ should dynamically allocate memory...
// first look in the private INI file // first look in the private INI file
// NB: the lpDefault param to GetPrivateProfileString can't be NULL // NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "", // GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename); // szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty(szBuf) ) { if ( ::IsEmpty((PSZ)szBuf) ) {
// now look in win.ini // now look in win.ini
wxString strKey = GetKeyName(path.Name()); wxString strKey = GetKeyName(path.Name());
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf)); // GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
} }
if ( ::IsEmpty(szBuf) ) { if ( ::IsEmpty((PSZ)szBuf) ) {
return FALSE; return FALSE;
} }
else { else {
@@ -292,20 +292,20 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
wxConfigPathChanger path(this, szKey); wxConfigPathChanger path(this, szKey);
wxString strKey = GetPrivateKeyName(path.Name()); wxString strKey = GetPrivateKeyName(path.Name());
char szBuf[1024]; // @@ should dynamically allocate memory... wxChar szBuf[1024]; // @@ should dynamically allocate memory...
// first look in the private INI file // first look in the private INI file
// NB: the lpDefault param to GetPrivateProfileString can't be NULL // NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "", // GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename); // szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty(szBuf) ) { if ( ::IsEmpty((PSZ)szBuf) ) {
// now look in win.ini // now look in win.ini
wxString strKey = GetKeyName(path.Name()); wxString strKey = GetKeyName(path.Name());
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf)); // GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
} }
if ( ::IsEmpty(szBuf) ) { if ( ::IsEmpty((PSZ)szBuf) ) {
*pstr = szDefault; *pstr = szDefault;
return FALSE; return FALSE;
} }
@@ -363,8 +363,8 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue)
bool wxIniConfig::Write(const wxString& szKey, long lValue) bool wxIniConfig::Write(const wxString& szKey, long lValue)
{ {
// ltoa() is not ANSI :-( // ltoa() is not ANSI :-(
char szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits) wxChar szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits)
sprintf(szBuf, "%ld", lValue); wxSprintf(szBuf, wxT("%ld"), lValue);
return Write(szKey, szBuf); return Write(szKey, szBuf);
} }
@@ -430,7 +430,7 @@ bool wxIniConfig::DeleteAll()
// WriteProfileString(GetVendorName(), NULL, NULL); // WriteProfileString(GetVendorName(), NULL, NULL);
// then delete our own ini file // then delete our own ini file
char szBuf[MAX_PATH]; wxChar szBuf[MAX_PATH];
size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf)); size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 ) if ( nRc == 0 )
{ {
@@ -438,11 +438,11 @@ bool wxIniConfig::DeleteAll()
} }
else if ( nRc > WXSIZEOF(szBuf) ) else if ( nRc > WXSIZEOF(szBuf) )
{ {
wxFAIL_MSG("buffer is too small for Windows directory."); wxFAIL_MSG(_("buffer is too small for Windows directory."));
} }
wxString strFile = szBuf; wxString strFile = szBuf;
strFile << '\\' << m_strLocalFilename; strFile << wxT('\\') << m_strLocalFilename;
if ( !wxRemoveFile(strFile) ) { if ( !wxRemoveFile(strFile) ) {
wxLogSysError(_("Can't delete the INI file '%s'"), strFile.c_str()); wxLogSysError(_("Can't delete the INI file '%s'"), strFile.c_str());

View File

@@ -49,7 +49,7 @@
class wxListBoxItem : public wxOwnerDrawn class wxListBoxItem : public wxOwnerDrawn
{ {
public: public:
wxListBoxItem(const wxString& rsStr = ""); wxListBoxItem(const wxString& rsStr = wxEmptyString);
}; };
wxListBoxItem::wxListBoxItem( wxListBoxItem::wxListBoxItem(
@@ -198,7 +198,7 @@ bool wxListBox::Create(
// //
wxColour vColour; wxColour vColour;
vColour.Set(wxString("WHITE")); vColour.Set(wxString(wxT("WHITE")));
LONG lColor = (LONG)vColour.GetPixel(); LONG lColor = (LONG)vColour.GetPixel();
@@ -207,7 +207,7 @@ bool wxListBox::Create(
,sizeof(LONG) ,sizeof(LONG)
,(PVOID)&lColor ,(PVOID)&lColor
); );
vColour.Set(wxString("NAVY")); vColour.Set(wxString(wxT("NAVY")));
lColor = (LONG)vColour.GetPixel(); lColor = (LONG)vColour.GetPixel();
::WinSetPresParam( m_hWnd ::WinSetPresParam( m_hWnd
,PP_HILITEBACKGROUNDCOLOR ,PP_HILITEBACKGROUNDCOLOR
@@ -380,7 +380,7 @@ int wxListBox::FindString(
lTextLength = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0)); lTextLength = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
zStr = new char[lTextLength + 1]; zStr = new char[lTextLength + 1];
::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT(nPos, (SHORT)lTextLength), (MPARAM)zStr); ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT(nPos, (SHORT)lTextLength), (MPARAM)zStr);
if (rsString == (char*)zStr) if (rsString == (wxChar*)zStr)
{ {
delete [] zStr; delete [] zStr;
break; break;
@@ -593,14 +593,14 @@ wxString wxListBox::GetString(
) const ) const
{ {
LONG lLen = 0; LONG lLen = 0;
char* zBuf; wxChar* zBuf;
wxString sResult; wxString sResult;
wxCHECK_MSG( N >= 0 && N < m_nNumItems, "", wxCHECK_MSG( N >= 0 && N < m_nNumItems, wxEmptyString,
wxT("invalid index in wxListBox::GetClientData") ); wxT("invalid index in wxListBox::GetClientData") );
lLen = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)N, (MPARAM)0)); lLen = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)N, (MPARAM)0));
zBuf = new char[lLen + 1]; zBuf = new wxChar[lLen + 1];
::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)N, (SHORT)lLen), (MPARAM)zBuf); ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)N, (SHORT)lLen), (MPARAM)zBuf);
zBuf[lLen] = '\0'; zBuf[lLen] = '\0';
sResult = zBuf; sResult = zBuf;

View File

@@ -353,7 +353,7 @@ bool wxMenu::DoInsertOrAppend(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("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("Insert or AppendMenu");
return FALSE; return FALSE;
} }
@@ -560,7 +560,7 @@ void wxMenu::SetTitle(
{ {
if (!rLabel.IsEmpty()) if (!rLabel.IsEmpty())
{ {
if (!::WinSetWindowText(hMenu, rLabel.c_str())) if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{ {
wxLogLastError("SetMenuTitle"); wxLogLastError("SetMenuTitle");
} }
@@ -581,7 +581,7 @@ void wxMenu::SetTitle(
// //
// Modify the title // Modify the title
// //
if (!::WinSetWindowText(hMenu, rLabel.c_str())) if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{ {
wxLogLastError("SetMenuTitle"); wxLogLastError("SetMenuTitle");
} }
@@ -790,7 +790,7 @@ WXHMENU wxMenuBar::Create()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError.c_str()); wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
return NULLHANDLE; return NULLHANDLE;
} }
@@ -798,7 +798,7 @@ WXHMENU wxMenuBar::Create()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError.c_str()); wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
return NULLHANDLE; return NULLHANDLE;
} }
@@ -809,7 +809,7 @@ WXHMENU wxMenuBar::Create()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("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());
return NULLHANDLE; return NULLHANDLE;
} }
} }

View File

@@ -190,7 +190,7 @@ wxString wxMenuItemBase::GetLabelFromText(
{ {
wxString sLabel; wxString sLabel;
for (const char* zPc = rsText.c_str(); *zPc; zPc++) for (const wxChar* zPc = rsText.c_str(); *zPc; zPc++)
{ {
if (*zPc == wxT('~') || *zPc == wxT('&')) if (*zPc == wxT('~') || *zPc == wxT('&'))
{ {

View File

@@ -137,8 +137,8 @@ bool wxNotebook::Create(
// //
// Notebook, so explicitly specify 0 as last parameter // Notebook, so explicitly specify 0 as last parameter
// //
if (!OS2CreateControl( "NOTEBOOK" if (!OS2CreateControl( wxT("NOTEBOOK")
,_T("") ,wxEmptyString
,rPos ,rPos
,rSize ,rSize
,lStyle | wxTAB_TRAVERSAL ,lStyle | wxTAB_TRAVERSAL
@@ -280,7 +280,7 @@ wxString wxNotebook::GetPageText (
return wxEmptyString; return wxEmptyString;
} }
vBookText.textLen = ulRc + 1; // To get the null terminator vBookText.textLen = ulRc + 1; // To get the null terminator
vBookText.pString = zBuf; vBookText.pString = (char*)zBuf;
// //
// Now get the actual text // Now get the actual text
@@ -298,7 +298,7 @@ wxString wxNotebook::GetPageText (
ulRc = 255L; ulRc = 255L;
vBookText.pString[ulRc] = '\0'; vBookText.pString[ulRc] = '\0';
sStr = vBookText.pString; sStr = (wxChar*)vBookText.pString;
return sStr; return sStr;
} // end of wxNotebook::GetPageText } // end of wxNotebook::GetPageText

View File

@@ -214,7 +214,7 @@ bool wxOwnerDrawn::OnDrawItem(
// //
if (eStatus & wxODSelected) if (eStatus & wxODSelected)
{ {
wxColour vCol2("WHITE"); wxColour vCol2(wxT("WHITE"));
vColBack.Set( (unsigned char)0 vColBack.Set( (unsigned char)0
,(unsigned char)0 ,(unsigned char)0
,(unsigned char)160 ,(unsigned char)160
@@ -300,7 +300,7 @@ bool wxOwnerDrawn::OnDrawItem(
// //
// Display main text and accel text separately to allign better // Display main text and accel text separately to allign better
// //
wxString sTgt = "\t"; wxString sTgt = wxT("\t");
wxString sFullString = m_strName; // need to save the original text wxString sFullString = m_strName; // need to save the original text
wxString sAccel; wxString sAccel;
int nIndex; int nIndex;
@@ -324,7 +324,7 @@ bool wxOwnerDrawn::OnDrawItem(
// //
// Deal with the mneumonic character // Deal with the mneumonic character
// //
sTgt = "~"; sTgt = wxT("~");
nIndex = sFullString.Find(sTgt.c_str()); nIndex = sFullString.Find(sTgt.c_str());
if (nIndex != -1) if (nIndex != -1)
{ {
@@ -341,7 +341,7 @@ bool wxOwnerDrawn::OnDrawItem(
,(long *)&nCharWidth ,(long *)&nCharWidth
,(long *)&nHeight ,(long *)&nHeight
); );
sFullString.Replace(sTgt.c_str(), "", TRUE); sFullString.Replace(sTgt.c_str(), wxEmptyString, TRUE);
} }
// //

View File

@@ -151,7 +151,7 @@ bool wxPen::RealizeResource()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table to RGB mode. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
if (M_PENDATA->m_nStyle == wxTRANSPARENT) if (M_PENDATA->m_nStyle == wxTRANSPARENT)
@@ -215,7 +215,7 @@ bool wxPen::RealizeResource()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n", sError.c_str()); wxLogError(_T("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
@@ -300,7 +300,7 @@ bool wxPen::RealizeResource()
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n", sError.c_str()); wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
} }
return bOk; return bOk;
} }

View File

@@ -288,7 +288,7 @@ bool wxRadioBox::Create(
wxColour vColour; wxColour vColour;
LONG lColor; LONG lColor;
vColour.Set(wxString("BLACK")); vColour.Set(wxString(wxT("BLACK")));
m_backgroundColour = pParent->GetBackgroundColour(); m_backgroundColour = pParent->GetBackgroundColour();
m_nSelectedButton = -1; m_nSelectedButton = -1;
m_nNoItems = 0; m_nNoItems = 0;
@@ -308,7 +308,7 @@ bool wxRadioBox::Create(
,rsName ,rsName
)) ))
return false; return false;
if (!OS2CreateControl( "STATIC" if (!OS2CreateControl( wxT("STATIC")
,SS_GROUPBOX ,SS_GROUPBOX
,rPos ,rPos
,rSize ,rSize
@@ -339,7 +339,7 @@ bool wxRadioBox::Create(
HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent) HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
,WC_BUTTON ,WC_BUTTON
,asChoices[i] ,(PSZ)asChoices[i].c_str()
,lStyleBtn ,lStyleBtn
,0, 0, 0, 0 ,0, 0, 0, 0
,GetWinHwnd(pParent) ,GetWinHwnd(pParent)
@@ -1070,7 +1070,7 @@ void wxRadioBox::SetString(
wxCHECK_RET( IsValid(nItem), wxT("invalid radiobox index") ); wxCHECK_RET( IsValid(nItem), wxT("invalid radiobox index") );
m_pnRadioWidth[nItem] = m_pnRadioHeight[nItem] = -1; m_pnRadioWidth[nItem] = m_pnRadioHeight[nItem] = -1;
::WinSetWindowText((HWND)m_ahRadioButtons[nItem], rsLabel.c_str()); ::WinSetWindowText((HWND)m_ahRadioButtons[nItem], (PSZ)rsLabel.c_str());
} // end of wxRadioBox::SetString } // end of wxRadioBox::SetString
bool wxRadioBox::SetStringSelection( bool wxRadioBox::SetStringSelection(

View File

@@ -65,7 +65,7 @@ void wxSlider::AdjustSubControls(
int nCx; // slider,min,max sizes int nCx; // slider,min,max sizes
int nCy; int nCy;
int nCyf; int nCyf;
char zBuf[300]; wxChar zBuf[300];
wxFont vFont = this->GetFont(); wxFont vFont = this->GetFont();
wxGetCharSize( GetHWND() wxGetCharSize( GetHWND()
@@ -81,10 +81,10 @@ void wxSlider::AdjustSubControls(
int nMinLen = 0; int nMinLen = 0;
int nMaxLen = 0; int nMaxLen = 0;
::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMin, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
if (m_hStaticValue) if (m_hStaticValue)
@@ -132,10 +132,10 @@ void wxSlider::AdjustSubControls(
int nMinLen = 0; int nMinLen = 0;
int nMaxLen = 0; int nMaxLen = 0;
::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMin, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
if (m_hStaticValue) if (m_hStaticValue)
@@ -261,7 +261,7 @@ bool wxSlider::Create(
// //
// Now create min static control // Now create min static control
// //
sprintf(wxBuffer, "%d", nMinValue); wxSprintf(wxBuffer, wxT("%d"), nMinValue);
lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE; lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
if (m_windowStyle & wxCLIP_SIBLINGS) if (m_windowStyle & wxCLIP_SIBLINGS)
lWstyle |= WS_CLIPSIBLINGS; lWstyle |= WS_CLIPSIBLINGS;
@@ -356,7 +356,7 @@ bool wxSlider::Create(
// //
// Finally, create max value static item // Finally, create max value static item
// //
sprintf(wxBuffer, "%d", nMaxValue); wxSprintf(wxBuffer, wxT("%d"), nMaxValue);
lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE; lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
if (m_windowStyle & wxCLIP_SIBLINGS) if (m_windowStyle & wxCLIP_SIBLINGS)
lMsStyle |= WS_CLIPSIBLINGS; lMsStyle |= WS_CLIPSIBLINGS;
@@ -410,7 +410,7 @@ bool wxSlider::Create(
wxColour vColour; wxColour vColour;
vColour.Set(wxString("BLACK")); vColour.Set(wxString(wxT("BLACK")));
LONG lColor = (LONG)vColour.GetPixel(); LONG lColor = (LONG)vColour.GetPixel();
@@ -455,7 +455,7 @@ bool wxSlider::Create(
,sizeof(LONG) ,sizeof(LONG)
,(PVOID)&lColor ,(PVOID)&lColor
); );
vColour.Set(wxString("BLUE")); vColour.Set(wxString(wxT("BLUE")));
lColor = (LONG)vColour.GetPixel(); lColor = (LONG)vColour.GetPixel();
::WinSetPresParam( m_hWnd ::WinSetPresParam( m_hWnd
,PP_HILITEBACKGROUNDCOLOR ,PP_HILITEBACKGROUNDCOLOR
@@ -485,7 +485,7 @@ void wxSlider::DoSetSize(
int nCyf; int nCyf;
int nCurrentX; int nCurrentX;
int nCurrentY; int nCurrentY;
char zBuf[300]; wxChar zBuf[300];
wxFont vFont = this->GetFont(); wxFont vFont = this->GetFont();
// //
@@ -542,9 +542,9 @@ void wxSlider::DoSetSize(
int nMinLen = 0; int nMinLen = 0;
int nMaxLen = 0; int nMaxLen = 0;
::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMin, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
if (m_hStaticValue) if (m_hStaticValue)
@@ -649,9 +649,9 @@ void wxSlider::DoSetSize(
int nMinLen; int nMinLen;
int nMaxLen; int nMaxLen;
::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMin, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
if (m_hStaticValue) if (m_hStaticValue)
{ {
@@ -1032,13 +1032,13 @@ void wxSlider::SetRange(
if (m_hStaticMin) if (m_hStaticMin)
{ {
wxSprintf(zBuf, wxT("%d"), m_nRangeMin); wxSprintf(zBuf, wxT("%d"), m_nRangeMin);
::WinSetWindowText((HWND)m_hStaticMin, zBuf); ::WinSetWindowText((HWND)m_hStaticMin, (PSZ)zBuf);
} }
if (m_hStaticMax) if (m_hStaticMax)
{ {
wxSprintf(zBuf, wxT("%d"), m_nRangeMax); wxSprintf(zBuf, wxT("%d"), m_nRangeMax);
::WinSetWindowText((HWND)m_hStaticMax, zBuf); ::WinSetWindowText((HWND)m_hStaticMax, (PSZ)zBuf);
} }
} // end of wxSlider::SetRange } // end of wxSlider::SetRange
@@ -1157,7 +1157,7 @@ void wxSlider::SetValue(
if (m_hStaticValue) if (m_hStaticValue)
{ {
wxSprintf(wxBuffer, wxT("%d"), nValue); wxSprintf(wxBuffer, wxT("%d"), nValue);
::WinSetWindowText((HWND)m_hStaticValue, wxBuffer); ::WinSetWindowText((HWND)m_hStaticValue, (PSZ)wxBuffer);
} }
} // end of wxSlider::SetValue } // end of wxSlider::SetValue

View File

@@ -357,7 +357,7 @@ void wxSpinCtrl::OnChar (
wxString sVal = wxGetWindowText(m_hWndBuddy); wxString sVal = wxGetWindowText(m_hWndBuddy);
InitCommandEvent(vEvent); InitCommandEvent(vEvent);
vEvent.SetString((char*)sVal.c_str()); vEvent.SetString(sVal);
vEvent.SetInt(GetValue()); vEvent.SetInt(GetValue());
if (GetEventHandler()->ProcessEvent(vEvent)) if (GetEventHandler()->ProcessEvent(vEvent))
return; return;
@@ -434,7 +434,7 @@ bool wxSpinCtrl::ProcessTextCommand(
wxString sVal = wxGetWindowText(m_hWndBuddy); wxString sVal = wxGetWindowText(m_hWndBuddy);
vEvent.SetString((char*)sVal.c_str()); vEvent.SetString(sVal);
vEvent.SetInt(GetValue()); vEvent.SetInt(GetValue());
return (GetEventHandler()->ProcessEvent(vEvent)); return (GetEventHandler()->ProcessEvent(vEvent));
} }
@@ -486,7 +486,7 @@ void wxSpinCtrl::SetValue(
{ {
long lVal; long lVal;
lVal = atol(rsText.c_str()); lVal = atol((char*)rsText.c_str());
wxSpinButton::SetValue(lVal); wxSpinButton::SetValue(lVal);
} // end of wxSpinCtrl::SetValue } // end of wxSpinCtrl::SetValue

View File

@@ -109,7 +109,7 @@ bool wxStaticBitmap::Create(
int nWinstyle = SS_ICON; int nWinstyle = SS_ICON;
m_hWnd = (WXHWND)::WinCreateWindow( pParent->GetHWND() m_hWnd = (WXHWND)::WinCreateWindow( pParent->GetHWND()
,wxCanvasClassName ,(PSZ)wxCanvasClassName
,zId ,zId
,nWinstyle | WS_VISIBLE ,nWinstyle | WS_VISIBLE
,0,0,0,0 ,0,0,0,0

View File

@@ -49,7 +49,7 @@ bool wxStaticBox::Create(
wxPoint vPos(0,0); wxPoint vPos(0,0);
wxSize vSize(0,0); wxSize vSize(0,0);
if (!OS2CreateControl( "STATIC" if (!OS2CreateControl( wxT("STATIC")
,SS_GROUPBOX ,SS_GROUPBOX
,vPos ,vPos
,vSize ,vSize
@@ -66,7 +66,7 @@ bool wxStaticBox::Create(
wxColour vColour; wxColour vColour;
vColour.Set(wxString("BLACK")); vColour.Set(wxString(wxT("BLACK")));
LONG lColor = (LONG)vColour.GetPixel(); LONG lColor = (LONG)vColour.GetPixel();

View File

@@ -60,7 +60,7 @@ bool wxStaticLine::Create(
,rsName ,rsName
)) ))
return FALSE; return FALSE;
if (!OS2CreateControl( "STATIC" if (!OS2CreateControl( wxT("STATIC")
,SS_FGNDFRAME ,SS_FGNDFRAME
,rPos ,rPos
,rSize ,rSize
@@ -70,7 +70,7 @@ bool wxStaticLine::Create(
wxColour vColour; wxColour vColour;
vColour.Set(wxString("GREY")); vColour.Set(wxString(wxT("GREY")));
LONG lColor = (LONG)vColour.GetPixel(); LONG lColor = (LONG)vColour.GetPixel();

View File

@@ -83,7 +83,7 @@ bool wxStaticText::Create(
wxColour vColour; wxColour vColour;
vColour.Set(wxString("BLACK")); vColour.Set(wxString(wxT("BLACK")));
LONG lColor = (LONG)vColour.GetPixel(); LONG lColor = (LONG)vColour.GetPixel();
@@ -235,7 +235,7 @@ void wxStaticText::SetLabel(
const wxString& rsLabel const wxString& rsLabel
) )
{ {
::WinSetWindowText(GetHwnd(), rsLabel.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rsLabel.c_str());
// //
// Adjust the size of the window to fit to the label unless autoresizing is // Adjust the size of the window to fit to the label unless autoresizing is

View File

@@ -197,7 +197,7 @@ int wxTabCtrl::GetRowCount() const
wxString wxTabCtrl::GetItemText(int item) const wxString wxTabCtrl::GetItemText(int item) const
{ {
// TODO // TODO
return wxString(""); return wxString(wxEmptyString);
} }
// Get the item image // Get the item image

View File

@@ -354,7 +354,7 @@ void wxTextCtrl::SetValue(
// //
if ((rsValue.length() > 0x400) || (rsValue != GetValue())) if ((rsValue.length() > 0x400) || (rsValue != GetValue()))
{ {
::WinSetWindowText(GetHwnd(), rsValue.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
AdjustSpaceLimit(); AdjustSpaceLimit();
} }
} // end of wxTextCtrl::SetValue } // end of wxTextCtrl::SetValue
@@ -366,7 +366,7 @@ void wxTextCtrl::WriteText(
if (m_bIsMLE) if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0)); ::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
else else
::WinSetWindowText(GetHwnd(), rsValue.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
AdjustSpaceLimit(); AdjustSpaceLimit();
} // end of wxTextCtrl::WriteText } // end of wxTextCtrl::WriteText
@@ -884,14 +884,14 @@ wxString wxTextCtrl::GetLineText(
{ {
long lLen = (long)GetLineLength((long)lLineNo) + 1; long lLen = (long)GetLineLength((long)lLineNo) + 1;
wxString sStr; wxString sStr;
char* zBuf; wxChar* zBuf;
// //
// There must be at least enough place for the length WORD in the // There must be at least enough place for the length WORD in the
// buffer // buffer
// //
lLen += sizeof(WORD); lLen += sizeof(WORD);
zBuf = new char[lLen]; zBuf = new wxChar[lLen];
if (m_bIsMLE) if (m_bIsMLE)
{ {
long lIndex; long lIndex;
@@ -902,7 +902,7 @@ wxString wxTextCtrl::GetLineText(
lIndex = lLen * lLineNo; lIndex = lLen * lLineNo;
::WinSendMsg(GetHwnd(), MLM_SETSEL, (MPARAM)lIndex, (MPARAM)lIndex); ::WinSendMsg(GetHwnd(), MLM_SETSEL, (MPARAM)lIndex, (MPARAM)lIndex);
::WinSendMsg(GetHwnd(), MLM_SETIMPORTEXPORT, MPFROMP(zBuf), MPFROMSHORT((USHORT)sizeof(zBuf))); ::WinSendMsg(GetHwnd(), MLM_SETIMPORTEXPORT, MPFROMP(zBuf), MPFROMSHORT((USHORT)WXSIZEOF(zBuf)));
lBuflen = (long)::WinSendMsg(GetHwnd(), MLM_QUERYFORMATTEXTLENGTH, MPFROMLONG(lIndex), MPFROMLONG(-1)); lBuflen = (long)::WinSendMsg(GetHwnd(), MLM_QUERYFORMATTEXTLENGTH, MPFROMLONG(lIndex), MPFROMLONG(-1));
lCopied = (long)::WinSendMsg(GetHwnd(), MLM_EXPORT, MPFROMP(&lIndex), MPFROMP(&lBuflen)); lCopied = (long)::WinSendMsg(GetHwnd(), MLM_EXPORT, MPFROMP(&lIndex), MPFROMP(&lBuflen));
zBuf[lCopied] = '\0'; zBuf[lCopied] = '\0';
@@ -917,7 +917,7 @@ wxString wxTextCtrl::GetLineText(
,&vParams ,&vParams
,0 ,0
)) ))
memcpy(zBuf, vParams.pszText, vParams.cchText); memcpy((char*)zBuf, vParams.pszText, vParams.cchText);
zBuf[vParams.cchText] = '\0'; zBuf[vParams.cchText] = '\0';
} }
sStr = zBuf; sStr = zBuf;

View File

@@ -366,7 +366,7 @@ bool wxToolBar::Create(
wxClientDC vDC(this); wxClientDC vDC(this);
vDC.SetFont(GetFont()); vDC.SetFont(GetFont());
vDC.GetTextExtent( "XXXX" vDC.GetTextExtent( wxT("XXXX")
,&m_vTextX ,&m_vTextX
,&m_vTextY ,&m_vTextY
); );
@@ -858,7 +858,7 @@ void wxToolBar::DrawTool(
LowerTool(pTool, FALSE); LowerTool(pTool, FALSE);
if (!pTool->IsEnabled()) if (!pTool->IsEnabled())
{ {
wxColour vColor("GREY"); wxColour vColor(wxT("GREY"));
rDc.SetTextForeground(vColor); rDc.SetTextForeground(vColor);
if (!pTool->GetDisabledBitmap().Ok()) if (!pTool->GetDisabledBitmap().Ok())
@@ -873,7 +873,7 @@ void wxToolBar::DrawTool(
} }
else else
{ {
wxColour vColor("BLACK"); wxColour vColor(wxT("BLACK"));
rDc.SetTextForeground(vColor); rDc.SetTextForeground(vColor);
rDc.DrawBitmap( vBitmap rDc.DrawBitmap( vBitmap
@@ -918,7 +918,7 @@ void wxToolBar::DrawTool(
} }
else else
{ {
wxColour vColor("GREY"); wxColour vColor(wxT("GREY"));
LowerTool(pTool); LowerTool(pTool);
rDc.SetTextForeground(vColor); rDc.SetTextForeground(vColor);
@@ -1072,7 +1072,7 @@ void wxToolBar::LowerTool (
,1 ,1
,wxSOLID ,wxSOLID
); );
wxPen vWhitePen( "WHITE" wxPen vWhitePen( wxT("WHITE")
,1 ,1
,wxSOLID ,wxSOLID
); );
@@ -1149,7 +1149,7 @@ void wxToolBar::RaiseTool (
,1 ,1
,wxSOLID ,wxSOLID
); );
wxPen vWhitePen( "WHITE" wxPen vWhitePen( wxT("WHITE")
,1 ,1
,wxSOLID ,wxSOLID
); );

View File

@@ -61,7 +61,7 @@ void wxToolTip::Create(
m_hWnd = ::WinCreateWindow( HWND_DESKTOP m_hWnd = ::WinCreateWindow( HWND_DESKTOP
,WC_ENTRYFIELD ,WC_ENTRYFIELD
,rsTip.c_str() ,(PSZ)rsTip.c_str()
,lStyle ,lStyle
,0, 0, 0, 0 ,0, 0, 0, 0
,NULLHANDLE ,NULLHANDLE
@@ -71,7 +71,7 @@ void wxToolTip::Create(
,NULL ,NULL
); );
if (!m_hWnd) if (!m_hWnd)
wxLogError("Unable to create tooltip window"); wxLogError(_T("Unable to create tooltip window"));
wxColour vColor( wxT("YELLOW") ); wxColour vColor( wxT("YELLOW") );
lColor = (LONG)vColor.GetPixel(); lColor = (LONG)vColor.GetPixel();

View File

@@ -413,7 +413,7 @@ bool wxTopLevelWindowOS2::CreateDialog(
nX = (vSizeDpy.x - nWidth) / 2; nX = (vSizeDpy.x - nWidth) / 2;
nY = (vSizeDpy.y - nHeight) / 2; nY = (vSizeDpy.y - nHeight) / 2;
} }
m_backgroundColour.Set(wxString("LIGHT GREY")); m_backgroundColour.Set(wxString(wxT("LIGHT GREY")));
LONG lColor = (LONG)m_backgroundColour.GetPixel(); LONG lColor = (LONG)m_backgroundColour.GetPixel();
@@ -498,7 +498,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error creating frame. Error: %s\n", sError.c_str()); wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
@@ -510,7 +510,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
wxAssociateWinWithHandle(m_hWnd, this); wxAssociateWinWithHandle(m_hWnd, this);
wxAssociateWinWithHandle(m_hFrame, this); wxAssociateWinWithHandle(m_hFrame, this);
m_backgroundColour.Set(wxString("MEDIUM GREY")); m_backgroundColour.Set(wxString(wxT("MEDIUM GREY")));
LONG lColor = (LONG)m_backgroundColour.GetPixel(); LONG lColor = (LONG)m_backgroundColour.GetPixel();
@@ -522,7 +522,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error creating frame. Error: %s\n", sError.c_str()); wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
@@ -559,7 +559,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error sizing frame. Error: %s\n", sError.c_str()); wxLogError(_T("Error sizing frame. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
lStyle = ::WinQueryWindowULong( m_hWnd lStyle = ::WinQueryWindowULong( m_hWnd
@@ -1087,7 +1087,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent"); static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
if (!::WinRegisterClass( wxGetInstance() if (!::WinRegisterClass( wxGetInstance()
,zHIDDEN_PARENT_CLASS ,(PSZ)zHIDDEN_PARENT_CLASS
,NULL ,NULL
,0 ,0
,sizeof(ULONG) ,sizeof(ULONG)
@@ -1101,7 +1101,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
} }
} }
m_shWnd = ::WinCreateWindow( HWND_DESKTOP m_shWnd = ::WinCreateWindow( HWND_DESKTOP
,m_szClassName ,(PSZ)m_szClassName
,"" ,""
,0L ,0L
,(LONG)0L ,(LONG)0L

View File

@@ -160,9 +160,9 @@ bool wxShell(
SData.FgBg = SSF_FGBG_FORE; SData.FgBg = SSF_FGBG_FORE;
SData.TraceOpt = SSF_TRACEOPT_NONE; SData.TraceOpt = SSF_TRACEOPT_NONE;
SData.PgmTitle = PgmTitle; SData.PgmTitle = PgmTitle;
SData.PgmName = zShell; SData.PgmName = (char*)zShell;
sInputs = "/C " + rCommand; sInputs = _T("/C ") + rCommand;
SData.PgmInputs = (BYTE*)sInputs.c_str(); SData.PgmInputs = (BYTE*)sInputs.c_str();
SData.TermQ = 0; SData.TermQ = 0;
SData.Environment = 0; SData.Environment = 0;
@@ -416,7 +416,7 @@ const wxChar* wxGetHomeDir(
# define MAX_PATH 256 # define MAX_PATH 256
#endif #endif
const wxChar *szHome = wxGetenv("HOME"); const wxChar *szHome = wxGetenv((wxChar*)"HOME");
if ( szHome == NULL ) { if ( szHome == NULL ) {
// we're homeless, use current directory. // we're homeless, use current directory.
rStrDir = wxT("."); rStrDir = wxT(".");
@@ -435,7 +435,7 @@ wxChar* wxGetUserHome (
wxChar* zHome; wxChar* zHome;
wxString sUser1(rUser); wxString sUser1(rUser);
char *wxBuffer = new wxChar[256]; wxChar *wxBuffer = new wxChar[256];
#ifndef __EMX__ #ifndef __EMX__
if (!sUser1.empty()) if (!sUser1.empty())
{ {
@@ -471,7 +471,7 @@ wxChar* wxGetUserHome (
} }
} }
delete[] wxBuffer; delete[] wxBuffer;
return NULL; // No home known! return (wxChar*)wxEmptyString; // No home known!
} }
wxString WXDLLEXPORT wxPMErrorToStr( wxString WXDLLEXPORT wxPMErrorToStr(

View File

@@ -231,7 +231,10 @@ long wxExecute(
while (*ppArgv != NULL) while (*ppArgv != NULL)
{ {
sCommand << *ppArgv++ << ' '; wxString sArg((wxChar*)(*ppArgv++));
sCommand << sArg.c_str() << ' ';
} }
sCommand.RemoveLast(); sCommand.RemoveLast();
return wxExecute( sCommand return wxExecute( sCommand
@@ -263,7 +266,7 @@ bool wxGetFullHostName(
strncpy(zBuf, zComputer, nMaxSize); strncpy(zBuf, zComputer, nMaxSize);
zBuf[nMaxSize] = _T('\0'); zBuf[nMaxSize] = _T('\0');
#else #else
strcpy(zBuf, "noname"); strcpy((char*)zBuf, "noname");
#endif #endif
return *zBuf ? TRUE : FALSE; return *zBuf ? TRUE : FALSE;
return TRUE; return TRUE;

View File

@@ -519,7 +519,7 @@ wxString WXDLLEXPORT wxGetWindowText(
if ( hWnd ) if ( hWnd )
{ {
long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1; long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
::WinQueryWindowText((HWND)hWnd, lLen, wxStringBuffer(vStr, lLen)); ::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen));
} }
return vStr; return vStr;
@@ -536,7 +536,7 @@ wxString WXDLLEXPORT wxGetWindowClass(
for ( ;; ) for ( ;; )
{ {
int nCount = ::WinQueryClassName((HWND)hWnd, nLen, wxStringBuffer(vStr, nLen)); int nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen));
if (nCount == nLen ) if (nCount == nLen )
{ {

View File

@@ -583,7 +583,7 @@ void wxWindowOS2::SetTitle(
const wxString& rTitle const wxString& rTitle
) )
{ {
::WinSetWindowText(GetHwnd(), rTitle.c_str()); ::WinSetWindowText(GetHwnd(), (PSZ)rTitle.c_str());
} // end of wxWindowOS2::SetTitle } // end of wxWindowOS2::SetTitle
wxString wxWindowOS2::GetTitle() const wxString wxWindowOS2::GetTitle() const
@@ -3037,9 +3037,10 @@ void wxAssociateWinWithHandle(
if (pOldWin && (pOldWin != pWin)) if (pOldWin && (pOldWin != pWin))
{ {
wxString str(pWin->GetClassInfo()->GetClassName()); wxString str(pWin->GetClassInfo()->GetClassName());
wxLogError( "Bug! Found existing HWND %X for new window of class %s"
wxLogError( _T("Bug! Found existing HWND %X for new window of class %s")
,(int)hWnd ,(int)hWnd
,(const char*)str ,str.c_str()
); );
} }
else if (!pOldWin) else if (!pOldWin)
@@ -3108,7 +3109,7 @@ WXHWND wxWindowOS2::OS2GetParent() const
bool wxWindowOS2::OS2Create( bool wxWindowOS2::OS2Create(
PSZ zClass PSZ zClass
, const char* zTitle , const wxChar* zTitle
, WXDWORD dwStyle , WXDWORD dwStyle
, const wxPoint& rPos , const wxPoint& rPos
, const wxSize& rSize , const wxSize& rSize
@@ -3154,7 +3155,7 @@ bool wxWindowOS2::OS2Create(
} }
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent() m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
,(PSZ)sClassName.c_str() ,(PSZ)sClassName.c_str()
,(PSZ)zTitle ? zTitle : "" ,(PSZ)(zTitle ? zTitle : wxEmptyString)
,(ULONG)dwStyle ,(ULONG)dwStyle
,(LONG)0L ,(LONG)0L
,(LONG)0L ,(LONG)0L
@@ -3175,7 +3176,7 @@ bool wxWindowOS2::OS2Create(
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
m_backgroundColour.Set(wxString("GREY")); m_backgroundColour.Set(wxString(wxT("GREY")));
LONG lColor = (LONG)m_backgroundColour.GetPixel(); LONG lColor = (LONG)m_backgroundColour.GetPixel();
@@ -3187,7 +3188,7 @@ bool wxWindowOS2::OS2Create(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Error creating frame. Error: %s\n", sError.c_str()); wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
return FALSE; return FALSE;
} }
SetSize( nX SetSize( nX
@@ -3438,7 +3439,7 @@ bool wxWindowOS2::OS2OnDrawItem(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
} }
// //
// Set the color table to RGB mode // Set the color table to RGB mode
@@ -3453,7 +3454,7 @@ bool wxWindowOS2::OS2OnDrawItem(
{ {
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError.c_str()); wxLogError(_T("Unable to set current color table. Error: %s\n"), sError.c_str());
} }
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE ); wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );