IDE: fixed using empty sourceeditor window

git-svn-id: trunk@26212 -
This commit is contained in:
mattias 2010-06-20 18:09:35 +00:00
parent f5b98124aa
commit 9c8f207995
3 changed files with 20 additions and 6 deletions

View File

@ -131,7 +131,6 @@ begin
Creator:=IDEWindowCreators.FindWithName(AForm.Name);
if Creator=nil then exit;
debugln(['TIDEAnchorDockMaster.GetDefaultBounds AAA1 ',AForm.Name,' ',Creator.DockSibling,' ',dbgs(Creator.DockAlign)]);
if Creator.OnGetLayout<>nil then
Creator.OnGetLayout(Self,AForm.Name,NewBounds,DockSiblingName,DockAlign)
else begin

View File

@ -12267,9 +12267,11 @@ begin
// collect all windows except the main bar
for i:=0 to Screen.CustomFormCount-1 do begin
AForm:=Screen.CustomForms[i];
if (AForm<>MainIDEBar) // ignore the main bar
if (AForm.Parent=nil) // ignore nested forms
and (AForm<>MainIDEBar) // ignore the main bar
and (AForm.Designer=nil) // ignore designer forms
and (AForm.Visible) // ignore hidden forms
and (not (csDesigning in AForm.ComponentState))
and (AForm.IsVisible) // ignore hidden forms
and (not (fsModal in AForm.FormState)) // ignore modal forms
and (HiddenWindowsOnRun.IndexOf(AForm)<0) // ignore already collected forms
then
@ -12279,8 +12281,7 @@ begin
// hide all collected windows
for i:=0 to HiddenWindowsOnRun.Count-1 do begin
AForm:=TCustomForm(HiddenWindowsOnRun[i]);
if not (csDesigning in ComponentState) then
AForm.Hide;
AForm.Hide;
end;
// minimize IDE

View File

@ -5664,6 +5664,8 @@ procedure TSourceNotebook.DoClose(var CloseAction: TCloseAction);
var
Layout: TSimpleWindowLayout;
begin
debugln(['TSourceNotebook.DoClose ',DbgSName(Self)]);
DumpStack;
inherited DoClose(CloseAction);
CloseAction := caHide;
{$IFnDEF SingleSrcWindow}
@ -6656,7 +6658,7 @@ begin
end;
// Move focus from Notebook-tabs to editor
TempEditor:=FindSourceEditorWithPageIndex(PageIndex);
if Visible and (TempEditor <> nil) then
if IsVisible and (TempEditor <> nil) then
TempEditor.EditorComponent.SetFocus;
{$IFDEF IDE_DEBUG}
writeln('TSourceNotebook.CloseFile END');
@ -8369,9 +8371,21 @@ begin
end;
function TSourceEditorManager.ActiveOrNewSourceWindow: TSourceNotebook;
var
i: Integer;
begin
Result := ActiveSourceWindow;
if Result <> nil then exit;
if SourceWindowCount>0 then begin
for i:=0 to SourceWindowCount-1 do
begin
Result:=SourceWindows[i];
if Result.FIsClosing then continue;
ActiveSourceWindow := Result;
exit;
end;
end;
Result := CreateNewWindow(True);
ActiveSourceWindow := Result;
end;