]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/choice.cpp
1. derive wxGTK wxRadioBox from wxRadioBoxBase now, as in all other ports
[wxWidgets.git] / src / os2 / choice.cpp
index 7a5cee50855d16c24309d0386915790d1183e5db..8235ed353217ecb2283c786fabe413f2f6025fa9 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        choice.cpp
+// Name:        src/os2/choice.cpp
 // Purpose:     wxChoice
 // Author:      David Webster
 // Modified by:
@@ -201,38 +201,10 @@ int wxChoice::GetCount() const
     return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0)));
 } // end of wxChoice::GetCount
 
-int wxChoice::FindString(
-  const wxString&                   rsStr
-) const
-{
-    int                             nPos;
-    int                             nTextLength;
-    PSZ                             zStr;
-    int                             nItemCount;
-
-    nItemCount = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0));
-    for (nPos = 0; nPos < nItemCount; nPos++)
-    {
-        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 == (wxChar*)zStr)
-        {
-            delete [] zStr;
-            break;
-        }
-        delete [] zStr;
-    }
-    return nPos;
-} // end of wxChoice::FindString
-
-void wxChoice::SetString(
-  int                               n
-, const wxString&                   rsStr
-)
+void wxChoice::SetString( int n, const wxString& rsStr )
 {
-    LONG                            nIndexType = 0;
-    void*                           pData;
+    LONG  nIndexType = 0;
+    void* pData;
 
     if ( m_clientDataItemsType != wxClientData_None )
     {
@@ -263,13 +235,11 @@ void wxChoice::SetString(
     }
 } // end of wxChoice::SetString
 
-wxString wxChoice::GetString(
-  int                               n
-) const
+wxString wxChoice::GetString(int n) const
 {
-    int                             nLen = 0;
-    wxString                        sStr = wxEmptyString;
-    wxChar*                         zBuf;
+    int      nLen = 0;
+    wxString sStr = wxEmptyString;
+    wxChar*  zBuf;
 
     nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
     if (nLen != LIT_ERROR && nLen > 0)
@@ -327,13 +297,11 @@ wxClientData* wxChoice::DoGetItemClientObject(
 // wxOS2 specific helpers
 // ----------------------------------------------------------------------------
 
-void wxChoice::DoSetSize(
-  int                               nX
-, int                               nY
-, int                               nWidth
-, int                               nHeight
-, int                               nSizeFlags
-)
+void wxChoice::DoSetSize(int nX,
+                         int nY,
+                         int nWidth,
+                         int WXUNUSED(nHeight),
+                         int nSizeFlags)
 {
     //
     // Ignore height parameter because height doesn't mean 'initially
@@ -345,7 +313,7 @@ void wxChoice::DoSetSize(
     wxControl::DoSetSize( nX
                          ,nY
                          ,nWidth
-                         ,-1
+                         ,wxDefaultCoord
                          ,nSizeFlags
                         );
 } // end of wxChoice::DoSetSize