From 0237f141539cfac4b084796fb654a23a77eef5c2 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Mon, 27 Mar 2023 10:23:39 +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 优化重新加载提示 --- designer/utslcodeeditor.tsf | 49 ++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index f9fdc1c..7ebace5 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -2241,7 +2241,7 @@ type TEditer=class(TCustomcontrol) // lt := it.GetLastLoadTime(); nlt := it.ReGetLastLoadTime(); if not lt then return; - if nlt <> lt then + if (nlt <> lt) then //ļı begin FPageEditer.FCanDraged := false; FPageEditer.MouseDrageLeave(); //˴֪Ϊʲôᱨ @@ -2258,6 +2258,10 @@ type TEditer=class(TCustomcontrol) // end end else //޸ begin + if (it.FEditer.ChangedFlag = false) and fcloseflag then + begin + return ; + end if Messageboxa(format("%s\r\n޸Ƿ¼",it.ScriptPath),"ʾ",mb_YesNo,self)=IDYES then begin LoadFromFile(it,true); @@ -2362,7 +2366,7 @@ type TEditer=class(TCustomcontrol) // case o.Caption of "ر": begin - docloseapageitem(it); + docloseapageitem(it); end "ر": begin @@ -2374,11 +2378,17 @@ type TEditer=class(TCustomcontrol) // if iti=it then break ; itss[i] := iti; end - for i,iti in itss do - begin - docloseapageitem(iti); - end + fcloseflag := true; + try + for i,iti in itss do + begin + docloseapageitem(iti); + end + finally + fcloseflag := false; + end; if itss then FPageEditer.CallSelChanged(); + end "رҲ": begin @@ -2389,20 +2399,27 @@ type TEditer=class(TCustomcontrol) // begin itss[i] := its[i]; end - for i,iti in itss do - begin - if dodel then docloseapageitem(iti); - if iti=it then - begin - dodel := 1; - end ; - end + fcloseflag := true; + try + for i,iti in itss do + begin + if dodel then docloseapageitem(iti); + if iti=it then + begin + dodel := 1; + end ; + end + finally + fcloseflag := false; + end; if dodel then FPageEditer.CallSelChanged(); end "رǩ": begin Cit := it; its := GetAllPageItems(); + fcloseflag := true; + try for i := 0 to its.Length()-1 do begin it := its[i]; @@ -2424,6 +2441,9 @@ type TEditer=class(TCustomcontrol) // end end CloseAllPageItems(Cit); + finally + fcloseflag := false; + end; end "Ϊ": begin @@ -4136,6 +4156,7 @@ type TEditer=class(TCustomcontrol) // FOpenHistory; FHistoryWnd; FTslDebug; + fcloseflag; private function GetFilesFormSearchInfo(d); begin