Merged revision(s) 65490-65491 #5ff92a4b96-#5ff92a4b96 from trunk:

Add DbgS for FormStyle
........
AnchorDocking: Don't set FormStyle to fsStayOnTop for modal shown windows to prevent showing it in front of other applications. E.G. in IDE Tools -> Desktops.
........

git-svn-id: branches/fixes_2_2@65497 -
This commit is contained in:
maxim 2021-07-22 21:22:32 +00:00
parent f49c02bfde
commit 16944a47ac
2 changed files with 23 additions and 2 deletions

View File

@ -101,6 +101,7 @@ unit AnchorDocking;
{ $DEFINE VerboseADCustomSite}
{ $DEFINE VerboseAnchorDockPages}
{ $DEFINE VerboseAnchorDocking}
{ $DEFINE VerboseADFloatingWindowsOnTop}
interface
@ -1678,6 +1679,7 @@ var
IsMainDockForm: Boolean;
begin
if not (Sender is TCustomForm) then Exit;
if fsModal in AForm.FormState then Exit;
if AForm.FormStyle in fsAllStayOnTop then Exit;
if not FloatingWindowsOnTop then Exit;
IsMainDockForm := (AForm = MainDockForm)
@ -1687,6 +1689,9 @@ begin
AForm.FormStyle := fsNormal
else
AForm.FormStyle := fsStayOnTop;
{$IFDEF VerboseADFloatingWindowsOnTop}
DebugLn('TAnchorDockMaster.FormFirstShow ', DbgSName(AForm), ': ', DbgS(AForm.FormStyle));
{$ENDIF}
end;
function TAnchorDockMaster.GetLocalizedHeaderHint: string;
@ -2765,9 +2770,19 @@ begin
AFormStyle := fsNormal;
end;
if ParentForm is TAnchorDockHostSite then
ParentForm.FormStyle := AFormStyle
else
begin
ParentForm.FormStyle := AFormStyle;
{$IFDEF VerboseADFloatingWindowsOnTop}
DebugLn('TAnchorDockMaster.RefreshFloatingWindowsOnTop ',
DbgSName(ParentForm), '(', DbgSName(AForm), '): ', DbgS(AFormStyle));
{$ENDIF}
end else begin
AForm.FormStyle := AFormStyle;
{$IFDEF VerboseADFloatingWindowsOnTop}
DebugLn('TAnchorDockMaster.RefreshFloatingWindowsOnTop ',
DbgSName(AForm), ': ', DbgS(AFormStyle));
{$ENDIF}
end;
end;
end;

View File

@ -2790,6 +2790,7 @@ function DbgS(p: TControlAutoSizePhase): string; overload;
function DbgS(Phases: TControlAutoSizePhases): string; overload;
function DbgS(cst: TControlStyleType): string; overload;
function DbgS(cs: TControlStyle): string; overload;
function DbgS(fs: TFormStyle): string; overload;
operator := (AVariant: Variant): TCaption;
@ -3039,6 +3040,11 @@ begin
Result:='['+Result+']';
end;
function DbgS(fs: TFormStyle): string;
begin
WriteStr(Result, fs);
end;
function GetModalResultStr(ModalResult: TModalResult): ShortString;
begin
Result := UITypes.ModalResultStr[ModalResult];