From 174e8f077c544c80ed6d47b3b42b845e33cd7b9c Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Wed, 26 Oct 2022 14:44:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit listbox getcurrentselection 浼樺寲 --- funcext/tvclib/utslvclstdctl.tsf | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index 5d1c436..19ffc4c 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -3257,10 +3257,30 @@ type TcustomListBox=class(TCustomListBoxbase) {** @explan(说明)获取当前选中项的索引,仅用于单选的列表框%% **} - if FMultisel=0 then - begin - return FSelBegin; - end + case FMultisel of + 0: //单选 + begin + return FSelBegin; + end + 1: //连续选择 + begin + return array(FSelBegin,FSelEnd); + end + 2: //间断选择 + begin + r := array(); + rl := 0; + for i,v in FMultisel3Data do + begin + if v then + begin + r[rl] := i; + rl++; + end + end + return r; + end + end return -1; end function setCurrentSelection(n);virtual;