From b64606ef50b058fd6b2cf10a676adf93bbcf0144 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 30 Jun 2023 10:36:22 +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 修正问题 --- designer/utslvcldcomponents.tsf | 4 +- funcext/tvclib/utslmemo.tsf | 7 +- funcext/tvclib/utslvclauxiliary.tsf | 99 +++++++++++++++-------------- funcext/tvclib/utslvclgdi.tsf | 4 +- 4 files changed, 59 insertions(+), 55 deletions(-) diff --git a/designer/utslvcldcomponents.tsf b/designer/utslvcldcomponents.tsf index 8f852a4..bba52d8 100644 --- a/designer/utslvcldcomponents.tsf +++ b/designer/utslvcldcomponents.tsf @@ -1394,7 +1394,9 @@ type TImageListWindow = class(TDVirutalWindow) function Create(AOwner);override; begin inherited; - WindowFileds := array("left","top","height","width"); + width := 30; + height := 30; + WindowFileds := array("left","top"); BindComp := new TControlImageList(self);; end function bitmapinfo();override; diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index 6dbccea..5f53fa6 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -1371,7 +1371,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // end function DoCaretPosChanged();virtual;//caretλÖøıä begin - if foncaretposchanged and fcaretcreated then + if foncaretposchanged and ( fcaretcreated or ReadOnly) then begin e := new tuieventbase(0,0,0,0); CallMessgeFunction(foncaretposchanged,self(true),e); @@ -1386,8 +1386,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // begin fLines.text := ""; FCaretX := FCaretY := 1; - FSelBegin := array(1,1); - FSelEnd := array(1,1); + fBlockBegin := array(1,1); + fBlockEnd := array(1,1); ClearUndo(); memtextchanged(array(1,1)); end @@ -2193,6 +2193,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // if ifstring(s)and fCaretY>0 and fCaretY <= fLines.Length()then begin fLines.SetValueByIndex(fCaretY-1,s); + memtextchanged(array(fcarety,1)); //InvalidateLines(fCaretY-1,fCaretY-1); end end diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index 3045b4a..edbc2ff 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -896,16 +896,7 @@ type tnumindexarray = Class() //ջģ {** @explan(˵Ã÷) ÔÚĩβ׷¼ÓÔªËØ,²ÎÊý¸öÊý²»¶¨ %% **} - r := fdlength; - r1 := r; - for i := 0 to ParamCount-1 do - begin - FData[r]:= Params[i+1]; - r++; - end - fdlength := r; - if r1 <> r then LengthChanged(r1-r); - return r; + return pushs(params); end function Pop(); begin @@ -961,33 +952,8 @@ type tnumindexarray = Class() //ջģ end function splice({startid,sellength,value1,valfue2,....}); begin - {** - @explan(˵Ã÷) Ìæ»»ÔªËØ,µÚÒ»¸ö²ÎÊýΪ¿ªÊ¼Î»ÖÃ,µÚ¶þ¸öÎªÌæ»»µÄ¸öÊý,ÒÔºóµÄ²ÎÊýΪÓÃÀ´Ìæ»»µÄÖµ,·µ»Ø±»Ìæ»»µÄÖµ%% - **} p := params; - st := p[0]; - if not(st>=0) then st := 0; - sl := p[1]; - sl := ifnil(sl)?inf:sl; - sl := (sl>=0)?sl:0; - len := fdlength; - st := st<0?0:st; - st := st >= len?(len):st; - et := st+sl; - et := et >= len?(len):et; - r := array(); - {idx := 0; - for i := st to et-1 do - begin - r[idx++]:= FData[i]; - end } - r := FData[st:(et-1)]; - r1 := FData[0:st-1]; - r2 := FData[et:len-1]; - FData := r1 union p[2:] union r2; - fdlength := ::length(FData); - if len <> fdlength then LengthChanged(fdlength-len); - return r; + return splices(p[0],p[1],p[2:]); end function shift(); begin @@ -1009,14 +975,7 @@ type tnumindexarray = Class() //ջģ {** @explan(˵Ã÷) ÔÚÊý¾ÝÍ·²¿¼ÓÈëÔªËØ,¸öÊý´ý¶¨ %% **} - p := Params; - if p then - begin - FData := p union FData; - fdlength := ::length(FData); - LengthChanged(1); - end - return fdlength; + return unshifts(params); end function swap(i,j); begin @@ -1036,16 +995,58 @@ type tnumindexarray = Class() //ջģ end function pushs(vs); begin - return callinarray(thisfunction(push),vs); + if not(vs) and length(vs) then return r; + r := fdlength; + r1 := r; + for i := 0 to length(vs)-1 do + begin + FData[r]:= vs[i]; + r++; + end + fdlength := r; + if r1 <> r then LengthChanged(r1-r); + return r; end function unshifts(vs); - begin - return callinarray(thisfunction(unshift),vs); + begin + if ifarray(vs) and vs then + begin + FData := vs union FData; + fdlength := ::length(FData); + LengthChanged(1); + end + return fdlength; end function splices(startid,sellength,vs); begin - if ifarray(vs)then return callinarray(thisfunction(splice),array(startid,sellength) union vs); - return array(); + {** + @explan(˵Ã÷) Ìæ»»ÔªËØ,µÚÒ»¸ö²ÎÊýΪ¿ªÊ¼Î»ÖÃ,µÚ¶þ¸öÎªÌæ»»µÄ¸öÊý,ÒÔºóµÄ²ÎÊýΪÓÃÀ´Ìæ»»µÄÖµ,·µ»Ø±»Ìæ»»µÄÖµ%% + **} + st := startid; + if not(st>=0) then st := 0; + sl := sellength; + sl := ifnil(sl)?inf:sl; + sl := (sl>=0)?sl:0; + len := fdlength; + st := st<0?0:st; + st := st >= len?(len):st; + et := st+sl; + et := et >= len?(len):et; + r := array(); + r := FData[st:(et-1)]; + r1 := FData[0:st-1]; + r2 := FData[et:len-1]; + if ifarray(vs) and vs then + begin + FData := r1 union vs union r2; + + end else + begin + FData := r1 union r2; + end + fdlength := ::length(FData); + if len <> fdlength then LengthChanged(fdlength-len); + return r; end function LengthChanged(n);virtual; begin diff --git a/funcext/tvclib/utslvclgdi.tsf b/funcext/tvclib/utslvclgdi.tsf index 9394f8a..e6a541b 100644 --- a/funcext/tvclib/utslvclgdi.tsf +++ b/funcext/tvclib/utslvclgdi.tsf @@ -2073,8 +2073,8 @@ type TCustomImageList=class(tcomponent) property Handle read HandleNeeded write SetHandle; property AutoDestroy read FAutoDestroy write FAutoDestroy; property ImageCount read FimageCount; - property Height:integer read FHeight write Setheight; - property Width:integer read FWidth write SetWidth; + property Height read FHeight write Setheight; + property Width read FWidth write SetWidth; property imgHeight:integer read FHeight write Setheight; property imgWidth:integer read FWidth write SetWidth; property OnChange read FOnChange write FOnChange;