Index: oup/current/Main.dfm
===================================================================
--- oup/current/Main.dfm	(revision 81)
+++ oup/current/Main.dfm	(revision 82)
@@ -371,6 +371,6 @@
   end
   object MenuImages: TImageList
-    Left = 168
-    Top = 112
+    Left = 16
+    Top = 136
     Bitmap = {
       494C01010D000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
@@ -909,3 +909,145 @@
       000000000000}
   end
+  object Images_Close: TImageList
+    Left = 16
+    Top = 176
+    Bitmap = {
+      494C010102000400040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
+      0000000000003600000028000000400000001000000001002000000000000010
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000000000000000005459BB00343B
+      B2000F19A7000F19A7000F19A7000F19A7000F19A7000F19A7000F19A7000F19
+      A700343BB2005459BB0000000000000000000000000000000000767676005E5E
+      5E00434343004343430043434300434343004343430043434300434343004343
+      43005E5E5E007676760000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000005358BA005B69E1006877
+      EE006575EE006273ED005F71ED005C6EEC00596CEC00566AEB005268EB004F66
+      EA004C63EA003F54DD005358BA000000000000000000757575008B8B8B009999
+      990098989800969696009494940092929200909090008F8F8F008D8D8D008B8B
+      8B00898989007B7B7B0075757500000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000000000333AB1006D7BEE005766
+      E5003E4FDA003445D5003345D4003343D3003142D2003141D1003040CF003647
+      D3004357DF004C63EA003D46BB0000000000000000005D5D5D009C9C9C008A8A
+      8A00777777006E6E6E006E6E6E006C6C6C006B6B6B006A6A6A00696969006F6F
+      6F007E7E7E008989890068686800000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A700707DEF004354
+      DD004354DA00C5CAF300606DDD003446D5003345D4005F6BDB00C4C8F000404E
+      D2003445D1004F66EA00202DB8000000000000000000434343009E9E9E007B7B
+      7B007A7A7A00D6D6D6008D8D8D006F6F6F006E6E6E008B8B8B00D4D4D4007474
+      74006D6D6D008B8B8B0055555500000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A700737FEF004657
+      DF00C5CAF300FFFFFF00F3F4FD00606EDE00606DDD00F3F4FC00FFFFFF00C4C8
+      F0003040CF005268EB00202EB8000000000000000000434343009F9F9F007E7E
+      7E00D6D6D600FFFFFF00F7F7F7008E8E8E008D8D8D00F6F6F600FFFFFF00D4D4
+      D400696969008D8D8D0056565600000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A7007681EF004859
+      E1006270E300F3F4FD00FFFFFF00F3F4FD00F3F4FD00FFFFFF00F3F4FC005F6B
+      DB003141D000566AEB00222FB800000000000000000043434300A1A1A1008080
+      800091919100F7F7F700FFFFFF00F7F7F700F7F7F700FFFFFF00F6F6F6008B8B
+      8B006A6A6A008F8F8F0057575700000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A7007A87F000495B
+      E300384CDE006371E400F3F4FD00FFFFFF00FFFFFF00F3F4FD00606DDD003343
+      D3003142D1005C71EC002735B900000000000000000043434300A5A5A5008282
+      82007676760092929200F7F7F700FFFFFF00FFFFFF00F7F7F7008D8D8D006C6C
+      6C006B6B6B00949494005B5B5B00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A7008697F3005066
+      E7004059E3006778E700F3F4FD00FFFFFF00FFFFFF00F3F4FD006373DF003B50
+      D700394FD5006983EF002A39BA00000000000000000043434300B1B1B1008A8A
+      8A008080800097979700F7F7F700FFFFFF00FFFFFF00F7F7F700929292007676
+      760075757500A1A1A1005E5E5E00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A7008EA3F4006484
+      ED007994EE00F5F7FD00FFFFFF00F5F7FD00F5F7FD00FFFFFF00F5F7FD00758E
+      E6004F71DE007491F2002B3BBA00000000000000000043434300B9B9B900A0A0
+      A000ACACAC00F9F9F900FFFFFF00F9F9F900F9F9F900FFFFFF00F9F9F900A6A6
+      A6008E8E8E00ABABAB005F5F5F00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A70091A4F4006685
+      EE00CED7F900FFFFFF00F5F7FD007792EC007791EA00F5F7FD00FFFFFF00CCD5
+      F5004F71DE007693F2002B3BBA00000000000000000043434300BABABA00A1A1
+      A100E0E0E000FFFFFF00F9F9F900A9A9A900A9A9A900F9F9F900FFFFFF00DEDE
+      DE008E8E8E00ACACAC005F5F5F00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000F19A70092A4F5006686
+      EF006283EE00CDD7F8007892EE005277E8005175E600758FE900CBD5F6005C7A
+      E3005475E1007894F2002D3CBA00000000000000000043434300BABABA00A2A2
+      A2009F9F9F00E0E0E000ABABAB009595950093939300A7A7A700DEDEDE009696
+      960092929200ADADAD0060606000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000002C34AD008FA0F500778D
+      F2005D7BEE005C7AED005B79EC005977EA005876E8005674E7005473E6005371
+      E400647FEA00748DF2003F49BA00000000000000000057575700B8B8B800A9A9
+      A9009A9A9A009999990098989800969696009595950093939300929292009090
+      90009C9C9C00A9A9A9006A6A6A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000004449B3007783E7008998
+      F4008795F4008493F4008191F3007E90F3007B8EF300798DF300768AF3007389
+      F3007187F2005F73E3004449B200000000000000000068686800A0A0A000B2B2
+      B200B0B0B000AEAEAE00ADADAD00ACACAC00A9A9A900A9A9A900A7A7A700A6A6
+      A600A5A5A5009292920068686800000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000000000000000004449B3002C33
+      AD000F19A7000F19A7000F19A7000F19A7000F19A7000F19A7000F19A7000F19
+      A7002C33AC004449B20000000000000000000000000000000000686868005757
+      5700434343004343430043434300434343004343430043434300434343004343
+      4300575757006868680000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000424D3E000000000000003E000000
+      2800000040000000100000000100010000000000800000000000000000000000
+      000000000000000000000000FFFFFF00FFFFFFFF00000000C003C00300000000
+      8001800100000000800180010000000080018001000000008001800100000000
+      8001800100000000800180010000000080018001000000008001800100000000
+      8001800100000000800180010000000080018001000000008001800100000000
+      C003C00300000000FFFFFFFF00000000}
+  end
 end
