From: Stefan Csomor Date: Sun, 18 Nov 2001 18:14:07 +0000 (+0000) Subject: corrected MacSetSelection which was incorrectly deselecting also the previously selec... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f47db8f0676be7807693de8bc38c4851c37f56a2?hp=8e72b8b51770b59a83eb32f4d766b89f6c4dc615 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 --- 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 ;