From 895066d8c8434672ad0612c3b7d138057695c700 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 5 Feb 2003 23:30:36 +0000 Subject: [PATCH] Scintilla uses a -1 index to unselect, we need to catch that. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/PlatWX.cpp | 7 ++++++- src/stc/PlatWX.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 54ba588dd1..fbf1faf2a3 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -815,7 +815,12 @@ int ListBox::Length() { } void ListBox::Select(int n) { - GETLB(id)->SetSelection(n); + bool select = TRUE; + if (n == -1) { + n = 0; + select = FALSE; + } + GETLB(id)->SetSelection(n, select); #ifdef __WXGTK__ if (n > 4) n = n - 4; diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 54ba588dd1..fbf1faf2a3 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -815,7 +815,12 @@ int ListBox::Length() { } void ListBox::Select(int n) { - GETLB(id)->SetSelection(n); + bool select = TRUE; + if (n == -1) { + n = 0; + select = FALSE; + } + GETLB(id)->SetSelection(n, select); #ifdef __WXGTK__ if (n > 4) n = n - 4; -- 2.45.2