From f47db8f0676be7807693de8bc38c4851c37f56a2 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 18 Nov 2001 18:14:07 +0000 Subject: [PATCH] corrected MacSetSelection which was incorrectly deselecting also the previously selected line when using multiselect git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listbox.cpp | 7 +++++-- src/mac/listbox.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index f6c1403b1c..d4dbdffb51 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -663,9 +663,12 @@ void wxListBox::MacClear() void wxListBox::MacSetSelection( int n , bool select ) { Cell cell = { 0 , 0 } ; - if ( LGetSelect( true , &cell , m_macList ) ) + if ( ! (m_windowStyle & wxLB_MULTIPLE) ) { - LSetSelect( false , cell , m_macList ) ; + if ( LGetSelect( true , &cell , m_macList ) ) + { + LSetSelect( false , cell , m_macList ) ; + } } cell.v = n ; diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp index f6c1403b1c..d4dbdffb51 100644 --- a/src/mac/listbox.cpp +++ b/src/mac/listbox.cpp @@ -663,9 +663,12 @@ void wxListBox::MacClear() void wxListBox::MacSetSelection( int n , bool select ) { Cell cell = { 0 , 0 } ; - if ( LGetSelect( true , &cell , m_macList ) ) + if ( ! (m_windowStyle & wxLB_MULTIPLE) ) { - LSetSelect( false , cell , m_macList ) ; + if ( LGetSelect( true , &cell , m_macList ) ) + { + LSetSelect( false , cell , m_macList ) ; + } } cell.v = n ; -- 2.47.2