]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/choice.cpp
send more page change events (patch 750521); document this behaviour
[wxWidgets.git] / src / os2 / choice.cpp
index 5ae8def9d95b1fb354d45f41c700eca51a168941..6098b3afa471faf797745c9081ea096616bdc5b6 100644 (file)
@@ -111,6 +111,32 @@ int wxChoice::DoAppend(
     return nIndex;
 } // end of wxChoice::DoAppend
 
+int wxChoice::DoInsert(
+  const wxString&                   rsItem,
+  int                               pos
+)
+{
+    wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
+    wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index"));
+
+    if (pos == GetCount())
+        return DoAppend(rsItem);
+
+    int                             nIndex;
+    SHORT                           nIndexType = 0;
+
+    if (m_windowStyle & wxLB_SORT)
+        nIndexType = LIT_SORTASCENDING;
+    else
+        nIndexType = pos;
+    nIndex = (int)::WinSendMsg( GetHwnd()
+                               ,LM_INSERTITEM
+                               ,(MPARAM)nIndexType
+                               ,(MPARAM)rsItem.c_str()
+                              );
+    return nIndex;
+} // end of wxChoice::DoInsert
+
 void wxChoice::Delete(
   int                               n
 )