From 54081dc5c22c4ef292eb343b4c5b8821ac92dbbd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Apr 2001 00:29:08 +0000 Subject: [PATCH] fixes bug 414369 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/listbox.tex | 4 ++++ src/msw/listbox.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/latex/wx/listbox.tex b/docs/latex/wx/listbox.tex index 0d8465cb80..c7707cb4aa 100644 --- a/docs/latex/wx/listbox.tex +++ b/docs/latex/wx/listbox.tex @@ -39,6 +39,10 @@ select multiple items using the SHIFT key and the mouse or special key combinati \twocolitem{\windowstyle{wxLB\_SORT}}{The listbox contents are sorted in alphabetical order.} \end{twocollist} +Note that {\tt wxLB\_SINGLE}, {\tt wxLB\_MULTIPLE} and {\tt wxLB\_EXTENDED} +styles are mutually exclusive and you can specify at most one of them (single +selection is the default). + See also \helpref{window styles overview}{windowstyles}. \wxheading{Event handling} diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 19a8753d28..a2175877e7 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -157,6 +157,10 @@ bool wxListBox::Create(wxWindow *parent, DWORD wstyle = WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | LBS_NOTIFY | LBS_HASSTRINGS /* | WS_CLIPSIBLINGS */; + + wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), + _T("only one of listbox selection modes can be specified") ); + if (m_windowStyle & wxLB_MULTIPLE) wstyle |= LBS_MULTIPLESEL; else if (m_windowStyle & wxLB_EXTENDED) -- 2.47.2