X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3437f881c4270fc52365b507100f36afe837aee5..cc164686f3dc689732395f11210c5bb9a76b6ff2:/src/os2/listbox.cpp?ds=sidebyside diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index d23bedc512..968cd9a851 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -421,8 +421,18 @@ bool wxListBox::IsSelected( 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(