fixed small bug in the documents bar

This commit is contained in:
Christian Hammacher 2006-06-15 00:43:09 +00:00
parent 6f20664140
commit 99a2b54530
2 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@ -3057,6 +3057,7 @@ end;
procedure TfrmMain.tbDocsTabClosing(Sender: TObject; Item: TJvTabBarItem; procedure TfrmMain.tbDocsTabClosing(Sender: TObject; Item: TJvTabBarItem;
var AllowClose: Boolean); var AllowClose: Boolean);
var Collection: TDocCollection; var Collection: TDocCollection;
i: integer;
begin begin
AllowClose := False; AllowClose := False;
if (Started) and (Screen.Cursor = crDefault) and (not pnlLoading.Visible) then begin if (Started) and (Screen.Cursor = crDefault) and (not pnlLoading.Visible) then begin
@ -3068,8 +3069,12 @@ begin
end; end;
if tbDocs.Tabs.IndexOf(Item) <> -1 then begin if tbDocs.Tabs.IndexOf(Item) <> -1 then begin
if CloseDocument(TDocument(Collection.Items[tbDocs.Tabs.IndexOf(Item)]), True, False) then if CloseDocument(TDocument(Collection.Items[tbDocs.Tabs.IndexOf(Item)]), True, False) then begin
tbDocs.Tabs.Delete(Item.Index); tbDocs.Tabs.Delete(Item.Index);
for i := 0 to tbDocs.Tabs.Count -1 do
tbDocs.Tabs[i].Caption := TDocument(Collection.Items[i]).Title;
end;
end; end;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;