From 152470c5db12320333ae8a152aed1fde785f609f Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Thu, 10 Aug 2023 14:39:44 +0800 Subject: [PATCH] Update twincontrol.tsf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 模态优化 --- funcext/tvclib/twincontrol.tsf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/funcext/tvclib/twincontrol.tsf b/funcext/tvclib/twincontrol.tsf index 85d94f4..162a135 100644 --- a/funcext/tvclib/twincontrol.tsf +++ b/funcext/tvclib/twincontrol.tsf @@ -132,12 +132,15 @@ type TWinControl = class(tcontrol) _wapi.BringWindowToTop(hWnd); //disable FModalRootWnd := 0; + inabledlist := array(); + inabledlistidx := 0; if(modp is class(TWinControl))and modp.HandleAllocated()then begin hParentWnd := modp.Handle; while(hParentWnd) do begin _wapi.EnableWindow(hParentWnd,FALSE); + inabledlist[inabledlistidx++] := hParentWnd; wdobj := class(tUIglobalData).uigetdata("TGlobalComponentcache").getwndbyhwnd(hParentWnd); if wdobj and wdobj.Modaling then begin @@ -174,7 +177,13 @@ type TWinControl = class(tcontrol) end //ģ̬Ѿ˳ //ָڵenable״̬ - if(modp is class(TWinControl))and modp.HandleAllocated()then + /////////////////////////////////////////////////////////////////////////// + for i:= length(inabledlist)-1 downto 0 do + begin + _wapi.EnableWindow(inabledlist[i],TRUE); + end + inabledlist := nil; + {if(modp is class(TWinControl))and modp.HandleAllocated()then begin hParentWnd := modp.Handle; while(hParentWnd) do @@ -183,7 +192,8 @@ type TWinControl = class(tcontrol) if FModalRootWnd=hParentWnd then break; hParentWnd := _wapi.GetParent(hParentWnd); end - end + end} + /////////////////////////////////////////////////////////////////////// //Լ _wapi.ShowWindow(hWnd,SW_HIDE); return FModalCode;