]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/listbox.cpp
Added wxUSE_RICHEDIT to match usage in header
[wxWidgets.git] / src / os2 / listbox.cpp
index d23bedc5125dbf0d97312db157f0250457a86cc6..968cd9a851b95f46d1e77b2775c8611b602df2a8 100644 (file)
@@ -421,8 +421,18 @@ bool wxListBox::IsSelected(
 
     LONG                            lItem;
 
 
     LONG                            lItem;
 
-    lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)N, (MPARAM)0));
-    return (lItem != LIT_NONE);
+    if (GetWindowStyleFlag() & wxLB_EXTENDED)
+    {
+        if (N == 0)
+            lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
+        else
+            lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)(N - 1), (MPARAM)0));
+    }
+    else
+    {
+        lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
+    }
+    return (lItem == (LONG)N && lItem != LIT_NONE);
 } // end of wxListBox::IsSelected
 
 wxClientData* wxListBox::DoGetItemClientObject(
 } // end of wxListBox::IsSelected
 
 wxClientData* wxListBox::DoGetItemClientObject(