sparta: fix for newly created forms (each of new form was undocked for a short period of time). The problem still occurs but is less visible. A slightly modified patch from Balázs Székely (GetMem). Mantis #32207.

git-svn-id: trunk@55595 -
This commit is contained in:
hnb 2017-07-26 18:37:50 +00:00
parent 52fc498a76
commit 8777025cc5

View File

@ -391,6 +391,7 @@ type
UpdatePackageCommandsStamp: TPackageCommandsStamp;
UpdateBookmarkCommandsStamp: TBookmarkCommandsStamp;
BookmarksStamp: Int64;
IsDockedFormEditor: Boolean;
public
procedure UpdateMainIDECommands(Sender: TObject);
procedure UpdateFileCommands(Sender: TObject);
@ -1565,7 +1566,7 @@ begin
CompPalette.OnChangeActivePage:=@MainIDEBar.SetMainIDEHeightEvent;
// load installed packages
PkgBoss.LoadInstalledPackages;
IsDockedFormEditor := IDETabMaster <> nil;
EditorMacroListViewer.LoadGlobalInfo; // Must be after packages are loaded/registered.
FormEditor1.RegisterFrame;
@ -3541,8 +3542,17 @@ begin
exit;
end;
// do not call 'AForm.Show', because it will set Visible to true
AForm.BringToFront;
LCLIntf.ShowWindow(AForm.Handle,SW_SHOWNORMAL);
if IsDockedFormEditor then
begin
ARestoreVisible := AForm.Visible;
AForm.Visible := False;
AForm.Visible := ARestoreVisible;
end
else
begin
AForm.BringToFront;
LCLIntf.ShowWindow(AForm.Handle,SW_SHOWNORMAL);
end;
end;
procedure TMainIDE.DoViewAnchorEditor(State: TIWGetFormState);
@ -8442,7 +8452,11 @@ var
begin
DoShowDesignerFormOfSrc(SourceEditorManager.ActiveEditor, LForm);
if LForm <> nil then
begin
if IsDockedFormEditor then
LCLIntf.ShowWindow(LForm.Handle, SW_MINIMIZE);
DoCallShowDesignerFormOfSourceHandler(lihtShowDesignerFormOfSource, LForm, SourceEditorManager.ActiveEditor, AComponentPaletteClassSelected);
end;
end;
procedure TMainIDE.DoShowDesignerFormOfSrc(AEditor: TSourceEditorInterface);