]> git.saurik.com Git - wxWidgets.git/commitdiff
Compilation fix for wxCStrData handling.
authorStefan Neis <Stefan.Neis@t-online.de>
Fri, 6 Apr 2007 20:31:02 +0000 (20:31 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Fri, 6 Apr 2007 20:31:02 +0000 (20:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/radiobox.cpp
src/os2/spinctrl.cpp
src/os2/stattext.cpp
src/os2/textctrl.cpp
src/os2/tooltip.cpp
src/os2/toplevel.cpp
src/os2/window.cpp

index 3632ef191b8c18b29f6d292792ac4949c7e745ce..26c89bd5ac1a5fa503f4b42cfa1de2cd58f461c6 100644 (file)
@@ -781,7 +781,7 @@ void wxRadioBox::SetString(unsigned int nItem, const wxString& rsLabel)
     wxCHECK_RET( IsValid(nItem), wxT("invalid radiobox index") );
 
     m_pnRadioWidth[nItem] = m_pnRadioHeight[nItem] = -1;
-    ::WinSetWindowText((HWND)m_ahRadioButtons[nItem], (PSZ)rsLabel.c_str());
+    ::WinSetWindowText((HWND)m_ahRadioButtons[nItem], rsLabel.c_str());
 } // end of wxRadioBox::SetString
 
 bool wxRadioBox::SetStringSelection(const wxString& rsStr)
index 6fb50893aac3c162f6dea47561ec571e00a7faa5..2aeef5f3d78cd26f6a432c0b9483500f10115c66 100644 (file)
@@ -456,7 +456,7 @@ void wxSpinCtrl::SetValue(
 {
     long                            lVal;
 
-    lVal = atol((char*)rsText.c_str());
+    lVal = atol(rsText.c_str());
     wxSpinButton::SetValue(lVal);
 } // end of wxSpinCtrl::SetValue
 
index 6d641a4417478b669714e459592d9c92eb4daa43..3f6e73d52285dd2f5245c19ed97f3bb7239d7f79 100644 (file)
@@ -236,7 +236,8 @@ void wxStaticText::SetLabel(
     m_labelOrig = rsLabel;       // save original label
 
     // OS/2 does not support neither ellipsize nor markup in static text:
-    DoSetLabel(GetEllipsizedLabelWithoutMarkup(label));
+    DoSetLabel(rsLabel);
+    DoSetLabel(GetEllipsizedLabelWithoutMarkup());
 
     //
     // Adjust the size of the window to fit to the label unless autoresizing is
@@ -277,7 +278,7 @@ MRESULT wxStaticText::OS2WindowProc(
 void wxStaticText::DoSetLabel(const wxString& str)
 {
     wxString sLabel = ::wxPMTextToLabel(str);
-    ::WinSetWindowText(GetHwnd(), (PSZ)sLabel.c_str());
+    ::WinSetWindowText(GetHwnd(), sLabel.c_str());
 }
 
 wxString wxStaticText::DoGetLabel() const
index 111a63165bd0edd45d4dcec0ddd621b70d2cecd4..24dca77ce6d235e51474846d2a6d370a5adf8c9d 100644 (file)
@@ -160,7 +160,7 @@ bool wxTextCtrl::Create(
     {
         m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                            ,WC_MLE                   // Window class
-                                           ,(PSZ)rsValue.c_str()     // Initial Text
+                                           ,rsValue.c_str()     // Initial Text
                                            ,(ULONG)lSstyle           // Style flags
                                            ,(LONG)0                  // X pos of origin
                                            ,(LONG)0                  // Y pos of origin
@@ -177,7 +177,7 @@ bool wxTextCtrl::Create(
     {
         m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                            ,WC_ENTRYFIELD            // Window class
-                                           ,(PSZ)rsValue.c_str()     // Initial Text
+                                           ,rsValue.c_str()     // Initial Text
                                            ,(ULONG)lSstyle           // Style flags
                                            ,(LONG)0                  // X pos of origin
                                            ,(LONG)0                  // Y pos of origin
@@ -329,7 +329,7 @@ void wxTextCtrl::SetupColours()
 wxString wxTextCtrl::GetValue() const
 {
     wxString                        sStr = wxGetWindowText(GetHWND());
-    char*                           zStr = (char*)sStr.c_str();
+    char*                           zStr = sStr.char_str();
 
     for ( ; *zStr; zStr++ )
     {
@@ -341,7 +341,7 @@ wxString wxTextCtrl::GetValue() const
         if (*zStr == '\r')
             *zStr = '\n';
     }
-    return sStr;
+    return zStr;
 } // end of wxTextCtrl::GetValue
 
 void wxTextCtrl::DoSetValue(
@@ -360,7 +360,7 @@ void wxTextCtrl::DoSetValue(
         if ( flags & SetValue_SendEvent )
             m_bSkipUpdate = true;
 
-        ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
+        ::WinSetWindowText(GetHwnd(), rsValue.c_str());
         AdjustSpaceLimit();
     }
 } // end of wxTextCtrl::SetValue
@@ -370,9 +370,9 @@ void wxTextCtrl::WriteText(
 )
 {
     if (m_bIsMLE)
-        ::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
+        ::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM(rsValue.char_str()), MPARAM(0));
     else
-        ::WinSetWindowText(GetHwnd(), (PSZ)rsValue.c_str());
+        ::WinSetWindowText(GetHwnd(), rsValue.c_str());
     AdjustSpaceLimit();
 } // end of wxTextCtrl::WriteText
 
@@ -1170,11 +1170,17 @@ void wxTextCtrl::AdjustSpaceLimit()
     }
     if (uLen >= uLimit)
     {
-        uLimit = uLen + 0x8000;    // 32Kb
-        if (uLimit > 0xffff)
+        if (m_bIsMLE)
         {
-            uLimit = 0L;
+            uLimit = uLen + 0x8000;    // 32Kb
+            if (uLimit > 0xffff)
+            {
+                uLimit = 0L;
+            }
         }
+        else
+            uLimit = 0x7fff;
+
         if (m_bIsMLE)
             ::WinSendMsg(GetHwnd(), MLM_SETTEXTLIMIT, MPFROMLONG(uLimit), 0);
         else
index 744db82fd5344f09169c31a87c0dcef11c8c352c..300dedee4edecceafd40c9c2aee5fdac946111e7 100644 (file)
@@ -61,7 +61,7 @@ void wxToolTip::Create(
 
     m_hWnd = ::WinCreateWindow( HWND_DESKTOP
                                ,WC_ENTRYFIELD
-                               ,(PSZ)rsTip.c_str()
+                               ,rsTip.c_str()
                                ,lStyle
                                ,0, 0, 0, 0
                                ,NULLHANDLE
index 94819c9f83a6d1acf61868552477323a45ed972f..8b467cc7c7e3b349c9813163b767f66df2b34eac 100644 (file)
@@ -484,8 +484,8 @@ bool wxTopLevelWindowOS2::CreateFrame( const wxString& rsTitle,
      hFrame = ::WinCreateStdWindow( hParent
                                    ,ulStyleFlags          // frame-window style
                                    ,(PULONG)&lFlags       // window style
-                                   ,(PSZ)wxFrameClassName // class name
-                                   ,(PSZ)rsTitle.c_str()  // window title
+                                   ,wxFrameClassName // class name
+                                   ,rsTitle.c_str()  // window title
                                    ,0L                    // default client style
                                    ,NULLHANDLE            // resource in executable file
                                    ,0                     // resource id
@@ -553,7 +553,7 @@ bool wxTopLevelWindowOS2::CreateFrame( const wxString& rsTitle,
     //
     if (nWidth == (int)CW_USEDEFAULT)
     {
-       //
+        //
         // The exact number doesn't matter, the dialog will be resized
         // again soon anyhow but it should be big enough to allow
         // calculation relying on "totalSize - clientSize > 0" work, i.e.
index 43c6a8f13ab6ba3dc73a638292f443bdb0ad3859..31fda2d2e40b607ff4230976a26258b7c4f08768 100644 (file)
@@ -512,7 +512,7 @@ void wxWindowOS2::Lower()
 
 void wxWindowOS2::SetLabel( const wxString& label )
 {
-    ::WinSetWindowText(GetHwnd(), (PSZ)label.c_str());
+    ::WinSetWindowText(GetHwnd(), label.c_str());
 } // end of wxWindowOS2::SetLabel
 
 wxString wxWindowOS2::GetLabel() const
@@ -1681,7 +1681,7 @@ void wxWindowOS2::GetTextExtent( const wxString& rString,
     l = rString.length();
     if (l > 0L)
     {
-        pStr = (PCH)rString.c_str();
+        pStr = rString.char_str();
 
         //
         // In world coordinates.
@@ -2971,8 +2971,8 @@ bool wxWindowOS2::OS2Create( PSZ            zClass,
         sClassName += wxT("NR");
     }
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
-                                       ,(PSZ)sClassName.c_str()
-                                       ,(PSZ)(zTitle ? zTitle : wxEmptyString)
+                                       ,sClassName.c_str()
+                                       ,(zTitle ? zTitle : wxEmptyString)
                                        ,(ULONG)dwStyle
                                        ,(LONG)0L
                                        ,(LONG)0L