Index: oup/current/Main.pas
===================================================================
--- oup/current/Main.pas	(revision 81)
+++ oup/current/Main.pas	(revision 82)
@@ -74,4 +74,5 @@
     menu_loaddb: TTBItem;
     tb_opendb: TTBItem;
+    Images_Close: TImageList;
     procedure LoadFile(typedb: Boolean);
     function TryCloseAll: Boolean;
@@ -205,4 +206,8 @@
     x := Rect.Left + 4;
   Control.Canvas.TextOut(x, y + 2, caption);
+  if active then
+    Images_Close.Draw(Control.Canvas, Rect.Right - 18, y, 0)
+  else
+    Images_Close.Draw(Control.Canvas, Rect.Right - 18, y, 1);
 end;
 
@@ -216,11 +221,24 @@
 var
   pt: TPoint;
-  index: Integer;
+  tabIndex: Integer;
+  tabRect: TRect;
+  tabX, tabY, tabWidth: Integer;
 begin
   pt.X := X;
   pt.Y := Y;
-  index := MDITab.GetTabAtPos(pt);
-  if (Button = mbRight) and (index >= 0) then
-    MDITab.MDIChildren[index].Close;
+  tabIndex := MDITab.GetTabAtPos(pt);
+  if (Button = mbRight) and (tabIndex >= 0) then
+    MDITab.MDIChildren[tabIndex].Close;
+
+  if (Button = mbLeft) and (tabIndex >= 0) then
+  begin
+    tabrect := MDITab.TabRect(tabIndex);
+    tabX := X - tabrect.Left;
+    tabY := Y - tabrect.Top;
+    tabwidth := tabrect.Right - tabrect.Left;
+    if (tabY >= 4) and (tabY <= 17) then
+      if (tabX >= tabwidth - 19) and (tabX <= tabwidth - 7) then
+        MDITab.MDIChildren[tabIndex].Close;
+  end;
 end;
 
@@ -581,8 +599,9 @@
 function TForm_Main.open_child(window_context: String; fileid: Integer): TForm_ToolTemplate;
 var
-  toolform: TForm_ToolTemplate;
-  i:       Integer;
-  tag:     Integer;
-  iconindex: Integer;
+  toolform:    TForm_ToolTemplate;
+  i:           Integer;
+  tag:         Integer;
+  caption_end: String;
+  iconindex:   Integer;
 begin
   Result := nil;
@@ -595,9 +614,10 @@
 
   iconindex := -1;
+  caption_end := IntToStr(tag) + '       ';
 
   if window_context = 'binedit' then
   begin
     toolform         := TForm_BinEdit.Create(Self);
-    toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag);
+    toolform.Caption := 'Binary .dat-Editor ' + caption_end;
     iconindex        := 5;
   end;
@@ -605,5 +625,5 @@
   begin
     toolform         := TForm_Extractor.Create(Self);
-    toolform.Caption := 'Extractor ' + IntToStr(tag);
+    toolform.Caption := 'Extractor ' + caption_end;
     iconindex        := 8;
   end;
@@ -611,5 +631,5 @@
   begin
     toolform         := TForm_Preview.Create(Self);
-    toolform.Caption := 'Preview-Window ' + IntToStr(tag);
+    toolform.Caption := 'Preview-Window ' + caption_end;
     iconindex        := 4;
   end;
@@ -617,5 +637,5 @@
   begin
     toolform         := TForm_RawEdit.Create(Self);
-    toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag);
+    toolform.Caption := 'Binary .raw-Editor ' + caption_end;
     iconindex        := 6;
   end;
@@ -623,5 +643,5 @@
   begin
     toolform         := TForm_TxmpReplace.Create(Application);
-    toolform.Caption := 'TXMP Replacer ' + IntToStr(tag);
+    toolform.Caption := 'TXMP Replacer ' + caption_end;
     iconindex        := 7;
   end;
@@ -632,4 +652,5 @@
     toolform.Tag     := tag;
     MDITab.AddTab(TForm(toolform), iconindex);
+    toolform.Caption := AnsiReplaceStr(toolform.Caption, '       ', '');
     if fileid > -1 then
       toolform.SelectFileID(fileid);
