From 1c0fe312331947014df94cf6f7249594895cc603 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Tue, 18 Apr 2023 16:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正namespace导致变慢的问题 --- designer/utslcodeeditor.tsf | 1 + designer/utslsynmemo.tsf | 42 +++++++----- funcext/tvclib/tcustomscrollcontrol.tsf | 14 ++-- funcext/tvclib/ugtkinterface.tsf | 88 ++++++++++++++++++------- 4 files changed, 99 insertions(+), 46 deletions(-) diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index cbab7f8..e20d9d1 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -3955,6 +3955,7 @@ type TEditer=class(TCustomcontrol) // begin for i,v in fs do begin + if not FIsFinding then break; ri := matchword(i,d); if ri then begin diff --git a/designer/utslsynmemo.tsf b/designer/utslsynmemo.tsf index 343ede5..af09bff 100644 --- a/designer/utslsynmemo.tsf +++ b/designer/utslsynmemo.tsf @@ -1795,7 +1795,6 @@ type TTsfFileParser = class() // end "parserstring": begin - mtic; r := parserstring(o,d); return r; end @@ -1863,7 +1862,7 @@ type TTsfFileParser = class() // function parserstring(o,d); begin rti := 0; - rt := array(); + rt := array(); m := d["minus"]; if ifstring(m) then m := lowercase(m); filechanged(m); @@ -2147,7 +2146,7 @@ type TTsfFileParser = class() // begin return ReadParseredFile((n+".tsf"),true); end - end + end function parserafile(dir,v); begin fn := lowercase( v["FileName"]); @@ -2242,11 +2241,8 @@ type TTsfFileParser = class() // if FCacheDir then begin fn := FCacheDir+fiofs+"lasttime"+fiofs+ModifyFname(n)+".t"; - if importfile(ftstream(),"",fn,d)=1 and ifarray(d) then - begin - nns := d["nspace"]; - nn := d["name"]; - FNsCaches[nn][nns] := 1; + if importfile(ftstream(),"",fn,d)=1 then + begin return d; end end @@ -2254,22 +2250,36 @@ type TTsfFileParser = class() // function ReadParseredFile(n,g); //ȡļ begin if FCacheDir then - begin + begin + ln := lowercase(n); if not ifarray(FFilePaths) then FFilePaths := array(); - if not(FFileNames[lowercase(n)]) then return ; + if not(FFileNames[ln]) then return ; if not ifarray(FCacheS ) then FCacheS := array(); - d := FCacheS[lowercase(n)]; - if d then + fp := FCacheS[ln,"fullpath"]; + if fp then begin - FFilePaths[lowercase(n)] := d["fullpath"]; - if g then return d; + FFilePaths[ln] := fp; + nns := FCacheS[ln,"nspace"]; + if nns then + begin + nn := FCacheS[ln,"name"]; + FNsCaches[nn][nns] := 1; + end + if g then return FCacheS[ln]; return 1; end fn := FCacheDir+fiofs+ModifyFname(n)+".p"; if importfile(ftstream(),"",fn,d)=1 and ifarray(d) then begin - FCacheS[lowercase(n)] := d;//new tparserdobject(d); - FFilePaths[lowercase(n)] := d["fullpath"]; + FCacheS[ln] := d;//new tparserdobject(d); + FFilePaths[ln] := d["fullpath"]; + nns := d["nspace"]; + if nns then + begin + nn := d["name"]; + FNsCaches[nn][nns] := 1; + end + if g then return d; return 1; end diff --git a/funcext/tvclib/tcustomscrollcontrol.tsf b/funcext/tvclib/tcustomscrollcontrol.tsf index c70d380..827535d 100644 --- a/funcext/tvclib/tcustomscrollcontrol.tsf +++ b/funcext/tvclib/tcustomscrollcontrol.tsf @@ -26,7 +26,7 @@ type tcustomscrollcontrol = class(TCustomControl) function SetWhileStep(v); begin - if not v>=1 then return ; + if not(v>=1) then return ; nv := integer(v); if FWhileStep=nv then return ; FWhileStep := nv; @@ -333,16 +333,18 @@ type tcustomscrollcontrol = class(TCustomControl) _wapi.GetScrollInfo(hwnd,SB_VERT,FSI._getptr_); // 浱ǰλãЩбȽ yPos := FSI.nPos; - dd := 0; - if e.delta<0 and FSI.nMax>yPos then + dd := 0; + edelta := e.delta; + ew := abs(round(edelta/120)); + if edelta<0 and FSI.nMax>yPos then begin //dd++; - dd += FWhileStep; + dd += FWhileStep*ew; end - if e.delta>0 and FSI.nMin0 and FSI.nMin