]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode fixes for OS/2
authorDavid Webster <Dave.Webster@bhmi.com>
Wed, 27 Apr 2005 01:19:43 +0000 (01:19 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Wed, 27 Apr 2005 01:19:43 +0000 (01:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

46 files changed:
src/os2/app.cpp
src/os2/bitmap.cpp
src/os2/bmpbuttn.cpp
src/os2/brush.cpp
src/os2/checkbox.cpp
src/os2/checklst.cpp
src/os2/choice.cpp
src/os2/combobox.cpp
src/os2/control.cpp
src/os2/dataobj.cpp
src/os2/dc.cpp
src/os2/dcclient.cpp
src/os2/dialog.cpp
src/os2/dir.cpp
src/os2/dnd.cpp
src/os2/filedlg.cpp
src/os2/font.cpp
src/os2/fontdlg.cpp
src/os2/fontutil.cpp
src/os2/frame.cpp
src/os2/gauge.cpp
src/os2/helpwin.cpp
src/os2/icon.cpp
src/os2/iniconf.cpp
src/os2/listbox.cpp
src/os2/menu.cpp
src/os2/menuitem.cpp
src/os2/notebook.cpp
src/os2/ownerdrw.cpp
src/os2/pen.cpp
src/os2/radiobox.cpp
src/os2/slider.cpp
src/os2/spinctrl.cpp
src/os2/statbmp.cpp
src/os2/statbox.cpp
src/os2/statline.cpp
src/os2/stattext.cpp
src/os2/tabctrl.cpp
src/os2/textctrl.cpp
src/os2/toolbar.cpp
src/os2/tooltip.cpp
src/os2/toplevel.cpp
src/os2/utils.cpp
src/os2/utilsexc.cpp
src/os2/utilsgui.cpp
src/os2/window.cpp

index faf14e9be7eb7363e3fcdb80a9b4c87562accb6c..7193a4379ed6f1d1870304f0162ee1b48d1b04c7 100644 (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)
index 9d81414df6f7f150183a2d461e298f82d3670ce9..8c93cc751fb409a52c36811ff8b40bcb6f12bd9b 100644 (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
index f30e54aa7ec78da1e913f0ee6035e116f29fea44..af6dae09c1a10959ddb4d609fbc9ced18fdcd3aa 100644 (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)
index 8187fbf42c882f17c7c30e6c623e4a4fdd5ea7a0..308d5bb1d4ded8dc04fbacf0bb49b54660830bcb 100644 (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;
     }
index 83480a8ef2ff54c281fd68f3c1e27b536de6e982..547270a72da9f44657407e29751dcb6498a055f0 100644 (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
index 0f280685810fd28fe934d755e92688ee75654c33..c1a5a5cc09618356521fc8c66a688c4b8dffe179 100644 (file)
@@ -88,7 +88,7 @@ wxCheckListBoxItem::wxCheckListBoxItem (
   wxCheckListBox*                   pParent
 , size_t                            nIndex
 )
-: wxOwnerDrawn( ""
+: wxOwnerDrawn( wxEmptyString
                ,TRUE // checkable
               )
 {
index 9e4e5e1378557ef75b7ce4f141c244c13ce9ef18..7a5cee50855d16c24309d0386915790d1183e5db 100644 (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())
index 2a3f669fe96155038908a60dcfdd335c267b95ec..6f342c5506a4c2f843bfeff1a1059ce15161c51e 100644 (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
 
 //
index d515341c841da76459306c02b6f3fd79139dc08b..d3db1d4e50b1e58616e59694af3bc0e63c38e269 100644 (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
 
 // ---------------------------------------------------------------------------
index 880095708b357858a7e65f9743f0eb62cefe582a..e0941f626816903b2a1bc69470d28aa81084dd46 100644 (file)
 
 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);
 
index 092efc360ccd6bde904beaf0b54a882a79773b8d..7c82a9c6c1820b5a4a7361092338c8ec14cddec1 100644 (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
                          );
index d02dd2bdcfcd694567846b5c7805f9ea6dc4ddd1..566e3d59a00b3195ed6e561164cf77d33983c9b9 100644 (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
index 820367c6d432e779d21aafeb1eb0849c1828d90e..81a0ff45e788a9f39911ed30967288f2a1b25d98 100644 (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 )
     {
index ab35717cbffc416ac5bee054a1a9a9c939a95e7a..e0eb0cbb163a7631a5051f31714e9a7e52dd8388 100644 (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(
index 02cbfdd23fa9447b571bc98837c71e56877d0032..1dddfa4b66f5da84e1c65691979e3d26a0fffa08 100644 (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
index efaec2a6c9de3b0c033b5892d9dfa19ae9998933..c7e65a98a02a7348bfb92b70a37876ff41b92705 100644 (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 >>============================
index 517053a9155ed3e5f432b5636608b87a32ff20b9..dfa8111a51959434c5477941dd3f28e7a092bde6 100644 (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
 
index e6794d8d402a69e0473670c2c53f145ad60f24e6..ca3bb8fd671e308ceb0f2e3f63e0848d52606bf9 100644 (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;
index 264d0b7b2d2044013db17ddc7f9425004ee47e15..aac250ae03a74c659176a5520666b01393f85d23 100644 (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);
index 8a8545f7c8e50b186748da3c3c83a2cc2d28bc8b..a4258e5af630eb91e94daf6f096cb0f9e30a12e9 100644 (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
index 3ad621de7393ce08c5d3fea0de7086f024c7d79a..6d1486b192dc6228516c60b922f0d9561cf1a686 100644 (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;
index 9c398cc1854e1eec7dfe6091577447538ad1d775..95f57925c1320d7e48f2325f0d84b503281583d2 100644 (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();
index afc541b13f4ef322ba6b01a78ee13259ab269914..8b31bf4b087ec9990e2f56e7960f801a06baf13e 100644 (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
index 9ad3a3c367a5e09fd3df8e19f42aa2a5f092c331..df53ce5f2139ca591c916be4468d6428b41dffb0 100644 (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());
index 1d49e7c6016b29910d104001ccbc369aa32402b3..dacc04c2b667ff44137fbba33666e869874f2b24 100644 (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;
index 59307fbdc3dff3b655a6469e83c2ad36ddfda621..ae9fb9d429af3a20db19015707764b59699c1797 100644 (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;
             }
         }
index a3180a5ae8fe14940d49019eee9c7be3c9203d4b..6b9a515788f3f0c23b3699b079999640cd171b8d 100644 (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('&'))
         {
index f792c76a6057c50f1c2f0e5363bd2dd8f80e3aaa..398290e166e4855d9a02f520d23b7a340997d88f 100644 (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
 
index 6ce8bbf2bd0a5d6e593c03a6627b9c6187ff1937..bf2684f6bb2f1664c31e8f03ed7de1a8eb7376d5 100644 (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);
     }
 
     //
index 77badbd512ec44d2e4de8745851c962ac470fb95..3821b69f7dac46dd171c28fee28b27709b732233 100644 (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;
     }
index 1f789a294ff9bf3f903f7253ebb0d288afcdb079..1241756dd085f04478839d0dd386f1481134070c 100644 (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(
index 1dec64ffc2a85aad015711f21b94d11606d47b91..1c806c968ab6865da230b440ff56ae1acf7ee70d 100644 (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
 
index 7a05daa6356a6e5aba5e2b3b1e32604d48ea1db0..b74642b7caab5955a7a0736320105bf277e57c37 100644 (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
 
index 09af143f46a4075e1f8a14d44f824cf8c54331d8..ed401f97db67a139d73dfbffc3f2a87e2335ac1d 100644 (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
index 470c2380e974811690985ddf832d1f39fad443af..cb5a1b6aa0e7802e06546adc270b44e7f54d75e8 100644 (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();
 
index cd3343c3be9eb2f2ff24154cfaf921e209d81024..dd7ca77231b0675c8f3f481f014d1f110fd9f369 100644 (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();
 
index d5cfd5c9e4a629b482f66992ac71adbdc0e0e10a..4febe1ee27b750a262d0f4ab999475531cabc530 100644 (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
index 1b664f8b16d864cc0b44801622af4273548cc255..17f96a705d623ca7b780efe280b76167f8e7e090 100644 (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
index d315a58b5caf08293ec3da7809e4dac4e9213bf5..f02d4af9db69948678f79de3db726d5723cb4076 100644 (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;
index 56ab55267781c55d6a6e077bfe7e1f86d5c40299..def07d219204641cfa5ee8247d0eb7b72b3c3672 100644 (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
                                              );
index 09b70270e2008564d1204eb9afa881e33a8878b7..744db82fd5344f09169c31a87c0dcef11c8c352c 100644 (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();
index 1687a5b7ab20d14b93ecd8880ae5b71b66019fd2..242f6c7ab1cf73bb334d98a71641e5c9763145c6 100644 (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
index f29aafc86b204b42f4e658b23a64a4744bc9b190..a2f9dafe5ad45ad92ab0a7960eb69ba11c9c58cc 100644 (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(
index f03454c49afd159f3cd979dbff6a2f48146e0b4c..3e9d94a0bfa67d25e54da9e04f8e58bdbc91343f 100644 (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;
index a48d2a09369511990a0a8d185dfaa199895e5015..8ccbed4f91bfce2e5706c45ac0d526c927598f6d 100644 (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 )
            {
index 7458e0eb703120c837ad4af39e8e5ef949e1798f..5bbfaf1fde2646849ce78880bbb47f31fe219b6b 100644 (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 );