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

View File

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

View File

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

View File

@ -138,7 +138,7 @@ bool wxBrush::RealizeResource()
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -220,7 +220,7 @@ bool wxBrush::RealizeResource()
{
vError = ::WinGetLastError(vHabmain);
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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ wxWindowDC::wxWindowDC(
{
vError = ::WinGetLastError(vHabmain);
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, m_hDC);
@ -137,7 +137,7 @@ wxWindowDC::wxWindowDC(
{
vError = ::WinGetLastError(vHabmain);
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
,0L
@ -237,7 +237,7 @@ wxClientDC::wxClientDC(
{
vError = ::WinGetLastError(vHabmain);
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
,0L

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -91,7 +91,7 @@ int wxFontDialog::ShowModal()
vChosenFont.SetPointSize(nPointSize);
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;
return wxID_OK;

View File

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

View File

@ -231,7 +231,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
// Set the height according to the font and the border size
//
vDC.SetFont(pStatusBar->GetFont()); // Screws up the menues for some reason
vDC.GetTextExtent( "X"
vDC.GetTextExtent( wxT("X")
,NULL
,&nY
);
@ -304,7 +304,7 @@ void wxFrame::PositionStatusBar()
{
vError = ::WinGetLastError(vHabmain);
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;
}
}
@ -437,14 +437,14 @@ void wxFrame::InternalSetMenuBar()
{
vError = ::WinGetLastError(vHabmain);
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))
{
vError = ::WinGetLastError(vHabmain);
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);
} // end of wxFrame::InternalSetMenuBar

View File

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

View File

@ -32,7 +32,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase)
wxWinHelpController::wxWinHelpController()
{
m_helpFile = "";
m_helpFile = wxEmptyString;
}
wxWinHelpController::~wxWinHelpController()
@ -96,7 +96,7 @@ bool wxWinHelpController::DisplayBlock(long block)
wxString str = m_helpFile;
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");
if (wxTheApp->GetTopWindow())
@ -111,7 +111,7 @@ bool wxWinHelpController::DisplayBlock(long block)
bool wxWinHelpController::KeywordSearch(const wxString& k,
wxHelpSearchMode WXUNUSED(mode))
{
if (m_helpFile == "") return FALSE;
if (m_helpFile == wxEmptyString) return FALSE;
wxString str = m_helpFile;
size_t len = str.Length();

View File

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

View File

@ -60,7 +60,7 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
m_strLocalFilename = localFilename;
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
@ -68,11 +68,11 @@ wxIniConfig::wxIniConfig(const wxString& strAppName,
if ( !wxIsPathSeparator(m_strLocalFilename[(size_t) 0]) &&
m_strLocalFilename.Find('.') == wxNOT_FOUND )
{
m_strLocalFilename << ".ini";
m_strLocalFilename << wxT(".ini");
}
// set root path
SetPath("");
SetPath(wxT(""));
}
wxIniConfig::~wxIniConfig()
@ -105,7 +105,7 @@ void wxIniConfig::SetPath(const wxString& strPath)
m_strPath.Empty();
if ( nPartsCount == 0 ) {
// go to the root
m_strGroup = PATH_SEP_REPLACE;
m_strGroup = (wxChar*)PATH_SEP_REPLACE;
}
else {
// 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
// underscores at the end except if the group is the root one
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) );
}
@ -131,14 +131,14 @@ const wxString& wxIniConfig::GetPath() const
// always return abs path
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
}
else {
s_str << m_strGroup;
if ( !m_strPath.IsEmpty() )
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);
}
}
@ -162,7 +162,7 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
{
wxString strKey;
if ( m_strGroup != wxString(PATH_SEP_REPLACE) )
if (m_strGroup != wxString((wxChar)PATH_SEP_REPLACE))
strKey << m_strGroup << PATH_SEP_REPLACE;
if ( !m_strPath.IsEmpty() )
strKey << m_strPath << PATH_SEP_REPLACE;
@ -179,28 +179,28 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const
// not implemented
bool wxIniConfig::GetFirstGroup(wxString& str, long& lIndex) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
bool wxIniConfig::GetNextGroup (wxString& str, long& lIndex) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
bool wxIniConfig::GetFirstEntry(wxString& str, long& lIndex) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
@ -212,28 +212,28 @@ bool wxIniConfig::GetNextEntry (wxString& str, long& lIndex) const
// not implemented
size_t wxIniConfig::GetNumberOfEntries(bool bRecursive) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return (size_t)-1;
}
size_t wxIniConfig::GetNumberOfGroups(bool bRecursive) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return (size_t)-1;
}
bool wxIniConfig::HasGroup(const wxString& strName) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
bool wxIniConfig::HasEntry(const wxString& strName) const
{
wxFAIL_MSG("not implemented");
wxFAIL_MSG(wxT("not implemeted"));
return FALSE;
}
@ -264,20 +264,20 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr) const
wxConfigPathChanger path(this, szKey);
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
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty(szBuf) ) {
if ( ::IsEmpty((PSZ)szBuf) ) {
// now look in win.ini
wxString strKey = GetKeyName(path.Name());
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
}
if ( ::IsEmpty(szBuf) ) {
if ( ::IsEmpty((PSZ)szBuf) ) {
return FALSE;
}
else {
@ -292,20 +292,20 @@ bool wxIniConfig::Read(const wxString& szKey, wxString *pstr,
wxConfigPathChanger path(this, szKey);
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
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
// GetPrivateProfileString(m_strGroup, strKey, "",
// szBuf, WXSIZEOF(szBuf), m_strLocalFilename);
if ( ::IsEmpty(szBuf) ) {
if ( ::IsEmpty((PSZ)szBuf) ) {
// now look in win.ini
wxString strKey = GetKeyName(path.Name());
// GetProfileString(m_strGroup, strKey, "", szBuf, WXSIZEOF(szBuf));
}
if ( ::IsEmpty(szBuf) ) {
if ( ::IsEmpty((PSZ)szBuf) ) {
*pstr = szDefault;
return FALSE;
}
@ -363,8 +363,8 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& szValue)
bool wxIniConfig::Write(const wxString& szKey, long lValue)
{
// ltoa() is not ANSI :-(
char szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits)
sprintf(szBuf, "%ld", lValue);
wxChar szBuf[40]; // should be good for sizeof(long) <= 16 (128 bits)
wxSprintf(szBuf, wxT("%ld"), lValue);
return Write(szKey, szBuf);
}
@ -430,7 +430,7 @@ bool wxIniConfig::DeleteAll()
// WriteProfileString(GetVendorName(), NULL, NULL);
// then delete our own ini file
char szBuf[MAX_PATH];
wxChar szBuf[MAX_PATH];
size_t nRc = 0; // = GetWindowsDirectory(szBuf, WXSIZEOF(szBuf));
if ( nRc == 0 )
{
@ -438,11 +438,11 @@ bool wxIniConfig::DeleteAll()
}
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;
strFile << '\\' << m_strLocalFilename;
strFile << wxT('\\') << m_strLocalFilename;
if ( !wxRemoveFile(strFile) ) {
wxLogSysError(_("Can't delete the INI file '%s'"), strFile.c_str());

View File

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

View File

@ -353,7 +353,7 @@ bool wxMenu::DoInsertOrAppend(
{
vError = ::WinGetLastError(vHabmain);
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");
return FALSE;
}
@ -560,7 +560,7 @@ void wxMenu::SetTitle(
{
if (!rLabel.IsEmpty())
{
if (!::WinSetWindowText(hMenu, rLabel.c_str()))
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{
wxLogLastError("SetMenuTitle");
}
@ -581,7 +581,7 @@ void wxMenu::SetTitle(
//
// Modify the title
//
if (!::WinSetWindowText(hMenu, rLabel.c_str()))
if (!::WinSetWindowText(hMenu, (PSZ)rLabel.c_str()))
{
wxLogLastError("SetMenuTitle");
}
@ -790,7 +790,7 @@ WXHMENU wxMenuBar::Create()
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -798,7 +798,7 @@ WXHMENU wxMenuBar::Create()
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -809,7 +809,7 @@ WXHMENU wxMenuBar::Create()
{
vError = ::WinGetLastError(vHabmain);
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;
}
}

View File

@ -190,7 +190,7 @@ wxString wxMenuItemBase::GetLabelFromText(
{
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('&'))
{

View File

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

View File

@ -214,7 +214,7 @@ bool wxOwnerDrawn::OnDrawItem(
//
if (eStatus & wxODSelected)
{
wxColour vCol2("WHITE");
wxColour vCol2(wxT("WHITE"));
vColBack.Set( (unsigned char)0
,(unsigned char)0
,(unsigned char)160
@ -300,7 +300,7 @@ bool wxOwnerDrawn::OnDrawItem(
//
// 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 sAccel;
int nIndex;
@ -324,7 +324,7 @@ bool wxOwnerDrawn::OnDrawItem(
//
// Deal with the mneumonic character
//
sTgt = "~";
sTgt = wxT("~");
nIndex = sFullString.Find(sTgt.c_str());
if (nIndex != -1)
{
@ -341,7 +341,7 @@ bool wxOwnerDrawn::OnDrawItem(
,(long *)&nCharWidth
,(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);
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;
}
if (M_PENDATA->m_nStyle == wxTRANSPARENT)
@ -215,7 +215,7 @@ bool wxPen::RealizeResource()
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -300,7 +300,7 @@ bool wxPen::RealizeResource()
{
vError = ::WinGetLastError(vHabmain);
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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,7 +83,7 @@ bool wxStaticText::Create(
wxColour vColour;
vColour.Set(wxString("BLACK"));
vColour.Set(wxString(wxT("BLACK")));
LONG lColor = (LONG)vColour.GetPixel();
@ -235,7 +235,7 @@ void wxStaticText::SetLabel(
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

View File

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

View File

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

View File

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

View File

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

View File

@ -413,7 +413,7 @@ bool wxTopLevelWindowOS2::CreateDialog(
nX = (vSizeDpy.x - nWidth) / 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();
@ -498,7 +498,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -510,7 +510,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
wxAssociateWinWithHandle(m_hWnd, this);
wxAssociateWinWithHandle(m_hFrame, this);
m_backgroundColour.Set(wxString("MEDIUM GREY"));
m_backgroundColour.Set(wxString(wxT("MEDIUM GREY")));
LONG lColor = (LONG)m_backgroundColour.GetPixel();
@ -522,7 +522,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{
vError = ::WinGetLastError(vHabmain);
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;
}
@ -559,7 +559,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
{
vError = ::WinGetLastError(vHabmain);
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;
}
lStyle = ::WinQueryWindowULong( m_hWnd
@ -1087,7 +1087,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
if (!::WinRegisterClass( wxGetInstance()
,zHIDDEN_PARENT_CLASS
,(PSZ)zHIDDEN_PARENT_CLASS
,NULL
,0
,sizeof(ULONG)
@ -1101,7 +1101,7 @@ HWND wxTLWHiddenParentModule::GetHWND()
}
}
m_shWnd = ::WinCreateWindow( HWND_DESKTOP
,m_szClassName
,(PSZ)m_szClassName
,""
,0L
,(LONG)0L

View File

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

View File

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

View File

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

View File

@ -583,7 +583,7 @@ void wxWindowOS2::SetTitle(
const wxString& rTitle
)
{
::WinSetWindowText(GetHwnd(), rTitle.c_str());
::WinSetWindowText(GetHwnd(), (PSZ)rTitle.c_str());
} // end of wxWindowOS2::SetTitle
wxString wxWindowOS2::GetTitle() const
@ -3037,9 +3037,10 @@ void wxAssociateWinWithHandle(
if (pOldWin && (pOldWin != pWin))
{
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
,(const char*)str
,str.c_str()
);
}
else if (!pOldWin)
@ -3108,7 +3109,7 @@ WXHWND wxWindowOS2::OS2GetParent() const
bool wxWindowOS2::OS2Create(
PSZ zClass
, const char* zTitle
, const wxChar* zTitle
, WXDWORD dwStyle
, const wxPoint& rPos
, const wxSize& rSize
@ -3154,7 +3155,7 @@ bool wxWindowOS2::OS2Create(
}
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
,(PSZ)sClassName.c_str()
,(PSZ)zTitle ? zTitle : ""
,(PSZ)(zTitle ? zTitle : wxEmptyString)
,(ULONG)dwStyle
,(LONG)0L
,(LONG)0L
@ -3175,7 +3176,7 @@ bool wxWindowOS2::OS2Create(
SubclassWin(m_hWnd);
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
m_backgroundColour.Set(wxString("GREY"));
m_backgroundColour.Set(wxString(wxT("GREY")));
LONG lColor = (LONG)m_backgroundColour.GetPixel();
@ -3187,7 +3188,7 @@ bool wxWindowOS2::OS2Create(
{
vError = ::WinGetLastError(vHabmain);
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;
}
SetSize( nX
@ -3438,7 +3439,7 @@ bool wxWindowOS2::OS2OnDrawItem(
{
vError = ::WinGetLastError(vHabmain);
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
@ -3453,7 +3454,7 @@ bool wxWindowOS2::OS2OnDrawItem(
{
vError = ::WinGetLastError(vHabmain);
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 );