From 35e7ed4ea516b6c3a3cddae49f98954ff1d408ae Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Tue, 15 Nov 2022 16:53:26 +0800 Subject: [PATCH] Update udesignerproject.tsf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化设计器 --- designer/udesignerproject.tsf | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/designer/udesignerproject.tsf b/designer/udesignerproject.tsf index ffc0f22..db42707 100644 --- a/designer/udesignerproject.tsf +++ b/designer/udesignerproject.tsf @@ -2554,7 +2554,7 @@ type tinheritedimput = class(TVCForm) top=40 visible=true width=274 - onselectionchange=listselchanged + onselchanged=listselchanged end object btn1:tbtn caption="È¡Ïû" @@ -2609,7 +2609,16 @@ type tinheritedimput = class(TVCForm) idx := o.getCurrentSelection(); if idx>=0 then begin - edit1.text := o.getItemText(idx)+"1"; + + s := o.getItemText(idx); + n := 1; + while true do + begin + ns := s+inttostr(n); + if not(fns[ns]) then break; + n++; + end + edit1.text := ns; end end function getinfo(); @@ -2619,6 +2628,7 @@ type tinheritedimput = class(TVCForm) function setinfo(); begin ss := array(); + fns := array(); if parent then begin tr := parent.tree; @@ -2626,7 +2636,9 @@ type tinheritedimput = class(TVCForm) tr.GetNodesBytype(fnds,array("form","panel")); for i,v in fnds do begin - ss[i] := v.Fname; + s := v.Fname; + ss[i] := s; + fns[s] := true; end end listbox1.Items := ss; @@ -2634,6 +2646,7 @@ type tinheritedimput = class(TVCForm) end public //³ÉÔ±±äÁ¿ fnds; + fns; label3; listbox1; btn1;