1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-13 12:55:05 -05:00

Simba: Fix tab closing depending on the Sender.

This commit is contained in:
Merlijn Wajer 2011-02-23 14:44:24 +01:00
parent 1265e35aef
commit abcb1065e6

View File

@ -1637,8 +1637,13 @@ end;
procedure TSimbaForm.ActionCloseTabExecute(Sender: TObject);
begin
if(PageControl1.PageCount > 1)then
Self.DeleteTab(TTabSheet(Sender).TabIndex,false)
if(PageControl1.PageCount > 1) then
begin
if Sender is TTabSheet then
Self.DeleteTab(TTabSheet(Sender).TabIndex,false)
else
Self.DeleteTab(PageControl1.TabIndex,false)
end
else
Self.ClearScript; //DeleteTab would take care of this already, but yeah, it's neater this way.
end;