Index: oup/current/Code_DataStructures.pas
===================================================================
--- oup/current/Code_DataStructures.pas	(revision 44)
+++ oup/current/Code_DataStructures.pas	(revision 45)
@@ -53,5 +53,5 @@
 implementation
 
-uses Code_Functions, Code_OniDataClass, Forms;
+uses Code_Functions, Code_OniDataClass, Forms, Tool_Template;
 
 
@@ -438,4 +438,5 @@
   RawListHandlers[High(RawListHandlers)].handler := handler;
   Raws := Raws + ext;
+  AddToolListEntry('rawedit', '', ext);
 end;
 
Index: oup/current/Code_OniDataClass.pas
===================================================================
--- oup/current/Code_OniDataClass.pas	(revision 44)
+++ oup/current/Code_OniDataClass.pas	(revision 45)
@@ -283,4 +283,5 @@
   for i := 0 to Fdat_header.Files - 1 do
   begin
+    Fdat_files[i].ID := i;
     Fdat_files[i].Extension := Fdat_filesmap[i].Extension;
     Fdat_files[i].Extension := ReverseString(Fdat_files[i].Extension);
Index: oup/current/Data.pas
===================================================================
--- oup/current/Data.pas	(revision 44)
+++ oup/current/Data.pas	(revision 45)
@@ -94,4 +94,10 @@
   end;
 
+  TToolList = array of record
+    context: String;
+    name: String;
+    exts: String;
+  end;
+
 var
 {
Index: oup/current/Main.pas
===================================================================
--- oup/current/Main.pas	(revision 44)
+++ oup/current/Main.pas	(revision 45)
@@ -7,8 +7,8 @@
   Dialogs, StdCtrls, StrUtils, Clipbrd, ExtCtrls, ComCtrls, Menus, Grids,
   MPHexEditor, ToolWin, ImgList, Tabs,
-  Code_Functions, Data, Code_DataStructures,
-  Helper_LevelDB, Code_Exporters, Settings,
-  Tool_Preview, Tool_TxmpReplace, Tool_BinEdit, Tool_Extractor, Tool_RawEdit,
-  Code_OniDataClass, MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI;
+  MDITab, TB2Item, TB2Dock, TB2Toolbar, TB2MDI,
+  Code_Functions, Data, Code_DataStructures, Code_OniDataClass,
+  Helper_LevelDB, Code_Exporters, Settings, Tool_Template,
+  Tool_BinEdit, Tool_Extractor, Tool_Preview, Tool_RawEdit, Tool_TxmpReplace;
 
 type
@@ -77,5 +77,5 @@
     procedure menu_windows_nextClick(Sender: TObject);
     procedure menu_windows_tileClick(Sender: TObject);
-    function open_child(window_context: String): Boolean;
+    function open_child(window_context: String; fileid: Integer): Boolean;
     procedure menu_windows_closeallClick(Sender: TObject);
     procedure menu_windows_cascadeClick(Sender: TObject);
@@ -305,12 +305,14 @@
       ext := ExtractFileExt(opend.FileName);
       if ext = '.dat' then
+      begin
         if not CreateDataConnection(opend.FileName, ODB_Dat) then
           ShowMessage('Error while loading the file:' + CrLf + opend.FileName +
-            CrLf + 'Perhaps not an Oni-.dat-file?')
-      else if ext = '.oldb' then
+            CrLf + 'Perhaps not an Oni-.dat-file?');
+      end else if ext = '.oldb' then
+      begin
         if not CreateDataConnection(opend.FileName, ODB_ADB) then
           ShowMessage('Error while loading the file:' + CrLf + opend.FileName +
-            CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?')
-      else
+            CrLf + 'Perhaps not an OniUnPacker-LevelDatabase-file?');
+      end else
         ShowMessage('Incompatible file');
       AppSettings.DatPath := ExtractFilepath(opend.FileName);
@@ -394,5 +396,5 @@
 procedure TForm_Main.menu_previewClick(Sender: TObject);
 begin
-  open_child('preview');
+  open_child('preview', -1);
 end;
 
@@ -400,5 +402,5 @@
 procedure TForm_Main.menu_txmpreplaceClick(Sender: TObject);
 begin
-  open_child('txmpreplace');
+  open_child('txmpreplace', -1);
 end;
 
@@ -406,5 +408,5 @@
 procedure TForm_Main.menu_bineditClick(Sender: TObject);
 begin
-  open_child('binedit');
+  open_child('binedit', -1);
 end;
 
@@ -412,5 +414,5 @@
 procedure TForm_Main.menu_raweditClick(Sender: TObject);
 begin
-  open_child('rawedit');
+  open_child('rawedit', -1);
 end;
 
@@ -418,5 +420,5 @@
 procedure TForm_Main.menu_extractorClick(Sender: TObject);
 begin
-  open_child('extractor');
+  open_child('extractor', -1);
 end;
 
@@ -424,5 +426,5 @@
 procedure TForm_Main.menu_filecompareClick(Sender: TObject);
 begin
-  open_child('compare');
+  open_child('compare', -1);
 end;
 
@@ -515,7 +517,7 @@
 
 
-function TForm_Main.open_child(window_context: String): Boolean;
+function TForm_Main.open_child(window_context: String; fileid: Integer): Boolean;
 var
-  form:    TCustomForm;
+  toolform: TForm_ToolTemplate;
   i:       Integer;
   tag:     Integer;
@@ -534,38 +536,37 @@
   if window_context = 'binedit' then
   begin
-    form      := TForm_BinEdit.Create(Application);
-    TForm_BinEdit(form).Recreatelist;
-    form.Caption := 'Binary .dat-Editor ' + IntToStr(tag);
-    iconindex := 0;
+    toolform         := TForm_BinEdit.Create(Self);
+    toolform.Caption := 'Binary .dat-Editor ' + IntToStr(tag);
+    iconindex        := 0;
+  end;
+  if window_context = 'extractor' then
+  begin
+    toolform         := TForm_Extractor.Create(Self);
+    toolform.Caption := 'Extractor ' + IntToStr(tag);
+  end;
+  if window_context = 'preview' then
+  begin
+    toolform         := TForm_Preview.Create(Self);
+    toolform.Caption := 'Preview-Window ' + IntToStr(tag);
   end;
   if window_context = 'rawedit' then
   begin
-    form      := TForm_RawEdit.Create(Application);
-    TForm_RawEdit(form).Recreatelist;
-    form.Caption := 'Binary .raw-Editor ' + IntToStr(tag);
-  end;
-  if window_context = 'preview' then
-  begin
-    form      := TForm_Preview.Create(Application);
-    TForm_Preview(form).Recreatelist;
-    form.Caption := 'Preview-Window ' + IntToStr(tag);
+    toolform         := TForm_RawEdit.Create(Self);
+    toolform.Caption := 'Binary .raw-Editor ' + IntToStr(tag);
   end;
   if window_context = 'txmpreplace' then
   begin
-    form      := TForm_TxmpReplace.Create(Application);
-    TForm_TxmpReplace(form).Recreatelist;
-    form.Caption := 'TXMP Replacer ' + IntToStr(tag);
-  end;
-  if window_context = 'extractor' then
-  begin
-    form      := TForm_Extractor.Create(Application);
-    TForm_Extractor(form).Recreatelist;
-    form.Caption := 'Extractor ' + IntToStr(tag);
-  end;
-
-  form.Name := window_context + IntToStr(tag);
-  form.Tag  := tag;
-
-  MDITab.AddTab(TForm(form), iconindex);
+    toolform         := TForm_TxmpReplace.Create(Application);
+    toolform.Caption := 'TXMP Replacer ' + IntToStr(tag);
+  end;
+
+  if Assigned(toolform) then
+  begin
+    toolform.Name    := window_context + IntToStr(tag);
+    toolform.Tag     := tag;
+    MDITab.AddTab(TForm(toolform), iconindex);
+    if fileid > -1 then
+      toolform.SelectFileID(fileid);
+  end;
 end;
 
Index: oup/current/OniUnPacker.dpr
===================================================================
--- oup/current/OniUnPacker.dpr	(revision 44)
+++ oup/current/OniUnPacker.dpr	(revision 45)
@@ -7,16 +7,17 @@
   Data in 'Data.pas',
   Code_Exporters in 'Code_Exporters.pas',
-  Tool_Preview in 'Tool_Preview.pas' {Form_Preview},
   Code_OniImgClass in 'Code_OniImgClass.pas',
-  Tool_TxmpReplace in 'Tool_TxmpReplace.pas' {Form_TxmpReplace},
-  Tool_BinEdit in 'Tool_BinEdit.pas' {Form_BinEdit},
   Code_DataStructures in 'Code_DataStructures.pas',
   Helper_LevelDB in 'Helper_LevelDB.pas' {Form_LevelDB},
-  Tool_Extractor in 'Tool_Extractor.pas' {Form_Extractor},
   Helper_ValueEdit in 'Helper_ValueEdit.pas' {Form_ValueEdit},
-  Tool_RawEdit in 'Tool_RawEdit.pas' {Form_RawEdit},
   Settings in 'Settings.pas' {Form_Settings},
   ftypesAPI in 'TFileTypeRegistration\ftypesAPI.pas',
-  Code_OniDataClass in 'Code_OniDataClass.pas';
+  Code_OniDataClass in 'Code_OniDataClass.pas',
+  Tool_Template in 'Tool_Template.pas' {Form_ToolTemplate},
+  Tool_Preview in 'Tool_Preview.pas' {Form_Preview},
+  Tool_BinEdit in 'Tool_BinEdit.pas' {Form_ToolTemplate2},
+  Tool_Extractor in 'Tool_Extractor.pas' {Form_ToolTemplate3},
+  Tool_RawEdit in 'Tool_RawEdit.pas' {Form_ToolTemplate4},
+  Tool_TxmpReplace in 'Tool_TxmpReplace.pas' {Form_ToolTemplate5};
 
 {$R *.res}
Index: oup/current/Tool_BinEdit.dfm
===================================================================
--- oup/current/Tool_BinEdit.dfm	(revision 44)
+++ oup/current/Tool_BinEdit.dfm	(revision 45)
@@ -1,50 +1,19 @@
-object Form_BinEdit: TForm_BinEdit
-  Left = 0
-  Top = 0
-  BorderIcons = [biSystemMenu, biMaximize]
-  Caption = 'Binary .dat-Editor'
-  ClientHeight = 555
-  ClientWidth = 642
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  FormStyle = fsMDIChild
-  KeyPreview = True
-  OldCreateOrder = False
-  Visible = True
-  WindowState = wsMaximized
-  OnClose = FormClose
+inherited Form_BinEdit: TForm_BinEdit
+  Caption = 'BinEdit'
   OnCloseQuery = FormCloseQuery
   OnCreate = FormCreate
   OnKeyUp = FormKeyUp
-  OnResize = FormResize
   PixelsPerInch = 96
   TextHeight = 13
-  object Splitter1: TSplitter
-    Left = 200
-    Top = 0
-    Width = 9
-    Height = 555
-    AutoSnap = False
-    Beveled = True
-    MinSize = 150
-    ExplicitLeft = 150
-    ExplicitHeight = 423
-  end
-  object panel_data: TPanel
-    Left = 209
-    Top = 0
-    Width = 433
-    Height = 555
-    Align = alClient
-    BevelOuter = bvNone
-    TabOrder = 0
+  inherited panel_files: TPanel
+    inherited filelist: TListBox
+      ExplicitHeight = 256
+    end
+  end
+  inherited content: TPanel
     object Splitter2: TSplitter
       Left = 0
       Top = 209
-      Width = 433
+      Width = 283
       Height = 9
       Cursor = crVSplit
@@ -53,10 +22,10 @@
       Beveled = True
       MinSize = 40
-      ExplicitWidth = 483
+      ExplicitWidth = 425
     end
     object Splitter3: TSplitter
       Left = 0
-      Top = 450
-      Width = 433
+      Top = 318
+      Width = 283
       Height = 8
       Cursor = crVSplit
@@ -65,11 +34,12 @@
       Beveled = True
       MinSize = 40
-      ExplicitTop = 375
-      ExplicitWidth = 483
+      ExplicitLeft = -9
+      ExplicitTop = 430
+      ExplicitWidth = 425
     end
     object hex: TMPHexEditor
       Left = 0
       Top = 0
-      Width = 433
+      Width = 283
       Height = 209
       Cursor = crIBeam
@@ -111,6 +81,6 @@
       Left = 0
       Top = 218
-      Width = 433
-      Height = 232
+      Width = 283
+      Height = 100
       Align = alClient
       ColCount = 1
@@ -128,6 +98,6 @@
     object VST: TVirtualStringTree
       Left = 0
-      Top = 458
-      Width = 433
+      Top = 326
+      Width = 283
       Height = 97
       Align = alBottom
@@ -221,140 +191,9 @@
     end
   end
-  object panel_files: TPanel
-    Left = 0
-    Top = 0
-    Width = 200
-    Height = 555
-    Align = alLeft
-    BevelOuter = bvNone
-    TabOrder = 1
-    object Bevel1: TBevel
-      Left = 0
-      Top = 491
-      Width = 200
-      Height = 6
-      Align = alBottom
-      Style = bsRaised
-      ExplicitTop = 359
-      ExplicitWidth = 150
-    end
-    object list: TListBox
-      Left = 0
-      Top = 0
-      Width = 200
-      Height = 388
-      Align = alClient
-      ItemHeight = 13
-      TabOrder = 0
-      OnClick = listClick
-      OnMouseDown = listMouseDown
-    end
-    object panel_extension: TPanel
-      Left = 0
-      Top = 388
-      Width = 200
-      Height = 103
-      Align = alBottom
-      BevelOuter = bvNone
-      TabOrder = 1
-      OnResize = panel_extensionResize
-      object lbl_filter: TLabel
-        Left = 2
-        Top = 62
-        Width = 100
-        Height = 17
-        AutoSize = False
-        Caption = 'Filter by &extension:'
-        FocusControl = combo_extension
-      end
-      object combo_extension: TComboBox
-        Left = 2
-        Top = 76
-        Width = 145
-        Height = 21
-        Style = csDropDownList
-        DropDownCount = 12
-        Font.Charset = DEFAULT_CHARSET
-        Font.Color = clWindowText
-        Font.Height = -11
-        Font.Name = 'Tahoma'
-        Font.Style = []
-        ItemHeight = 13
-        ParentFont = False
-        Sorted = True
-        TabOrder = 3
-        OnClick = combo_extensionClick
-      end
-      object check_zerobyte: TCheckBox
-        Left = 2
-        Top = 44
-        Width = 130
-        Height = 13
-        Caption = 'Show &zero-byte files'
-        TabOrder = 2
-        OnClick = check_zerobyteClick
-      end
-      object edit_filtername: TEdit
-        Left = 2
-        Top = 20
-        Width = 145
-        Height = 18
-        AutoSize = False
-        TabOrder = 1
-      end
-      object check_filtername: TCheckBox
-        Left = 2
-        Top = 5
-        Width = 130
-        Height = 15
-        Caption = 'Filter by file&name:'
-        TabOrder = 0
-        OnClick = check_filternameClick
-      end
-    end
-    object panel_imexport: TPanel
-      Left = 0
-      Top = 497
-      Width = 200
-      Height = 58
-      Align = alBottom
-      BevelOuter = bvNone
-      TabOrder = 2
-      OnResize = panel_imexportResize
-      object btn_export: TButton
-        Left = 4
-        Top = 4
-        Width = 142
-        Height = 25
-        Caption = 'Export to file...'
-        TabOrder = 0
-        OnClick = btn_exportClick
-      end
-      object btn_import: TButton
-        Left = 4
-        Top = 32
-        Width = 142
-        Height = 25
-        Caption = 'Import from file...'
-        TabOrder = 1
-        OnClick = btn_importClick
-      end
-    end
-  end
-  object opend: TOpenDialog
-    Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing]
-    Left = 120
-    Top = 392
-  end
-  object saved: TSaveDialog
-    Options = [ofOverwritePrompt, ofPathMustExist, ofEnableSizing]
-    Left = 120
-    Top = 368
-  end
-  object value_viewer_context: TPopupMenu
+  object value_viewer_context: TPopupMenu [3]
     AutoHotkeys = maManual
     OnPopup = value_viewer_contextPopup
-    Left = 240
-    Top = 248
+    Left = 280
+    Top = 232
     object value_viewer_context_copy: TMenuItem
       Caption = 'Copy to &clipboard'
@@ -382,8 +221,8 @@
     end
   end
-  object VTHPopup: TVTHeaderPopupMenu
+  object VTHPopup: TVTHeaderPopupMenu [4]
     OnColumnChange = VTHPopupColumnChange
-    Left = 200
-    Top = 496
+    Left = 272
+    Top = 376
   end
 end
Index: oup/current/Tool_BinEdit.pas
===================================================================
--- oup/current/Tool_BinEdit.pas	(revision 44)
+++ oup/current/Tool_BinEdit.pas	(revision 45)
@@ -1,46 +1,45 @@
 unit Tool_BinEdit;
-
 interface
-
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, Wrapgrid, StdCtrls, Grids, StrUtils, MPHexEditor, ExtCtrls, Clipbrd,
-  Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass,
-  Menus, Math, VirtualTrees, VTHeaderPopup;
+  Dialogs, Tool_Template, StdCtrls, ExtCtrls, VirtualTrees, Grids, Wrapgrid,
+  MPHexEditor, VTHeaderPopup, Menus, StrUtils, Clipbrd,
+  Data, Code_OniDataClass, Code_Functions, Code_DataStructures, Code_Exporters;
 
 type
-  TForm_BinEdit = class(TForm)
-    Splitter1: TSplitter;
-    panel_data: TPanel;
-    hex:      TMPHexEditor;
+  TForm_BinEdit = class(TForm_ToolTemplate)
+    hex: TMPHexEditor;
     Splitter2: TSplitter;
-    panel_files: TPanel;
-    list:     TListBox;
-    panel_extension: TPanel;
-    lbl_filter: TLabel;
-    combo_extension: TComboBox;
-    Bevel1:   TBevel;
-    panel_imexport: TPanel;
-    btn_export: TButton;
-    btn_import: TButton;
-    opend:    TOpenDialog;
-    saved:    TSaveDialog;
     value_viewer: TWrapGrid;
+    VST: TVirtualStringTree;
     Splitter3: TSplitter;
     value_viewer_context: TPopupMenu;
     value_viewer_context_copy: TMenuItem;
-    value_viewer_context_copyashex: TMenuItem;
     value_viewer_context_copyasdec: TMenuItem;
     value_viewer_context_copyasfloat: TMenuItem;
     value_viewer_context_copyasbitset: TMenuItem;
     value_viewer_context_copyasstring: TMenuItem;
-    check_zerobyte: TCheckBox;
-    edit_filtername: TEdit;
-    check_filtername: TCheckBox;
-    VST:      TVirtualStringTree;
+    value_viewer_context_copyashex: TMenuItem;
     VTHPopup: TVTHeaderPopupMenu;
+    procedure FormCreate(Sender: TObject);
+    procedure NewFile(fileinfo: TFileInfo);
+
+    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+
+    procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
+    procedure hexSelectionChanged(Sender: TObject);
+    procedure hexChange(Sender: TObject);
+
+    procedure LoadDat(_fileid: LongWord);
+    function Save: Boolean;
+    function GetValue(datatype: Word; offset: LongWord): String;
+    procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);
+
+    procedure WriteStructureInfos;
+    procedure ClearStructViewer;
+    procedure VSTDblClick(Sender: TObject);
     procedure VSTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
       Column: TColumnIndex);
-    procedure VSTDblClick(Sender: TObject);
     procedure VTHPopupColumnChange(const Sender: TBaseVirtualTree;
       const Column: TColumnIndex; Visible: Boolean);
@@ -49,15 +48,7 @@
     procedure VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
       Column: TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
-    procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
-    procedure LoadDat(_fileid: LongWord);
-    procedure LoadFileNames;
-    procedure check_filternameClick(Sender: TObject);
-    procedure check_zerobyteClick(Sender: TObject);
-    procedure combo_extensionClick(Sender: TObject);
-    procedure panel_extensionResize(Sender: TObject);
-    procedure listClick(Sender: TObject);
-    procedure Recreatelist;
-
-    procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
+
+    procedure ClearValues;
+    procedure WriteValues;
     procedure value_viewerDblClick(Sender: TObject);
     procedure value_viewer_context_copyClick(Sender: TObject);
@@ -65,22 +56,4 @@
       Shift: TShiftState; X, Y: Integer);
     procedure value_viewer_contextPopup(Sender: TObject);
-    procedure btn_importClick(Sender: TObject);
-    procedure btn_exportClick(Sender: TObject);
-    procedure panel_imexportResize(Sender: TObject);
-    function Save: Boolean;
-    procedure FormClose(Sender: TObject; var Action: TCloseAction);
-    function GetValue(datatype: Word; offset: LongWord): String;
-    procedure WriteStructureInfos; //(structinfoid:Integer);
-    procedure hexSelectionChanged(Sender: TObject);
-    procedure hexChange(Sender: TObject);
-    procedure FormResize(Sender: TObject);
-    procedure ClearStructViewer;
-    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
-    procedure FormCreate(Sender: TObject);
-    procedure ClearValues;
-    procedure WriteValues;
-    procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);
-    procedure listMouseDown(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: Integer);
   private
     fileid: LongWord;
@@ -93,7 +66,6 @@
 implementation
 
+uses Helper_ValueEdit, Main, Tool_RawEdit;
 {$R *.dfm}
-
-uses Main, Helper_ValueEdit, Tool_Rawedit;
 
 type
@@ -110,4 +82,42 @@
 
 
+procedure TForm_BinEdit.FormCreate(Sender: TObject);
+begin
+  inherited;
+  Self.OnNewFileSelected := NewFile;
+
+  Self.Caption := '';
+  fileid     := 0;
+  VST.NodeDataSize := SizeOf(TNodeData);
+  value_viewer.ColCount := 2;
+  value_viewer.RowCount := 8;
+  value_viewer.FixedRows := 1;
+  value_viewer.Cells[0, 0] := 'Type';
+  value_viewer.Cells[1, 0] := 'Value';
+  value_viewer.Cells[0, 1] := '1 byte, unsigned';
+  value_viewer.Cells[0, 2] := '2 bytes, unsigned';
+  value_viewer.Cells[0, 3] := '4 bytes, unsigned';
+  value_viewer.Cells[0, 4] := 'Bitset';
+  value_viewer.Cells[0, 5] := 'Float';
+  value_viewer.Cells[0, 6] := 'String';
+  value_viewer.Cells[0, 7] := 'Selected length';
+//  value_viewer.ColWidths[0] := 100;
+//  value_viewer.ColWidths[1] := value_viewer.Width - 150;
+//  hex.Height := content.Height - 215;
+  //
+  value_viewer.Font.Charset := AppSettings.CharSet;
+  VST.Font.Charset := AppSettings.CharSet;
+  hex.Translation := tkAsIs;
+  hex.Font.Charset := AppSettings.CharSet;
+  //
+end;
+
+procedure TForm_BinEdit.NewFile(fileinfo: TFileInfo);
+begin
+  LoadDat(fileinfo.ID);
+end;
+
+
+
 
 function AddVSTEntry(AVST: TCustomVirtualStringTree; ANode: PVirtualNode;
@@ -127,5 +137,4 @@
 procedure TForm_BinEdit.LoadDat(_fileid: LongWord);
 var
-  i:    LongWord;
   mem:  TMemoryStream;
   Data: Tdata;
@@ -135,21 +144,12 @@
     if not Save then
     begin
-      for i := 0 to list.Count - 1 do
-      begin
-        if OniDataConnection.ExtractFileID(list.Items.Strings[i]) = fileid then
-        begin
-          list.ItemIndex := i;
-          Exit;
-        end;
-      end;
+      Self.SelectFileID(fileid);
+      Exit;
     end;
   end;
   fileid := _fileid;
-  for i := 0 to list.Count - 1 do
-    if OniDataConnection.ExtractFileID(list.Items.Strings[i]) = fileid then
-    begin
-      list.ItemIndex := i;
-      Break;
-    end;
+  if OniDataConnection.ExtractFileID(
+        filelist.Items.Strings[filelist.ItemIndex]) <> fileid then
+    Self.SelectFileID(fileid);
   Self.ClearStructViewer;
   Data := OniDataConnection.LoadDatFile(fileid);
@@ -172,102 +172,4 @@
 
 
-
-procedure TForm_BinEdit.Recreatelist;
-var
-  i:    LongWord;
-  exts: TStringArray;
-begin
-  combo_extension.Items.Clear;
-  combo_extension.Items.Add('_All files_ (' + IntToStr(
-    OniDataConnection.GetFilesCount) + ')');
-  exts := OniDataConnection.GetExtensionsList;
-  for i := 0 to High(exts) do
-    combo_extension.Items.Add(exts[i]);
-  combo_extension.ItemIndex := 0;
-  combo_extensionClick(Self);
-end;
-
-
-
-
-procedure TForm_BinEdit.LoadFileNames;
-var
-  Extension: String[4];
-  no_zero_bytes: Boolean;
-  pattern: String;
-  files: TStringArray;
-  i: LongWord;
-begin
-  Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
-  no_zero_bytes := not check_zerobyte.Checked;
-  pattern := '';
-  if check_filtername.Checked then
-    pattern := edit_filtername.Text;
-  if Extension = '_All' then
-    Extension := '';
-
-  files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);
-  list.Items.Clear;
-  if Length(files) > 0 then
-    for i := 0 to High(files) do
-      list.Items.Add(files[i]);
-end;
-
-
-
-
-procedure TForm_BinEdit.panel_extensionResize(Sender: TObject);
-begin
-  combo_extension.Width := panel_extension.Width - 5;
-  edit_filtername.Width := panel_extension.Width - 5;
-end;
-
-
-
-
-procedure TForm_BinEdit.combo_extensionClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_BinEdit.check_zerobyteClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_BinEdit.check_filternameClick(Sender: TObject);
-begin
-  edit_filtername.Enabled := not check_filtername.Checked;
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_BinEdit.listClick(Sender: TObject);
-begin
-  LoadDat(OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]));
-end;
-
-
-
-
-procedure TForm_BinEdit.listMouseDown(Sender: TObject; Button: TMouseButton;
-  Shift: TShiftState; X, Y: Integer);
-var
-  pt: TPoint;
-begin
-  pt.X := x;
-  pt.Y := y;
-  list.ItemIndex := list.ItemAtPos(pt, true);
-  if list.ItemIndex > -1 then
-    Self.listClick(Self);
-end;
 
 function IntToBin(Value: Byte): String;
@@ -588,35 +490,4 @@
 
 
-procedure TForm_BinEdit.FormCreate(Sender: TObject);
-begin
-  Self.Caption := '';
-  fileid     := 0;
-  VST.NodeDataSize := SizeOf(TNodeData);
-  value_viewer.ColCount := 2;
-  value_viewer.RowCount := 8;
-  value_viewer.FixedRows := 1;
-  value_viewer.Cells[0, 0] := 'Type';
-  value_viewer.Cells[1, 0] := 'Value';
-  value_viewer.Cells[0, 1] := '1 byte, unsigned';
-  value_viewer.Cells[0, 2] := '2 bytes, unsigned';
-  value_viewer.Cells[0, 3] := '4 bytes, unsigned';
-  value_viewer.Cells[0, 4] := 'Bitset';
-  value_viewer.Cells[0, 5] := 'Float';
-  value_viewer.Cells[0, 6] := 'String';
-  value_viewer.Cells[0, 7] := 'Selected length';
-  value_viewer.ColWidths[0] := 100;
-  value_viewer.ColWidths[1] := value_viewer.Width - 150;
-  hex.Height := panel_data.Height - 215;
-  //
-  value_viewer.Font.Charset := AppSettings.CharSet;
-  VST.Font.Charset := AppSettings.CharSet;
-  hex.Translation := tkAsIs;
-  hex.Font.Charset := AppSettings.CharSet;
-  //
-end;
-
-
-
-
 function TForm_BinEdit.Save: Boolean;
 var
@@ -672,19 +543,4 @@
 
 
-
-
-procedure TForm_BinEdit.FormResize(Sender: TObject);
-begin
-  if Self.Width >= 650 then
-  begin
-  end
-  else
-    Self.Width := 650;
-  if Self.Height >= 450 then
-  begin
-  end
-  else
-    Self.Height := 450;
-end;
 
 
@@ -767,65 +623,4 @@
 
 
-procedure TForm_BinEdit.FormClose(Sender: TObject; var Action: TCloseAction);
-begin
-  Action := caFree;
-end;
-
-
-
-
-procedure TForm_BinEdit.panel_imexportResize(Sender: TObject);
-begin
-  btn_import.Width := panel_imexport.Width - 8;
-  btn_export.Width := panel_imexport.Width - 8;
-end;
-
-
-
-
-procedure TForm_BinEdit.btn_exportClick(Sender: TObject);
-begin
-  saved.Filter     := 'Files of matching extension (*.' + OniDataConnection.GetFileInfo(
-    fileid).Extension + ')|*.' + OniDataConnection.GetFileInfo(fileid).Extension +
-    '|All files|*.*';
-  saved.DefaultExt := OniDataConnection.GetFileInfo(fileid).Extension;
-  if saved.Execute then
-  begin
-    ExportDatFile(fileid, saved.FileName);
-  end;
-end;
-
-
-
-
-procedure TForm_BinEdit.btn_importClick(Sender: TObject);
-var
-  fs: TFileStream;
-begin
-  opend.Filter := 'Files of matching extension (*.' + OniDataConnection.GetFileInfo(
-    fileid).Extension + ')|*.' + OniDataConnection.GetFileInfo(fileid).Extension +
-    '|All files|*.*';
-  if opend.Execute then
-  begin
-    fs := TFileStream.Create(opend.FileName, fmOpenRead);
-    if fs.Size <> hex.DataSize then
-    begin
-      ShowMessage('Can''t import ' + ExtractFilename(opend.FileName) +
-        ', file has to have same size as file in .dat.' + CrLf +
-        'Size of file in .dat: ' + FormatFileSize(hex.datasize) + CrLf +
-        'Size of chosen file: ' + FormatFileSize(fs.Size));
-    end
-    else
-    begin
-      hex.LoadFromStream(fs);
-      hex.Modified := True;
-    end;
-    fs.Free;
-  end;
-end;
-
-
-
-
 procedure TForm_BinEdit.value_viewer_contextPopup(Sender: TObject);
 var
@@ -964,11 +759,5 @@
       begin
         if OniDataConnection.GetRawInfo(fileid, nodedata.offset).raw_size > 0 then
-        begin
-          if Form_Main.open_child('rawedit') then
-          begin
-            TForm_RawEdit(Form_Main.ActiveMDIChild).LoadRaw(
-              OniDataConnection.GetRawInfo(fileid, nodedata.offset));
-          end;
-        end;
+          Form_Main.open_child('rawedit', fileid);
       end;
       if nodedata.DataType = 12 then
@@ -979,19 +768,12 @@
         begin
           if OniDataConnection.GetFileInfo(StrToInt(nodedata.Value)).Size > 0 then
-          begin
-            if Form_Main.open_child('binedit') then
-            begin
-              TForm_BinEdit(Form_Main.ActiveMDIChild).LoadDat(StrToInt(nodedata.Value));
-            end;
-          end
+            Form_Main.open_child('binedit', StrToInt(nodedata.Value))
           else
-          begin
             ShowMessage('Linked filed is a zero-byte-file');
-          end;
         end;
       end;
       if (nodedata.DataType >= 100) and (nodedata.DataType <= 300) then
       begin
-        if Form_Main.open_child('binedit') then
+        if Form_Main.open_child('binedit', -1) then
         begin
           TForm_BinEdit(Form_Main.ActiveMDIChild).edit_filtername.Text := nodedata.Value;
@@ -1196,3 +978,5 @@
 
 
+begin
+  AddToolListEntry('binedit', 'Binary .dat-Editor', '');
 end.
Index: oup/current/Tool_Extractor.dfm
===================================================================
--- oup/current/Tool_Extractor.dfm	(revision 44)
+++ oup/current/Tool_Extractor.dfm	(revision 45)
@@ -1,259 +1,212 @@
-object Form_Extractor: TForm_Extractor
-  Left = 0
-  Top = 0
+inherited Form_Extractor: TForm_Extractor
   Caption = 'Extractor'
-  ClientHeight = 398
-  ClientWidth = 526
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  FormStyle = fsMDIChild
-  OldCreateOrder = False
-  Visible = True
-  WindowState = wsMaximized
-  OnClose = FormClose
   OnCreate = FormCreate
-  OnResize = FormResize
+  ExplicitWidth = 320
+  ExplicitHeight = 240
   PixelsPerInch = 96
   TextHeight = 13
-  object group_select: TGroupBox
-    Left = 0
-    Top = 0
-    Width = 230
-    Height = 398
+  inherited Splitter1: TSplitter
+    Left = 483
+    Align = alRight
+    Visible = False
+    ExplicitLeft = 172
+    ExplicitTop = -8
+    ExplicitHeight = 423
+  end
+  inherited panel_files: TPanel
+    Width = 184
     Align = alClient
-    Caption = '1. Select file(s)'
-    TabOrder = 0
-    ExplicitWidth = 191
-    object panel_extension: TPanel
-      Left = 2
-      Top = 293
-      Width = 226
-      Height = 103
-      Align = alBottom
-      BevelOuter = bvNone
+    ExplicitWidth = 184
+    inherited filelist: TListBox
+      Width = 184
+      ExplicitWidth = 184
+    end
+    inherited panel_extension: TPanel
+      Width = 184
+      ExplicitWidth = 184
+      inherited combo_extension: TComboBox
+        Width = 176
+        ExplicitWidth = 176
+      end
+      inherited edit_filtername: TEdit
+        Width = 176
+        ExplicitWidth = 176
+      end
+    end
+  end
+  inherited content: TPanel
+    Left = 184
+    Width = 299
+    Align = alRight
+    ExplicitLeft = 184
+    ExplicitWidth = 299
+    object group_extract: TGroupBox
+      Left = 3
+      Top = 0
+      Width = 296
+      Height = 423
+      Align = alRight
+      Caption = '2. Select extract-method'
       TabOrder = 0
-      OnResize = panel_extensionResize
-      ExplicitWidth = 187
-      object lbl_filter: TLabel
-        Left = 2
-        Top = 62
-        Width = 100
-        Height = 17
-        AutoSize = False
-        Caption = 'Filter by &extension:'
-        FocusControl = combo_extension
-      end
-      object combo_extension: TComboBox
-        Left = 2
-        Top = 76
-        Width = 145
-        Height = 21
-        Style = csDropDownList
-        DropDownCount = 12
-        Font.Charset = DEFAULT_CHARSET
-        Font.Color = clWindowText
-        Font.Height = -11
-        Font.Name = 'Tahoma'
-        Font.Style = []
-        ItemHeight = 13
-        ParentFont = False
-        Sorted = True
-        TabOrder = 3
-        OnClick = combo_extensionClick
-      end
-      object check_zerobyte: TCheckBox
-        Left = 2
-        Top = 44
-        Width = 130
-        Height = 13
-        Caption = 'Show &zero-byte files'
-        TabOrder = 2
-        OnClick = check_zerobyteClick
-      end
-      object edit_filtername: TEdit
-        Left = 2
-        Top = 20
-        Width = 145
-        Height = 18
-        AutoSize = False
-        TabOrder = 1
-      end
-      object check_filtername: TCheckBox
-        Left = 2
-        Top = 5
-        Width = 130
-        Height = 15
-        Caption = 'Filter by file&name:'
-        TabOrder = 0
-        OnClick = check_filternameClick
-      end
-    end
-    object list: TListBox
-      Left = 2
-      Top = 15
-      Width = 226
-      Height = 278
-      Align = alClient
-      ItemHeight = 13
-      MultiSelect = True
-      TabOrder = 1
-      ExplicitWidth = 187
-    end
-  end
-  object group_extract: TGroupBox
-    Left = 230
-    Top = 0
-    Width = 296
-    Height = 398
-    Align = alRight
-    Caption = '2. Select extract-method'
-    TabOrder = 1
-    ExplicitLeft = 191
-    object group_singlefiles: TGroupBox
-      Left = 8
-      Top = 16
-      Width = 281
-      Height = 185
-      Caption = 'Write data into single files'
-      TabOrder = 0
-      object btn_sel_dat: TButton
+      object group_singlefiles: TGroupBox
+        AlignWithMargins = True
         Left = 8
         Top = 16
-        Width = 129
-        Height = 49
-        Caption = 'Selected files (dat contents only)'
+        Width = 280
+        Height = 185
+        Margins.Left = 6
+        Margins.Top = 1
+        Margins.Right = 6
+        Align = alTop
+        Caption = 'Write data into single files'
         TabOrder = 0
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_sel_datraw: TButton
+        object btn_sel_dat: TButton
+          Left = 8
+          Top = 16
+          Width = 129
+          Height = 49
+          Caption = 'Selected files (dat contents only)'
+          TabOrder = 0
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_sel_datraw: TButton
+          Left = 8
+          Top = 72
+          Width = 129
+          Height = 49
+          Caption = 'Selected files (dat+raw)'
+          TabOrder = 1
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_sel_datraw_convert: TButton
+          Left = 8
+          Top = 128
+          Width = 129
+          Height = 49
+          Caption = 'Selected files (dat+raw) (with convert if possible)'
+          TabOrder = 2
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_all_dat: TButton
+          Left = 144
+          Top = 16
+          Width = 129
+          Height = 49
+          Caption = 'All files in list (dat contents only)'
+          TabOrder = 3
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_all_datraw: TButton
+          Left = 144
+          Top = 72
+          Width = 129
+          Height = 49
+          Caption = 'All files in list (dat+raw)'
+          TabOrder = 4
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_all_datraw_convert: TButton
+          Left = 144
+          Top = 128
+          Width = 129
+          Height = 49
+          BiDiMode = bdLeftToRight
+          Caption = 'All files in list (dat+raw) (with convert if possible)'
+          ParentBiDiMode = False
+          TabOrder = 5
+          WordWrap = True
+          OnClick = Extract
+        end
+      end
+      object group_onefile: TGroupBox
+        AlignWithMargins = True
         Left = 8
-        Top = 72
-        Width = 129
-        Height = 49
-        Caption = 'Selected files (dat+raw)'
+        Top = 205
+        Width = 280
+        Height = 73
+        Margins.Left = 6
+        Margins.Top = 1
+        Margins.Right = 6
+        Align = alTop
+        Caption = 'Write data into one file'
         TabOrder = 1
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_sel_datraw_convert: TButton
+        object btn_sel_files_toone: TButton
+          Left = 8
+          Top = 16
+          Width = 129
+          Height = 49
+          Caption = 'Selected files (dat contents only)'
+          TabOrder = 0
+          WordWrap = True
+          OnClick = Extract
+        end
+        object btn_all_files_toone: TButton
+          Left = 144
+          Top = 16
+          Width = 129
+          Height = 49
+          Caption = 'All files in list (dat contents only)'
+          TabOrder = 1
+          WordWrap = True
+          OnClick = Extract
+        end
+      end
+      object group_progress: TGroupBox
+        AlignWithMargins = True
         Left = 8
-        Top = 128
-        Width = 129
-        Height = 49
-        Caption = 'Selected files (dat+raw) (with convert if possible)'
+        Top = 282
+        Width = 280
+        Height = 132
+        Margins.Left = 6
+        Margins.Top = 1
+        Margins.Right = 6
+        Margins.Bottom = 7
+        Align = alClient
+        Caption = 'Progress ...'
         TabOrder = 2
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_all_dat: TButton
-        Left = 144
-        Top = 16
-        Width = 129
-        Height = 49
-        Caption = 'All files in list (dat contents only)'
-        TabOrder = 3
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_all_datraw: TButton
-        Left = 144
-        Top = 72
-        Width = 129
-        Height = 49
-        Caption = 'All files in list (dat+raw)'
-        TabOrder = 4
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_all_datraw_convert: TButton
-        Left = 144
-        Top = 128
-        Width = 129
-        Height = 49
-        BiDiMode = bdLeftToRight
-        Caption = 'All files in list (dat+raw) (with convert if possible)'
-        ParentBiDiMode = False
-        TabOrder = 5
-        WordWrap = True
-        OnClick = Extract
+        Visible = False
+        object lbl_progress: TLabel
+          Left = 8
+          Top = 40
+          Width = 265
+          Height = 17
+          AutoSize = False
+          Caption = 'Files done: 0/0'
+        end
+        object lbl_estimated: TLabel
+          Left = 8
+          Top = 56
+          Width = 265
+          Height = 17
+          AutoSize = False
+          Caption = 'Estimated finishing time: 00:00:00'
+        end
+        object progress: TProgressBar
+          Left = 8
+          Top = 16
+          Width = 265
+          Height = 17
+          Smooth = True
+          TabOrder = 0
+        end
+        object btn_abort: TButton
+          Left = 8
+          Top = 72
+          Width = 97
+          Height = 23
+          Caption = 'Abort'
+          Enabled = False
+          TabOrder = 1
+          OnClick = btn_abortClick
+        end
       end
     end
-    object group_onefile: TGroupBox
-      Left = 8
-      Top = 208
-      Width = 281
-      Height = 73
-      Caption = 'Write data into one file'
-      TabOrder = 1
-      object btn_sel_files_toone: TButton
-        Left = 8
-        Top = 16
-        Width = 129
-        Height = 49
-        Caption = 'Selected files (dat contents only)'
-        TabOrder = 0
-        WordWrap = True
-        OnClick = Extract
-      end
-      object btn_all_files_toone: TButton
-        Left = 144
-        Top = 16
-        Width = 129
-        Height = 49
-        Caption = 'All files in list (dat contents only)'
-        TabOrder = 1
-        WordWrap = True
-        OnClick = Extract
-      end
-    end
-    object group_progress: TGroupBox
-      Left = 8
-      Top = 288
-      Width = 281
-      Height = 105
-      Caption = 'Progress ...'
-      TabOrder = 2
-      Visible = False
-      object lbl_progress: TLabel
-        Left = 8
-        Top = 40
-        Width = 265
-        Height = 17
-        AutoSize = False
-        Caption = 'Files done: 0/0'
-      end
-      object lbl_estimated: TLabel
-        Left = 8
-        Top = 56
-        Width = 265
-        Height = 17
-        AutoSize = False
-        Caption = 'Estimated finishing time: 00:00:00'
-      end
-      object progress: TProgressBar
-        Left = 8
-        Top = 16
-        Width = 265
-        Height = 17
-        Smooth = True
-        TabOrder = 0
-      end
-      object btn_abort: TButton
-        Left = 8
-        Top = 72
-        Width = 97
-        Height = 23
-        Caption = 'Abort'
-        Enabled = False
-        TabOrder = 1
-      end
-    end
-  end
-  object saved: TSaveDialog
+  end
+  object saved: TSaveDialog [3]
     Left = 448
     Top = 328
Index: oup/current/Tool_Extractor.pas
===================================================================
--- oup/current/Tool_Extractor.pas	(revision 44)
+++ oup/current/Tool_Extractor.pas	(revision 45)
@@ -1,13 +1,10 @@
 unit Tool_Extractor;
-
 interface
-
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, ExtCtrls, StrUtils, ComCtrls;
+  Dialogs, Tool_Template, StdCtrls, ExtCtrls, ComCtrls, Menus;
 
 type
-  TForm_Extractor = class(TForm)
-    group_select: TGroupBox;
+  TForm_Extractor = class(TForm_ToolTemplate)
     group_extract: TGroupBox;
     group_singlefiles: TGroupBox;
@@ -18,31 +15,16 @@
     btn_all_datraw: TButton;
     btn_all_datraw_convert: TButton;
-    group_onefile: TGroupBox;
     btn_sel_files_toone: TButton;
     btn_all_files_toone: TButton;
+    group_onefile: TGroupBox;
     group_progress: TGroupBox;
-    progress: TProgressBar;
     lbl_progress: TLabel;
     lbl_estimated: TLabel;
+    progress: TProgressBar;
     btn_abort: TButton;
     saved: TSaveDialog;
-    panel_extension: TPanel;
-    lbl_filter: TLabel;
-    combo_extension: TComboBox;
-    check_zerobyte: TCheckBox;
-    edit_filtername: TEdit;
-    check_filtername: TCheckBox;
-    list: TListBox;
-    procedure LoadFileNames;
-    procedure check_filternameClick(Sender: TObject);
-    procedure check_zerobyteClick(Sender: TObject);
-    procedure combo_extensionClick(Sender: TObject);
-    procedure panel_extensionResize(Sender: TObject);
-    procedure Recreatelist;
-
     procedure FormCreate(Sender: TObject);
-    procedure FormClose(Sender: TObject; var Action: TCloseAction);
-    procedure FormResize(Sender: TObject);
     procedure Extract(Sender: TObject);
+    procedure btn_abortClick(Sender: TObject);
   private
   public
@@ -53,120 +35,12 @@
 
 implementation
-
 {$R *.dfm}
-
 uses Main, Code_Functions, Data, Code_OniDataClass;
-
-
-
-
-procedure TForm_Extractor.Recreatelist;
-var
-  i:    LongWord;
-  exts: TStringArray;
-begin
-  combo_extension.Items.Clear;
-  combo_extension.Items.Add('_All files_ (' + IntToStr(
-    OniDataConnection.GetFilesCount) + ')');
-  exts := OniDataConnection.GetExtensionsList;
-  for i := 0 to High(exts) do
-    combo_extension.Items.Add(exts[i]);
-  combo_extension.ItemIndex := 0;
-  combo_extensionClick(Self);
-end;
-
-
-
-
-procedure TForm_Extractor.LoadFileNames;
-var
-  Extension: String[4];
-  no_zero_bytes: Boolean;
-  pattern: String;
-  files: TStringArray;
-  i: LongWord;
-begin
-  Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
-  no_zero_bytes := not check_zerobyte.Checked;
-  pattern := '';
-  if check_filtername.Checked then
-    pattern := edit_filtername.Text;
-  if Extension = '_All' then
-    Extension := '';
-
-  files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);
-  list.Items.Clear;
-  if Length(files) > 0 then
-    for i := 0 to High(files) do
-      list.Items.Add(files[i]);
-end;
-
-
-
-
-procedure TForm_Extractor.panel_extensionResize(Sender: TObject);
-begin
-  combo_extension.Width := panel_extension.Width - 5;
-  edit_filtername.Width := panel_extension.Width - 5;
-end;
-
-
-
-
-procedure TForm_Extractor.combo_extensionClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_Extractor.check_zerobyteClick(Sender: TObject);
-var
-  i: Byte;
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_Extractor.check_filternameClick(Sender: TObject);
-begin
-  edit_filtername.Enabled := not check_filtername.Checked;
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_Extractor.FormResize(Sender: TObject);
-begin
-  if Self.Width >= 450 then
-  begin
-  end
-  else
-    Self.Width := 450;
-  if Self.Height >= 400 then
-  begin
-    group_progress.Height := group_extract.Height - 293;
-  end
-  else
-    Self.Height := 400;
-end;
-
-
-
-
-procedure TForm_Extractor.FormClose(Sender: TObject; var Action: TCloseAction);
-begin
-  Action := caFree;
-end;
-
-
-
 
 procedure TForm_Extractor.FormCreate(Sender: TObject);
 begin
+  inherited;
+  Self.AllowMultiSelect := True;
+
   btn_sel_dat.Caption    := 'Selected files' + CrLf + '(dat contents only)';
   btn_sel_datraw.Caption := 'Selected files' + CrLf + '(dat+raw contents)';
@@ -181,6 +55,8 @@
 end;
 
-
-
+procedure TForm_Extractor.btn_abortClick(Sender: TObject);
+begin
+  ShowMessage('X');
+end;
 
 procedure TForm_Extractor.Extract(Sender: TObject);
@@ -213,5 +89,5 @@
     begintime := Time;
     group_progress.Visible := True;
-    group_select.Enabled := False;
+    panel_files.Enabled := False;
     group_singlefiles.Enabled := False;
     group_onefile.Enabled := False;
@@ -230,5 +106,5 @@
         begin
           group_progress.Visible    := False;
-          group_select.Enabled      := True;
+          panel_files.Enabled      := True;
           group_singlefiles.Enabled := True;
           group_onefile.Enabled     := True;
@@ -242,16 +118,16 @@
     if sel_only then
     begin
-      files := list.SelCount;
+      files := filelist.SelCount;
       lbl_progress.Caption := 'Files done: 0/' + IntToStr(files);
       progress.Max := files;
       done  := 0;
-      for i := 0 to list.Count - 1 do
+      for i := 0 to filelist.Count - 1 do
       begin
-        if list.Selected[i] then
+        if filelist.Selected[i] then
         begin
           if one_file then
           begin
             ExportFile(OniDataConnection.ExtractFileID(
-              list.Items.Strings[list.ItemIndex]), ExtractFileName(saved.FileName),
+              filelist.Items.Strings[filelist.ItemIndex]), ExtractFileName(saved.FileName),
               settings, ExtractFileDir(saved.FileName));
           end
@@ -259,5 +135,5 @@
           begin
             ExportFile(OniDataConnection.ExtractFileID(
-              list.Items.Strings[list.ItemIndex]), list.Items.Strings[i], settings, 'D:');
+              filelist.Items.Strings[filelist.ItemIndex]), filelist.Items.Strings[i], settings, 'D:');
           end;
           Inc(done);
@@ -276,13 +152,13 @@
     else
     begin
-      files := list.Count;
+      files := filelist.Count;
       lbl_progress.Caption := 'Files done: 0/' + IntToStr(files);
       progress.Max := files;
-      for i := 0 to list.Count - 1 do
+      for i := 0 to filelist.Count - 1 do
       begin
         if one_file then
         begin
           ExportFile(OniDataConnection.ExtractFileID(
-            list.Items.Strings[list.ItemIndex]), ExtractFileName(saved.FileName),
+            filelist.Items.Strings[filelist.ItemIndex]), ExtractFileName(saved.FileName),
             settings, ExtractFileDir(saved.FileName));
         end
@@ -290,5 +166,5 @@
         begin
           ExportFile(OniDataConnection.ExtractFileID(
-            list.Items.Strings[list.ItemIndex]), list.Items.Strings[i], settings, 'D:');
+            filelist.Items.Strings[filelist.ItemIndex]), filelist.Items.Strings[i], settings, 'D:');
         end;
         if ((i mod 10) = 0) and (i >= 50) then
@@ -304,5 +180,5 @@
     end;
     group_progress.Visible    := False;
-    group_select.Enabled      := True;
+    panel_files.Enabled      := True;
     group_singlefiles.Enabled := True;
     group_onefile.Enabled     := True;
@@ -310,3 +186,5 @@
 end;
 
+begin
+  AddToolListEntry('extractor', 'Extractor', '');
 end.
Index: oup/current/Tool_Preview.dfm
===================================================================
--- oup/current/Tool_Preview.dfm	(revision 44)
+++ oup/current/Tool_Preview.dfm	(revision 45)
@@ -1,48 +1,10 @@
-object Form_Preview: TForm_Preview
-  Left = 0
-  Top = 0
+inherited Form_Preview: TForm_Preview
   Caption = 'Preview'
-  ClientHeight = 473
-  ClientWidth = 472
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  FormStyle = fsMDIChild
-  OldCreateOrder = False
-  Visible = True
-  WindowState = wsMaximized
-  OnClose = FormClose
   OnCreate = FormCreate
-  OnResize = FormResize
+  ExplicitWidth = 320
+  ExplicitHeight = 240
   PixelsPerInch = 96
   TextHeight = 13
-  object Splitter1: TSplitter
-    Left = 200
-    Top = 0
-    Width = 9
-    Height = 473
-    AutoSnap = False
-    Beveled = True
-    MinSize = 150
-  end
-  object panel_preview: TPanel
-    Left = 209
-    Top = 0
-    Width = 263
-    Height = 473
-    Align = alClient
-    BevelOuter = bvNone
-    TabOrder = 0
-    object img: TImage
-      Left = 0
-      Top = 20
-      Width = 263
-      Height = 453
-      Align = alClient
-      ExplicitWidth = 313
-    end
+  inherited content: TPanel
     object lbl_notpossible: TLabel
       Left = 16
@@ -61,8 +23,17 @@
       WordWrap = True
     end
+    object img: TImage
+      Left = 0
+      Top = 20
+      Width = 283
+      Height = 403
+      Align = alClient
+      ExplicitWidth = 313
+      ExplicitHeight = 453
+    end
     object panel_buttons: TPanel
       Left = 0
       Top = 0
-      Width = 263
+      Width = 283
       Height = 20
       Align = alTop
@@ -102,92 +73,9 @@
     end
   end
-  object panel_files: TPanel
-    Left = 0
-    Top = 0
-    Width = 200
-    Height = 473
-    Align = alLeft
-    BevelOuter = bvNone
-    TabOrder = 1
-    object list: TListBox
-      Left = 0
-      Top = 0
-      Width = 200
-      Height = 370
-      Align = alClient
-      ItemHeight = 13
-      TabOrder = 0
-      OnClick = listClick
-      OnMouseDown = listMouseDown
-    end
-    object panel_extension: TPanel
-      Left = 0
-      Top = 370
-      Width = 200
-      Height = 103
-      Align = alBottom
-      BevelOuter = bvNone
-      TabOrder = 1
-      OnResize = panel_extensionResize
-      object lbl_filter: TLabel
-        Left = 2
-        Top = 62
-        Width = 100
-        Height = 17
-        AutoSize = False
-        Caption = 'Filter by &extension:'
-        FocusControl = combo_extension
-      end
-      object combo_extension: TComboBox
-        Left = 2
-        Top = 76
-        Width = 145
-        Height = 21
-        Style = csDropDownList
-        DropDownCount = 12
-        Font.Charset = DEFAULT_CHARSET
-        Font.Color = clWindowText
-        Font.Height = -11
-        Font.Name = 'Tahoma'
-        Font.Style = []
-        ItemHeight = 13
-        ParentFont = False
-        Sorted = True
-        TabOrder = 3
-        OnClick = combo_extensionClick
-      end
-      object check_zerobyte: TCheckBox
-        Left = 2
-        Top = 44
-        Width = 130
-        Height = 13
-        Caption = 'Show &zero-byte files'
-        TabOrder = 2
-        OnClick = check_zerobyteClick
-      end
-      object edit_filtername: TEdit
-        Left = 2
-        Top = 20
-        Width = 145
-        Height = 18
-        AutoSize = False
-        TabOrder = 1
-      end
-      object check_filtername: TCheckBox
-        Left = 2
-        Top = 5
-        Width = 130
-        Height = 15
-        Caption = 'Filter by file&name:'
-        TabOrder = 0
-        OnClick = check_filternameClick
-      end
-    end
-  end
-  object timer: TTimer
+  object timer: TTimer [3]
     Enabled = False
     OnTimer = timerTimer
-    Left = 144
-    Top = 24
+    Left = 400
+    Top = 120
   end
 end
Index: oup/current/Tool_Preview.pas
===================================================================
--- oup/current/Tool_Preview.pas	(revision 44)
+++ oup/current/Tool_Preview.pas	(revision 45)
@@ -1,37 +1,20 @@
 unit Tool_Preview;
-
 interface
-
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, Math, ExtCtrls, StdCtrls, StrUtils, Menus,
-  Code_Functions, Data, Code_Exporters, Code_OniImgClass, Code_OniDataClass;
+  Dialogs, StdCtrls, Tool_Template, ExtCtrls, Math, StrUtils,
+  Code_OniDataClass, Code_OniImgClass, Data, Menus;
 
 type
-  TForm_Preview = class(TForm)
-    timer:   TTimer;
-    panel_preview: TPanel;
-    img:     TImage;
+  TForm_Preview = class(TForm_ToolTemplate)
+    lbl_notpossible: TLabel;
     panel_buttons: TPanel;
     btn_dec: TButton;
     btn_startstop: TButton;
     btn_inc: TButton;
-    Splitter1: TSplitter;
-    lbl_notpossible: TLabel;
-    panel_files: TPanel;
-    list:    TListBox;
-    panel_extension: TPanel;
-    lbl_filter: TLabel;
-    combo_extension: TComboBox;
-    check_zerobyte: TCheckBox;
-    edit_filtername: TEdit;
-    check_filtername: TCheckBox;
-    procedure LoadFileNames;
-    procedure check_filternameClick(Sender: TObject);
-    procedure check_zerobyteClick(Sender: TObject);
-    procedure combo_extensionClick(Sender: TObject);
-    procedure panel_extensionResize(Sender: TObject);
-    procedure listClick(Sender: TObject);
-    procedure Recreatelist;
+    img: TImage;
+    timer: TTimer;
+    procedure FormCreate(Sender: TObject);
+    procedure NewFile(fileinfo: TFileInfo);
 
     procedure PreviewImage;
@@ -39,16 +22,11 @@
     procedure btn_incClick(Sender: TObject);
     procedure btn_decClick(Sender: TObject);
-    procedure FormResize(Sender: TObject);
     procedure btn_startstopClick(Sender: TObject);
+    procedure timerTimer(Sender: TObject);
     procedure panel_buttonsResize(Sender: TObject);
-    procedure timerTimer(Sender: TObject);
-    procedure FormCreate(Sender: TObject);
-    procedure FormClose(Sender: TObject; var Action: TCloseAction);
 
     procedure DrawImage(index: Integer);
     procedure SetBitmapCount(Count: Integer);
     procedure LoadImage(fileid, index: Integer);
-    procedure listMouseDown(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: Integer);
   private
     bitmaps:   array of TBitmap;
@@ -62,54 +40,34 @@
 
 implementation
-
 {$R *.dfm}
 
-uses Main;
-
-
-
-
-procedure TForm_Preview.Recreatelist;
-var
-  i:    LongWord;
-  exts: TStringArray;
-begin
-  combo_extension.Items.Clear;
-  combo_extension.Items.Add('_All files_ (' +
-    IntToStr(OniDataConnection.GetFilesCount) + ')');
-  exts := OniDataConnection.GetExtensionsList;
-  for i := 0 to High(exts) do
-    combo_extension.Items.Add(exts[i]);
-  combo_extension.ItemIndex := 0;
-  combo_extensionClick(Self);
-end;
-
-
-
-
-procedure TForm_Preview.LoadFileNames;
-var
-  Extension: String[4];
-  no_zero_bytes: Boolean;
-  pattern: String;
-  files: TStringArray;
-  i: LongWord;
-begin
-  Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
-  no_zero_bytes := not check_zerobyte.Checked;
-  pattern := '';
-  if check_filtername.Checked then
-    pattern := edit_filtername.Text;
-  if Extension = '_All' then
-    Extension := '';
-
-  files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);
-  list.Items.Clear;
-  if Length(files) > 0 then
-    for i := 0 to High(files) do
-      list.Items.Add(files[i]);
-end;
-
-
+
+procedure TForm_Preview.FormCreate(Sender: TObject);
+begin
+  inherited;
+  Self.OnNewFileSelected := NewFile;
+end;
+
+
+procedure TForm_Preview.NewFile(fileinfo: TFileInfo);
+var
+  ext: String;
+begin
+  _fileid := fileinfo.ID;
+  lbl_notpossible.Visible := False;
+  Self.img.Visible := True;
+  Self.timer.Enabled := False;
+  Self.panel_buttons.Visible := False;
+  ext     := fileinfo.Extension;
+  if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then
+    PreviewImage
+  else if ext = 'TXAN' then
+    PreviewTXAN
+  else
+  begin
+    Self.lbl_notpossible.Visible := True;
+    Self.img.Visible := False;
+  end;
+end;
 
 
@@ -134,13 +92,4 @@
 
 
-
-
-procedure TForm_Preview.combo_extensionClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
 procedure TForm_Preview.DrawImage(index: Integer);
 begin
@@ -153,6 +102,4 @@
 
 
-
-
 procedure TForm_Preview.SetBitmapCount(Count: Integer);
 var
@@ -175,59 +122,4 @@
 
 
-
-
-procedure TForm_Preview.check_zerobyteClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_Preview.check_filternameClick(Sender: TObject);
-begin
-  edit_filtername.Enabled := not check_filtername.Checked;
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_Preview.listClick(Sender: TObject);
-var
-  ext: String;
-begin
-  _fileid := OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]);
-  lbl_notpossible.Visible := False;
-  Self.img.Visible := True;
-  Self.timer.Enabled := False;
-  Self.panel_buttons.Visible := False;
-  ext     := RightStr(list.Items.Strings[list.ItemIndex], 4);
-  if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then
-    PreviewImage
-  else if ext = 'TXAN' then
-    PreviewTXAN
-  else
-  begin
-    Self.lbl_notpossible.Visible := True;
-    Self.img.Visible := False;
-  end;
-end;
-
-
-
-
-procedure TForm_Preview.listMouseDown(Sender: TObject; Button: TMouseButton;
-  Shift: TShiftState; X, Y: Integer);
-var
-  pt: TPoint;
-begin
-  pt.X := x;
-  pt.Y := y;
-  list.ItemIndex := list.ItemAtPos(pt, true);
-  if list.ItemIndex > -1 then
-    Self.listClick(Self);
-end;
-
 procedure TForm_Preview.PreviewImage;
 begin
@@ -236,6 +128,4 @@
   DrawImage(0);
 end;
-
-
 
 
@@ -266,12 +156,8 @@
 
 
-
-
 procedure TForm_Preview.timerTimer(Sender: TObject);
 begin
   btn_incClick(Self);
 end;
-
-
 
 
@@ -288,6 +174,4 @@
 
 
-
-
 procedure TForm_Preview.btn_decClick(Sender: TObject);
 begin
@@ -302,6 +186,4 @@
 
 
-
-
 procedure TForm_Preview.btn_incClick(Sender: TObject);
 begin
@@ -316,6 +198,4 @@
 
 
-
-
 procedure TForm_Preview.panel_buttonsResize(Sender: TObject);
 begin
@@ -325,40 +205,5 @@
 
 
-
-
-procedure TForm_Preview.panel_extensionResize(Sender: TObject);
-begin
-  combo_extension.Width := panel_extension.Width - 5;
-  edit_filtername.Width := panel_extension.Width - 5;
-end;
-
-
-
-
-procedure TForm_Preview.FormResize(Sender: TObject);
-begin
-  if Self.Width < 300 then
-    Self.Width := 300;
-  if Self.Height < 200 then
-    Self.Height := 200;
-end;
-
-
-
-
-procedure TForm_Preview.FormCreate(Sender: TObject);
-begin
-  SetLength(bitmaps, 0);
-  Self.Width  := 260;
-  Self.Height := 300;
-end;
-
-
-
-
-procedure TForm_Preview.FormClose(Sender: TObject; var Action: TCloseAction);
-begin
-  Action := caFree;
-end;
-
+begin
+  AddToolListEntry('preview', 'Preview-Window', '');
 end.
Index: oup/current/Tool_RawEdit.dfm
===================================================================
--- oup/current/Tool_RawEdit.dfm	(revision 44)
+++ oup/current/Tool_RawEdit.dfm	(revision 45)
@@ -1,50 +1,87 @@
-object Form_RawEdit: TForm_RawEdit
-  Left = 0
-  Top = 0
-  BorderIcons = [biSystemMenu, biMaximize]
-  Caption = 'Binary .raw-Editor'
-  ClientHeight = 640
-  ClientWidth = 642
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  FormStyle = fsMDIChild
-  KeyPreview = True
-  OldCreateOrder = False
-  Visible = True
-  WindowState = wsMaximized
-  OnClose = FormClose
+inherited Form_RawEdit: TForm_RawEdit
+  Caption = 'RawEdit'
   OnCloseQuery = FormCloseQuery
   OnCreate = FormCreate
   OnKeyUp = FormKeyUp
-  OnResize = FormResize
+  ExplicitWidth = 320
+  ExplicitHeight = 240
   PixelsPerInch = 96
   TextHeight = 13
-  object Splitter1: TSplitter
-    Left = 200
-    Top = 0
-    Width = 9
-    Height = 640
-    AutoSnap = False
-    Beveled = True
-    MinSize = 150
-    ExplicitLeft = 150
+  inherited panel_files: TPanel
+    object Splitter4: TSplitter [0]
+      Left = 0
+      Top = 205
+      Width = 200
+      Height = 8
+      Cursor = crVSplit
+      Align = alBottom
+      AutoSnap = False
+      Beveled = True
+      MinSize = 150
+      ExplicitLeft = 3
+      ExplicitTop = 89
+    end
+    inherited filelist: TListBox
+      Height = 102
+      ExplicitHeight = 102
+    end
+    object panel_imexport: TPanel
+      Left = 0
+      Top = 363
+      Width = 200
+      Height = 60
+      Align = alBottom
+      BevelOuter = bvNone
+      TabOrder = 3
+      DesignSize = (
+        200
+        60)
+      object btn_export: TButton
+        Left = 4
+        Top = 4
+        Width = 190
+        Height = 25
+        Anchors = [akLeft, akTop, akRight]
+        Caption = 'Export to file...'
+        TabOrder = 0
+        OnClick = btn_exportClick
+      end
+      object btn_import: TButton
+        Left = 4
+        Top = 32
+        Width = 190
+        Height = 25
+        Anchors = [akLeft, akTop, akRight]
+        Caption = 'Import from file...'
+        TabOrder = 1
+        OnClick = btn_importClick
+      end
+    end
+    object GroupBox1: TGroupBox
+      Left = 0
+      Top = 213
+      Width = 200
+      Height = 150
+      Align = alBottom
+      Caption = '2. Select .dat-link-offset'
+      TabOrder = 2
+      object list_offset: TListBox
+        Left = 2
+        Top = 15
+        Width = 196
+        Height = 133
+        Align = alClient
+        ItemHeight = 13
+        TabOrder = 0
+        OnClick = list_offsetClick
+      end
+    end
   end
-  object panel_data: TPanel
-    Left = 209
-    Top = 0
-    Width = 433
-    Height = 640
-    Align = alClient
-    BevelOuter = bvNone
-    TabOrder = 0
-    OnResize = panel_dataResize
+  inherited content: TPanel
+    OnResize = panel_contentResize
     object Splitter2: TSplitter
       Left = 0
-      Top = 450
-      Width = 433
+      Top = 300
+      Width = 283
       Height = 9
       Cursor = crVSplit
@@ -53,12 +90,11 @@
       Beveled = True
       MinSize = 40
-      ExplicitTop = 209
-      ExplicitWidth = 483
+      ExplicitTop = 414
     end
     object hex: TMPHexEditor
       Left = 0
       Top = 0
-      Width = 433
-      Height = 450
+      Width = 283
+      Height = 300
       Cursor = crIBeam
       Align = alTop
@@ -98,7 +134,7 @@
     object value_viewer: TWrapGrid
       Left = 0
-      Top = 459
-      Width = 433
-      Height = 181
+      Top = 309
+      Width = 283
+      Height = 114
       Align = alClient
       ColCount = 1
@@ -121,147 +157,5 @@
     end
   end
-  object panel_files: TPanel
-    Left = 0
-    Top = 0
-    Width = 200
-    Height = 640
-    Align = alLeft
-    BevelOuter = bvNone
-    TabOrder = 1
-    object Splitter4: TSplitter
-      Left = 0
-      Top = 442
-      Width = 200
-      Height = 9
-      Cursor = crVSplit
-      Align = alBottom
-      AutoSnap = False
-      Beveled = True
-      MinSize = 150
-      ExplicitWidth = 150
-    end
-    object panel_imexport: TPanel
-      Left = 0
-      Top = 580
-      Width = 200
-      Height = 60
-      Align = alBottom
-      BevelOuter = bvNone
-      TabOrder = 0
-      OnResize = panel_imexportResize
-      object btn_export: TButton
-        Left = 4
-        Top = 4
-        Width = 142
-        Height = 25
-        Caption = 'Export to file...'
-        TabOrder = 0
-        OnClick = btn_exportClick
-      end
-      object btn_import: TButton
-        Left = 4
-        Top = 32
-        Width = 142
-        Height = 25
-        Caption = 'Import from file...'
-        TabOrder = 1
-        OnClick = btn_importClick
-      end
-    end
-    object group_file: TGroupBox
-      Left = 0
-      Top = 0
-      Width = 200
-      Height = 442
-      Align = alClient
-      Caption = '1. Select file'
-      TabOrder = 1
-      object list: TListBox
-        Left = 2
-        Top = 15
-        Width = 196
-        Height = 337
-        Align = alClient
-        ItemHeight = 13
-        TabOrder = 0
-        OnClick = listClick
-        OnMouseDown = listMouseDown
-      end
-      object panel_extension: TPanel
-        Left = 2
-        Top = 352
-        Width = 196
-        Height = 88
-        Align = alBottom
-        BevelOuter = bvNone
-        TabOrder = 1
-        OnResize = panel_extensionResize
-        object lbl_filter: TLabel
-          Left = 2
-          Top = 46
-          Width = 100
-          Height = 17
-          AutoSize = False
-          Caption = 'Filter by &extension:'
-          FocusControl = combo_extension
-        end
-        object combo_extension: TComboBox
-          Left = 2
-          Top = 60
-          Width = 145
-          Height = 21
-          Style = csDropDownList
-          DropDownCount = 12
-          Font.Charset = DEFAULT_CHARSET
-          Font.Color = clWindowText
-          Font.Height = -11
-          Font.Name = 'Tahoma'
-          Font.Style = []
-          ItemHeight = 13
-          ParentFont = False
-          Sorted = True
-          TabOrder = 2
-          OnClick = combo_extensionClick
-        end
-        object edit_filtername: TEdit
-          Left = 2
-          Top = 20
-          Width = 145
-          Height = 18
-          AutoSize = False
-          TabOrder = 1
-        end
-        object check_filtername: TCheckBox
-          Left = 2
-          Top = 5
-          Width = 130
-          Height = 15
-          Caption = 'Filter by file&name:'
-          TabOrder = 0
-          OnClick = check_filternameClick
-        end
-      end
-    end
-    object GroupBox1: TGroupBox
-      Left = 0
-      Top = 451
-      Width = 200
-      Height = 129
-      Align = alBottom
-      Caption = '2. Select .dat-link-offset'
-      TabOrder = 2
-      object list_offset: TListBox
-        Left = 2
-        Top = 15
-        Width = 196
-        Height = 112
-        Align = alClient
-        ItemHeight = 13
-        TabOrder = 0
-        OnClick = list_offsetClick
-      end
-    end
-  end
-  object value_viewer_context: TPopupMenu
+  object value_viewer_context: TPopupMenu [3]
     AutoHotkeys = maManual
     OnPopup = value_viewer_contextPopup
@@ -293,13 +187,13 @@
     end
   end
-  object opend: TOpenDialog
+  object opend: TOpenDialog [4]
     Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing]
-    Left = 120
-    Top = 584
+    Left = 128
+    Top = 256
   end
-  object saved: TSaveDialog
+  object saved: TSaveDialog [5]
     Options = [ofOverwritePrompt, ofPathMustExist, ofEnableSizing]
-    Left = 120
-    Top = 608
+    Left = 128
+    Top = 280
   end
 end
Index: oup/current/Tool_RawEdit.pas
===================================================================
--- oup/current/Tool_RawEdit.pas	(revision 44)
+++ oup/current/Tool_RawEdit.pas	(revision 45)
@@ -1,53 +1,49 @@
 unit Tool_RawEdit;
-
 interface
-
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, Wrapgrid, StdCtrls, Grids, StrUtils, MPHexEditor, ExtCtrls, Clipbrd,
-  Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass,
-  Menus, Math;
+  Dialogs, Tool_Template, StdCtrls, ExtCtrls, Menus, Grids, Wrapgrid,
+  MPHexEditor, Clipbrd, StrUtils,
+  Data, Code_Functions, Code_DataStructures, Code_Exporters, Code_OniDataClass;
 
 type
-  TForm_RawEdit = class(TForm)
-    Splitter1: TSplitter;
-    panel_data: TPanel;
-    hex:   TMPHexEditor;
+  TForm_RawEdit = class(TForm_ToolTemplate)
+    Splitter4: TSplitter;
+    panel_imexport: TPanel;
+    btn_export: TButton;
+    btn_import: TButton;
+    GroupBox1: TGroupBox;
+    list_offset: TListBox;
+    hex: TMPHexEditor;
     Splitter2: TSplitter;
     value_viewer: TWrapGrid;
     value_viewer_context: TPopupMenu;
     value_viewer_context_copy: TMenuItem;
-    value_viewer_context_copyashex: TMenuItem;
     value_viewer_context_copyasdec: TMenuItem;
     value_viewer_context_copyasfloat: TMenuItem;
     value_viewer_context_copyasbitset: TMenuItem;
     value_viewer_context_copyasstring: TMenuItem;
-    panel_files: TPanel;
+    value_viewer_context_copyashex: TMenuItem;
     opend: TOpenDialog;
     saved: TSaveDialog;
-    panel_imexport: TPanel;
-    btn_export: TButton;
-    btn_import: TButton;
-    group_file: TGroupBox;
-    list:  TListBox;
-    panel_extension: TPanel;
-    lbl_filter: TLabel;
-    combo_extension: TComboBox;
-    edit_filtername: TEdit;
-    check_filtername: TCheckBox;
-    GroupBox1: TGroupBox;
-    list_offset: TListBox;
-    Splitter4: TSplitter;
-    procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure list_offsetClick(Sender: TObject);
+    procedure NewFile(fileinfo: TFileInfo);
     procedure LoadRaw(raw_info: TRawInfo);
-    procedure LoadFileNames;
-    procedure check_filternameClick(Sender: TObject);
-    procedure combo_extensionClick(Sender: TObject);
-    procedure panel_extensionResize(Sender: TObject);
-    procedure listClick(Sender: TObject);
-    procedure Recreatelist;
-
+    function Save: Boolean;
+
+    procedure btn_importClick(Sender: TObject);
+    procedure btn_exportClick(Sender: TObject);
+
+    procedure FormCreate(Sender: TObject);
+    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
+
+    procedure panel_contentResize(Sender: TObject);
+
+    function GetValue(datatype: Word; offset: LongWord): String;
+    procedure ClearValues;
+    procedure WriteValues;
+    procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);
+
     procedure value_viewerDblClick(Sender: TObject);
     procedure value_viewer_context_copyClick(Sender: TObject);
@@ -55,21 +51,8 @@
       Shift: TShiftState; X, Y: Integer);
     procedure value_viewer_contextPopup(Sender: TObject);
-    procedure btn_importClick(Sender: TObject);
-    procedure btn_exportClick(Sender: TObject);
-    procedure panel_imexportResize(Sender: TObject);
-    function Save: Boolean;
-    procedure FormClose(Sender: TObject; var Action: TCloseAction);
-    function GetValue(datatype: Word; offset: LongWord): String;
+
+    procedure hexKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
     procedure hexSelectionChanged(Sender: TObject);
     procedure hexChange(Sender: TObject);
-    procedure panel_dataResize(Sender: TObject);
-    procedure FormResize(Sender: TObject);
-    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
-    procedure FormCreate(Sender: TObject);
-    procedure ClearValues;
-    procedure WriteValues;
-    procedure SetNewValue(datatype: Word; offset: LongWord; Value: String);
-    procedure listMouseDown(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: Integer);
   private
     fileid:     LongWord;
@@ -83,11 +66,30 @@
 
 implementation
-
 {$R *.dfm}
-
 uses Main, Helper_ValueEdit;
 
-
-
+procedure TForm_RawEdit.NewFile(fileinfo: TFileInfo);
+var
+  offsets: TRawList;
+  i: Integer;
+begin
+  if hex.Modified then
+    if not Save then
+      Exit;
+  ClearValues;
+  hex.DataSize := 0;
+  fileid := fileinfo.ID;
+  list_offset.Enabled := False;
+  if fileinfo.size > 0 then
+  begin
+    offsets := OniDataConnection.GetRawList(fileid);
+    list_offset.Items.Clear;
+    if Length(offsets) > 0 then
+      for i := 0 to High(offsets) do
+        list_offset.Items.Add('0x' + IntToHex(offsets[i].src_offset, 8) +
+              ', ' + IntToStr(offsets[i].raw_size) + ' bytes');
+    list_offset.Enabled := True;
+  end;
+end;
 
 procedure TForm_RawEdit.LoadRaw(raw_info: TRawInfo);
@@ -95,5 +97,4 @@
   i:    LongWord;
   Data: Tdata;
-  mem:  TMemoryStream;
 begin
   if hex.Modified then
@@ -106,9 +107,9 @@
   if list_offset.Count = 0 then
   begin
-    for i := 0 to list.Count - 1 do
-    begin
-      if OniDataConnection.ExtractFileID(list.Items.Strings[i]) = raw_info.src_id then
-      begin
-        list.ItemIndex := i;
+    for i := 0 to filelist.Count - 1 do
+    begin
+      if OniDataConnection.ExtractFileID(filelist.Items.Strings[i]) = raw_info.src_id then
+      begin
+        filelist.ItemIndex := i;
         listClick(Self);
         Break;
@@ -150,142 +151,5 @@
 
 
-procedure TForm_RawEdit.Recreatelist;
-var
-  i:     LongWord;
-  exts:  TStringArray;
-  Count: LongWord;
-begin
-  combo_extension.Items.Clear;
-  combo_extension.Items.Add('_All files_ ('{+IntToStr(dat_header.Files)} + ')');
-  exts := OniDataConnection.GetExtensionsList;
-  for i := 0 to High(RawListHandlers) do
-  begin
-    Count := Length(OniDataConnection.GetFilesList(RawListHandlers[i].Ext, '', True));
-    combo_extension.Items.Add(RawListHandlers[i].ext + ' (' + IntToStr(Count) + ')');
-  end;
-  //    FOR i:=0 TO High(exts) DO
-  //      combo_extension.Items.Add(exts[i]);
-  combo_extension.ItemIndex := 0;
-  combo_extensionClick(Self);
-end;
-
-
-
-
-procedure TForm_RawEdit.LoadFileNames;
-var
-  Extension: String;
-  no_zero_bytes: Boolean;
-  pattern: String;
-  files: TStringArray;
-  i: LongWord;
-begin
-  Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
-  pattern   := '';
-  if check_filtername.Checked then
-    pattern := edit_filtername.Text;
-  if Extension = '_All' then
-  begin
-    Extension := '';
-    for i := 0 to High(RawListHandlers) do
-    begin
-      if Length(Extension) > 0 then
-        Extension := Extension + ',';
-      Extension := Extension + RawListHandlers[i].Ext;
-    end;
-  end;
-
-  files := OniDataConnection.GetFilesList(extension, pattern, True);
-  list.Items.Clear;
-  if Length(files) > 0 then
-    for i := 0 to High(files) do
-      list.Items.Add(files[i]);
-  list_offset.Items.Clear;
-end;
-
-
-
-
-procedure TForm_RawEdit.panel_extensionResize(Sender: TObject);
-begin
-  combo_extension.Width := panel_extension.Width - 5;
-  edit_filtername.Width := panel_extension.Width - 5;
-end;
-
-
-
-
-procedure TForm_RawEdit.combo_extensionClick(Sender: TObject);
-begin
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_RawEdit.check_filternameClick(Sender: TObject);
-begin
-  edit_filtername.Enabled := not check_filtername.Checked;
-  LoadFileNames;
-end;
-
-
-
-
-procedure TForm_RawEdit.listClick(Sender: TObject);
-var
-  mem:  TMemoryStream;
-  Data: Tdata;
-  i:    LongWord;
-  offsets: TRawList;
-begin
-  if hex.Modified then
-  begin
-    if not Save then
-    begin
-      Exit;
-    end;
-  end;
-  ClearValues;
-  hex.DataSize := 0;
-  fileid := OniDataConnection.ExtractFileID(list.Items.Strings[list.ItemIndex]);
-  list_offset.Enabled := True;
-  if OniDataConnection.GetFileInfo(fileid).size > 0 then
-  begin
-    offsets := OniDataConnection.GetRawList(fileid);
-    list_offset.Items.Clear;
-    if Length(offsets) > 0 then
-    begin
-      for i := 0 to High(offsets) do
-      begin
-        list_offset.Items.Add('0x' + IntToHex(offsets[i].src_offset, 8) +
-          ', ' + IntToStr(offsets[i].raw_size) + ' bytes');
-      end;
-    end
-    else
-    begin
-      list_offset.Enabled := False;
-    end;
-  end
-  else
-  begin
-    list_offset.Enabled := False;
-  end;
-end;
-
-
-
-
-procedure TForm_RawEdit.listMouseDown(Sender: TObject; Button: TMouseButton;
-  Shift: TShiftState; X, Y: Integer);
-var
-  pt: TPoint;
-begin
-  pt.X := x;
-  pt.Y := y;
-  list.ItemIndex := list.ItemAtPos(pt, true);
-  if list.ItemIndex > -1 then
-    Self.listClick(Self);
-end;
+
 
 procedure TForm_RawEdit.list_offsetClick(Sender: TObject);
@@ -500,5 +364,22 @@
 
 procedure TForm_RawEdit.FormCreate(Sender: TObject);
-begin
+var
+  i:     LongWord;
+  exts: String;
+begin
+  inherited;
+  Self.OnNewFileSelected := Self.NewFile;
+
+  exts := '';
+  if Length(RawListHandlers) > 0 then
+  begin
+    for i := 0 to High(RawListHandlers) do
+      if Length(exts) > 0 then
+        exts := exts + ',' + RawListHandlers[i].Ext
+      else
+        exts := RawListHandlers[i].Ext;
+  end;
+  Self.AllowedExts := exts;
+
   Self.Caption := '';
   fileid     := 0;
@@ -516,6 +397,4 @@
   value_viewer.Cells[0, 7] := 'Selected length';
   value_viewer.ColWidths[0] := 100;
-  hex.Height := panel_data.Height - 190;
-  Self.panel_dataResize(Self);
   //
   value_viewer.Font.Charset := AppSettings.CharSet;
@@ -574,22 +453,5 @@
 
 
-procedure TForm_RawEdit.FormResize(Sender: TObject);
-begin
-  if Self.Width >= 650 then
-  begin
-  end
-  else
-    Self.Width := 650;
-  if Self.Height >= 450 then
-  begin
-  end
-  else
-    Self.Height := 450;
-end;
-
-
-
-
-procedure TForm_RawEdit.panel_dataResize(Sender: TObject);
+procedure TForm_RawEdit.panel_contentResize(Sender: TObject);
 begin
   value_viewer.ColWidths[1] := value_viewer.Width - value_viewer.ColWidths[0] - 28;
@@ -674,20 +536,4 @@
 
 
-procedure TForm_RawEdit.FormClose(Sender: TObject; var Action: TCloseAction);
-begin
-  Action := caFree;
-end;
-
-
-
-
-procedure TForm_RawEdit.panel_imexportResize(Sender: TObject);
-begin
-  btn_import.Width := panel_imexport.Width - 8;
-  btn_export.Width := panel_imexport.Width - 8;
-end;
-
-
-
 
 procedure TForm_RawEdit.btn_exportClick(Sender: TObject);
@@ -966,3 +812,5 @@
 end;
 
+begin
+  AddToolListEntry('rawedit', 'Binary .raw-Editor', '');
 end.
Index: oup/current/Tool_Template.dfm
===================================================================
--- oup/current/Tool_Template.dfm	(revision 45)
+++ oup/current/Tool_Template.dfm	(revision 45)
@@ -0,0 +1,153 @@
+object Form_ToolTemplate: TForm_ToolTemplate
+  Left = 0
+  Top = 0
+  Caption = 'Template'
+  ClientHeight = 423
+  ClientWidth = 492
+  Color = clBtnFace
+  Constraints.MinHeight = 450
+  Constraints.MinWidth = 500
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Tahoma'
+  Font.Style = []
+  FormStyle = fsMDIChild
+  OldCreateOrder = False
+  Visible = True
+  WindowState = wsMaximized
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Splitter1: TSplitter
+    Left = 200
+    Top = 0
+    Width = 9
+    Height = 423
+    AutoSnap = False
+    Beveled = True
+    MinSize = 150
+    ExplicitHeight = 473
+  end
+  object panel_files: TPanel
+    Left = 0
+    Top = 0
+    Width = 200
+    Height = 423
+    Align = alLeft
+    BevelOuter = bvNone
+    TabOrder = 0
+    object filelist: TListBox
+      Left = 0
+      Top = 103
+      Width = 200
+      Height = 320
+      Align = alClient
+      ItemHeight = 13
+      PopupMenu = filepopup
+      TabOrder = 0
+      OnMouseDown = listMouseDown
+    end
+    object panel_extension: TPanel
+      Left = 0
+      Top = 0
+      Width = 200
+      Height = 103
+      Align = alTop
+      BevelOuter = bvNone
+      TabOrder = 1
+      DesignSize = (
+        200
+        103)
+      object label_ext: TLabel
+        Left = 2
+        Top = 62
+        Width = 100
+        Height = 17
+        AutoSize = False
+        Caption = 'Filter by &extension:'
+        FocusControl = combo_extension
+      end
+      object combo_extension: TComboBox
+        Left = 2
+        Top = 76
+        Width = 192
+        Height = 21
+        Style = csDropDownList
+        Anchors = [akLeft, akTop, akRight]
+        DropDownCount = 12
+        Font.Charset = DEFAULT_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -11
+        Font.Name = 'Tahoma'
+        Font.Style = []
+        ItemHeight = 13
+        ParentFont = False
+        Sorted = True
+        TabOrder = 3
+        OnClick = combo_extensionClick
+      end
+      object check_zerobyte: TCheckBox
+        Left = 2
+        Top = 44
+        Width = 130
+        Height = 13
+        Caption = 'Show &zero-byte files'
+        TabOrder = 2
+        OnClick = check_zerobyteClick
+      end
+      object edit_filtername: TEdit
+        Left = 2
+        Top = 20
+        Width = 192
+        Height = 18
+        Anchors = [akLeft, akTop, akRight]
+        AutoSize = False
+        TabOrder = 1
+      end
+      object check_filtername: TCheckBox
+        Left = 2
+        Top = 5
+        Width = 130
+        Height = 15
+        Caption = 'Filter by file&name:'
+        TabOrder = 0
+        OnClick = check_filternameClick
+      end
+    end
+  end
+  object content: TPanel
+    Left = 209
+    Top = 0
+    Width = 283
+    Height = 423
+    Align = alClient
+    BevelOuter = bvNone
+    TabOrder = 1
+  end
+  object filepopup: TPopupMenu
+    OnPopup = filepopupPopup
+    Left = 72
+    Top = 216
+    object popup_separator: TMenuItem
+      Caption = '-'
+    end
+    object popup_import: TMenuItem
+      Caption = 'Import binary .dat-file'
+      OnClick = popup_importClick
+    end
+    object popup_export: TMenuItem
+      Caption = 'Export binary .dat-file'
+      OnClick = popup_exportClick
+    end
+  end
+  object importd: TOpenDialog
+    Options = [ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofEnableSizing]
+    Left = 136
+    Top = 232
+  end
+  object exportd: TSaveDialog
+    Options = [ofHideReadOnly, ofExtensionDifferent, ofPathMustExist, ofEnableSizing]
+    Left = 144
+    Top = 256
+  end
+end
Index: oup/current/Tool_Template.pas
===================================================================
--- oup/current/Tool_Template.pas	(revision 45)
+++ oup/current/Tool_Template.pas	(revision 45)
@@ -0,0 +1,368 @@
+unit Tool_Template;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, ExtCtrls, StdCtrls, StrUtils,
+  Code_OniDataClass, Code_Functions, Data, Menus;
+
+type
+  TNewFileSelectedEvent = procedure(fileinfo: TFileInfo) of object;
+
+  TForm_ToolTemplate = class(TForm)
+    panel_files: TPanel;
+    filelist: TListBox;
+    panel_extension: TPanel;
+    label_ext: TLabel;
+    combo_extension: TComboBox;
+    check_zerobyte: TCheckBox;
+    edit_filtername: TEdit;
+    check_filtername: TCheckBox;
+    Splitter1: TSplitter;
+    content: TPanel;
+    filepopup: TPopupMenu;
+    popup_import: TMenuItem;
+    popup_export: TMenuItem;
+    popup_separator: TMenuItem;
+    importd: TOpenDialog;
+    exportd: TSaveDialog;
+    procedure RecreateList;
+    procedure LoadFileNames;
+    procedure SelectFileName(filename: String);
+    procedure SelectFileID(id: Integer);
+    procedure check_filternameClick(Sender: TObject);
+    procedure check_zerobyteClick(Sender: TObject);
+    procedure combo_extensionClick(Sender: TObject);
+    procedure listClick(Sender: TObject);
+    procedure listMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+
+    procedure FormResize(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure popup_importClick(Sender: TObject);
+    procedure popup_exportClick(Sender: TObject);
+    procedure popup_opentool(Sender: TObject);
+    procedure filepopupPopup(Sender: TObject);
+  private
+    FOnNewFileSelected: TNewFileSelectedEvent;
+    FAllowedExts: String;
+    FAllowMultiSelect: Boolean;
+    procedure SetAllowedExts(exts: String);
+    procedure SetMultiSelect(allow: Boolean);
+  public
+    constructor Create(AOwner: TComponent); override;
+  published
+    property OnNewFileSelected: TNewFileSelectedEvent read FOnNewFileSelected write FOnNewFileSelected;
+    property AllowedExts: String read FAllowedExts write SetAllowedExts;
+    property AllowMultiSelect: Boolean read FAllowMultiSelect write SetMultiSelect;
+  end;
+
+var
+  ToolList: TToolList;
+procedure AddToolListEntry(context, name, exts: String);
+
+implementation
+{$R *.dfm}
+uses Main, Code_Exporters;
+
+
+procedure TForm_ToolTemplate.RecreateList;
+var
+  i:    LongWord;
+  exts: TStringArray;
+begin
+  combo_extension.Items.Clear;
+  combo_extension.Items.Add('_All files_ (' +
+    IntToStr(OniDataConnection.GetFilesCount) + ')');
+  exts := OniDataConnection.GetExtensionsList;
+  for i := 0 to High(exts) do
+    if Length(FAllowedExts) > 0 then
+    begin
+      if Pos(MidStr(exts[i],1,4), FAllowedExts) > 0 then
+      begin
+        combo_extension.Items.Add(exts[i]);
+      end;
+    end else
+      combo_extension.Items.Add(exts[i]);
+  combo_extension.ItemIndex := 0;
+  combo_extensionClick(Self);
+end;
+
+
+
+
+procedure TForm_ToolTemplate.LoadFileNames;
+var
+  Extension: String;
+  no_zero_bytes: Boolean;
+  pattern: String;
+  files: TStringArray;
+  i: LongWord;
+begin
+  Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
+  no_zero_bytes := not check_zerobyte.Checked;
+  pattern := '';
+  if check_filtername.Checked then
+    pattern := edit_filtername.Text;
+  if Extension = '_All' then
+    if Length(FAllowedExts) > 0 then
+      Extension := FAllowedExts
+    else
+      Extension := '';
+
+  files := OniDataConnection.GetFilesList(extension, pattern, no_zero_bytes);
+
+  filelist.Visible := False;
+  filelist.Items.Clear;
+  if Length(files) > 0 then
+    for i := 0 to High(files) do
+      filelist.Items.Add(files[i]);
+  filelist.Visible := True;
+end;
+
+
+procedure TForm_ToolTemplate.popup_exportClick(Sender: TObject);
+var
+  id: Integer;
+  ext: String;
+begin
+  id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);
+  ext := RightStr(filelist.Items.Strings[filelist.ItemIndex], 4);
+  exportd.Filter := 'Files of matching extension (*.' + ext + ')|*.' + ext + '|All files|*.*';
+  exportd.DefaultExt := ext;
+  if exportd.Execute then
+    ExportDatFile(id, exportd.FileName);
+end;
+
+procedure TForm_ToolTemplate.popup_importClick(Sender: TObject);
+var
+  id: Integer;
+  finfo: TFileInfo;
+  fs: TFileStream;
+  data: TData;
+begin
+  id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);
+  finfo := OniDataConnection.GetFileInfo(id);
+
+  importd.Filter := 'Files of matching extension (*.' + finfo.Extension + ')|*.' +
+        finfo.Extension + '|All files|*.*';
+  if importd.Execute then
+  begin
+    fs := TFileStream.Create(importd.FileName, fmOpenRead);
+    if fs.Size <> finfo.Size then
+      ShowMessage('Can''t import ' + ExtractFilename(importd.FileName) +
+        ', file has to have same size as file in .dat.' + CrLf +
+        'Size of file in .dat: ' + FormatFileSize(finfo.Size) + CrLf +
+        'Size of chosen file: ' + FormatFileSize(fs.Size))
+    else begin
+      SetLength(data, fs.Size);
+      fs.Read(data[0], fs.Size);
+      OniDataConnection.UpdateDatFile(id, data);
+      Self.listClick(Self);
+    end;
+    fs.Free;
+  end;
+end;
+
+procedure TForm_ToolTemplate.popup_opentool(Sender: TObject);
+var
+  sender_name, context: String;
+  id: Integer;
+begin
+  sender_name := TComponent(Sender).Name;
+  id := OniDataConnection.ExtractFileID(filelist.Items.Strings[filelist.ItemIndex]);
+  context := MidStr(sender_name, Pos('_', sender_name) + 1, Length(sender_name) - Pos('_', sender_name));
+  Form_Main.open_child(context, id);
+end;
+
+procedure TForm_ToolTemplate.combo_extensionClick(Sender: TObject);
+begin
+  LoadFileNames;
+end;
+
+
+constructor TForm_ToolTemplate.Create(AOwner: TComponent);
+var
+  i: Integer;
+  item: TMenuItem;
+begin
+  inherited;
+  RecreateList;
+  if Length(ToolList) > 0 then
+  begin
+    for i := 0 to High(ToolList) do
+    begin
+      item := TMenuItem.Create(filepopup);
+      item.Name := 'popup_' + ToolList[i].context;
+      item.Caption := 'Open with ' + ToolList[i].name;
+      item.OnClick := Self.popup_opentool;
+      filepopup.Items.Insert(i, item);
+    end;
+  end;
+end;
+
+procedure TForm_ToolTemplate.filepopupPopup(Sender: TObject);
+var
+  ext: String;
+  i: Integer;
+begin
+  ext := RightStr(filelist.Items.Strings[filelist.ItemIndex], 4);
+  for i := 0 to High(ToolList) do
+  begin
+    filepopup.Items.Items[i].Enabled := True;
+    if Length(ToolList[i].exts) > 0 then
+      if Pos(ext, ToolList[i].exts) = 0 then
+        filepopup.Items.Items[i].Enabled := False;
+  end;
+end;
+
+procedure TForm_ToolTemplate.check_zerobyteClick(Sender: TObject);
+begin
+  LoadFileNames;
+end;
+
+procedure TForm_ToolTemplate.check_filternameClick(Sender: TObject);
+begin
+  edit_filtername.Enabled := not check_filtername.Checked;
+  LoadFileNames;
+end;
+
+procedure TForm_ToolTemplate.listClick(Sender: TObject);
+var
+  fileid: Integer;
+begin
+  if filelist.ItemIndex > -1 then
+  begin
+    fileid := OniDataConnection.ExtractFileID(
+          filelist.Items.Strings[filelist.ItemIndex]);
+    if Assigned(FOnNewFileSelected) then
+      FOnNewFileSelected(OniDataConnection.GetFileInfo(fileid));
+  end;
+end;
+
+procedure TForm_ToolTemplate.listMouseDown(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: Integer);
+var
+  pt: TPoint;
+begin
+  pt.X := x;
+  pt.Y := y;
+  filelist.ItemIndex := filelist.ItemAtPos(pt, true);
+  Self.listClick(Self);
+end;
+
+
+
+procedure TForm_ToolTemplate.SelectFileID(id: Integer);
+var
+  i: Integer;
+begin
+  filelist.ItemIndex := -1;
+  if filelist.Items.Count > 0 then
+    for i := 0 to filelist.Items.Count - 1 do
+      if OniDataConnection.ExtractFileID(filelist.Items.Strings[i]) = id then
+      begin
+        filelist.ItemIndex := i;
+        Break;
+      end;
+  Self.listClick(Self);
+end;
+
+procedure TForm_ToolTemplate.SelectFileName(filename: String);
+var
+  i: Integer;
+begin
+  filelist.ItemIndex := -1;
+  if filelist.Items.Count > 0 then
+    for i := 0 to filelist.Items.Count - 1 do
+      if filelist.Items.Strings[i] = filename then
+        filelist.ItemIndex := i;
+  Self.listClick(Self);
+end;
+
+procedure TForm_ToolTemplate.SetAllowedExts(exts: String);
+begin
+  FAllowedExts := exts;
+  RecreateList;
+end;
+
+procedure TForm_ToolTemplate.SetMultiSelect(allow: Boolean);
+begin
+  FAllowMultiSelect := allow;
+  filelist.MultiSelect := allow;
+end;
+
+
+procedure TForm_ToolTemplate.FormResize(Sender: TObject);
+begin
+  if Self.Width < 300 then
+    Self.Width := 300;
+  if Self.Height < 200 then
+    Self.Height := 200;
+end;
+
+
+
+procedure TForm_ToolTemplate.FormCreate(Sender: TObject);
+begin
+  Self.Width  := 260;
+  Self.Height := 300;
+  FOnNewFileSelected := nil;
+  FAllowedExts := '';
+  FAllowMultiSelect := False;
+end;
+
+procedure TForm_ToolTemplate.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+  Action := caFree;
+end;
+
+
+procedure AddToolListEntryExt(context, ext: String);
+var
+  i: Integer;
+begin
+  for i := 0 to High(ToolList) do
+    if ToolList[i].context = context then
+    begin
+      if Pos(ext, ToolList[i].exts) = 0 then
+      begin
+        if Length(ToolList[i].exts) = 0 then
+          ToolList[i].exts := ext
+        else
+          ToolList[i].exts := ToolList[i].exts + ',' + ext;
+      end;
+      Exit;
+    end;
+end;
+
+procedure AddToolListEntry(context, name, exts: String);
+var
+  i: Integer;
+begin
+  if Length(ToolList) > 0 then
+  begin
+    for i := 0 to High(ToolList) do
+      if ToolList[i].context = context then
+      begin
+        if (Length(ToolList[i].name) = 0) and (Length(name) > 0) then
+          ToolList[i].name := name;
+        if Length(exts) > 0 then
+          AddToolListEntryExt(context, exts);
+        Exit;
+      end;
+  end;
+  SetLength(ToolList, Length(ToolList) + 1);
+  for i := High(ToolList) downto 1 do
+    if ToolList[i - 1].name > name then
+      ToolList[i] := ToolList[i - 1]
+    else
+      Break;
+  ToolList[i].context := context;
+  ToolList[i].name := name;
+  ToolList[i].exts := exts;
+end;
+
+end.
Index: oup/current/Tool_TxmpReplace.dfm
===================================================================
--- oup/current/Tool_TxmpReplace.dfm	(revision 44)
+++ oup/current/Tool_TxmpReplace.dfm	(revision 45)
@@ -1,120 +1,91 @@
-object Form_TxmpReplace: TForm_TxmpReplace
-  Left = 0
-  Top = 0
-  BorderStyle = bsSingle
-  Caption = 'TXMP Replacer'
-  ClientHeight = 428
-  ClientWidth = 394
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  FormStyle = fsMDIChild
-  OldCreateOrder = False
-  Visible = True
-  WindowState = wsMaximized
+inherited Form_TxmpReplace: TForm_TxmpReplace
+  Caption = 'TxmpReplace'
   OnClose = FormClose
   OnCreate = FormCreate
+  ExplicitWidth = 320
+  ExplicitHeight = 240
   PixelsPerInch = 96
   TextHeight = 13
-  object panel_12: TPanel
-    Left = 0
-    Top = 0
-    Width = 394
-    Height = 349
-    Align = alClient
-    BevelOuter = bvNone
-    TabOrder = 0
-    object Splitter1: TSplitter
-      Left = 280
-      Top = 0
-      Width = 8
-      Height = 349
+  inherited Splitter1: TSplitter
+    Height = 344
+    ExplicitHeight = 344
+  end
+  inherited panel_files: TPanel
+    Height = 344
+    ExplicitHeight = 344
+    object image_txmppreview: TImage [0]
+      Left = 0
+      Top = 257
+      Width = 200
+      Height = 57
+      Align = alClient
+      ExplicitTop = 111
+      ExplicitHeight = 211
+    end
+    object splitter_txmp: TSplitter [1]
+      Left = 0
+      Top = 249
+      Width = 200
+      Height = 8
+      Cursor = crVSplit
+      Align = alTop
       AutoSnap = False
       Beveled = True
-      MinSize = 150
-      ExplicitLeft = 200
+      MinSize = 60
+      ExplicitLeft = -6
+      ExplicitTop = 314
     end
-    object group_txmpselect: TGroupBox
+    inherited filelist: TListBox
+      Height = 146
+      Align = alTop
+      ExplicitHeight = 146
+    end
+    inherited panel_extension: TPanel
+      Visible = False
+    end
+    object panel_txmppreview: TPanel
+      Left = 0
+      Top = 314
+      Width = 200
+      Height = 30
+      Align = alBottom
+      BevelOuter = bvNone
+      TabOrder = 2
+      object btn_save: TButton
+        Left = 2
+        Top = 2
+        Width = 111
+        Height = 25
+        Caption = 'Save TXMP-Picture'
+        TabOrder = 0
+        OnClick = btn_saveClick
+      end
+    end
+  end
+  inherited content: TPanel
+    Height = 344
+    ExplicitHeight = 344
+    object group_bmpselect: TGroupBox
       Left = 0
       Top = 0
-      Width = 280
-      Height = 349
-      Align = alLeft
-      Caption = '1. Select TXMP to replace'
-      TabOrder = 0
-      object splitter_txmp: TSplitter
-        Left = 2
-        Top = 190
-        Width = 276
-        Height = 8
-        Cursor = crVSplit
-        Align = alTop
-        AutoSnap = False
-        Beveled = True
-        MinSize = 60
-        ExplicitWidth = 196
-      end
-      object image_txmppreview: TImage
-        Left = 2
-        Top = 198
-        Width = 276
-        Height = 119
-        Align = alClient
-        ExplicitWidth = 196
-      end
-      object list_txmp: TListBox
-        Left = 2
-        Top = 15
-        Width = 276
-        Height = 175
-        Align = alTop
-        ItemHeight = 13
-        TabOrder = 0
-        OnClick = list_txmpClick
-        OnMouseDown = list_txmpMouseDown
-      end
-      object panel_txmppreview: TPanel
-        Left = 2
-        Top = 317
-        Width = 276
-        Height = 30
-        Align = alBottom
-        BevelOuter = bvNone
-        TabOrder = 1
-        object btn_save: TButton
-          Left = 2
-          Top = 2
-          Width = 111
-          Height = 25
-          Caption = 'Save TXMP-Picture'
-          TabOrder = 0
-          OnClick = btn_saveClick
-        end
-      end
-    end
-    object group_bmpselect: TGroupBox
-      Left = 288
-      Top = 0
-      Width = 106
-      Height = 349
+      Width = 283
+      Height = 344
       Align = alClient
       Caption = '2. Open BMP to replace with'
       Enabled = False
-      TabOrder = 1
+      TabOrder = 0
       object image_bmppreview: TImage
         Left = 2
         Top = 45
-        Width = 102
-        Height = 302
+        Width = 279
+        Height = 297
         Align = alClient
         ExplicitWidth = 182
+        ExplicitHeight = 302
       end
       object panel_load: TPanel
         Left = 2
         Top = 15
-        Width = 102
+        Width = 279
         Height = 30
         Align = alTop
@@ -133,13 +104,13 @@
     end
   end
-  object group_options: TGroupBox
+  object group_options: TGroupBox [3]
     Left = 0
-    Top = 349
-    Width = 394
+    Top = 344
+    Width = 492
     Height = 79
     Align = alBottom
     Caption = '3. Options && Replace'
     Enabled = False
-    TabOrder = 1
+    TabOrder = 2
     object btn_replace: TButton
       Left = 4
@@ -168,5 +139,5 @@
     end
   end
-  object opend: TOpenDialog
+  object opend: TOpenDialog [4]
     Filter = '24bit Bitmap (*.bmp)|*.bmp'
     Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing]
@@ -174,5 +145,5 @@
     Top = 16
   end
-  object saved: TSaveDialog
+  object saved: TSaveDialog [5]
     DefaultExt = 'bmp'
     Filter = 'Windows Bitmap (*.bmp)|*.bmp'
Index: oup/current/Tool_TxmpReplace.pas
===================================================================
--- oup/current/Tool_TxmpReplace.pas	(revision 44)
+++ oup/current/Tool_TxmpReplace.pas	(revision 45)
@@ -1,22 +1,11 @@
 unit Tool_TxmpReplace;
-
 interface
-
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, ExtCtrls, StdCtrls, StrUtils, Code_Functions, Data, Code_OniImgClass;
+  Dialogs, Tool_Template, StdCtrls, ExtCtrls,
+  Code_Functions, Data, Code_OniImgClass, Menus;
 
 type
-  TForm_TxmpReplace = class(TForm)
-    panel_12: TPanel;
-    group_txmpselect: TGroupBox;
-    splitter_txmp: TSplitter;
-    list_txmp: TListBox;
-    Splitter1: TSplitter;
-    group_bmpselect: TGroupBox;
-    panel_load: TPanel;
-    btn_load: TButton;
-    image_bmppreview: TImage;
-    opend:    TOpenDialog;
+  TForm_TxmpReplace = class(TForm_ToolTemplate)
     group_options: TGroupBox;
     btn_replace: TButton;
@@ -26,17 +15,21 @@
     btn_save: TButton;
     image_txmppreview: TImage;
-    saved:    TSaveDialog;
+    splitter_txmp: TSplitter;
+    group_bmpselect: TGroupBox;
+    image_bmppreview: TImage;
+    panel_load: TPanel;
+    btn_load: TButton;
+    opend: TOpenDialog;
+    saved: TSaveDialog;
+    procedure SelectFile(fileinfo: TFileInfo);
     procedure FormCreate(Sender: TObject);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure btn_saveClick(Sender: TObject);
-    procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure btn_loadClick(Sender: TObject);
     procedure btn_replaceClick(Sender: TObject);
-    procedure btn_loadClick(Sender: TObject);
-    procedure list_txmpClick(Sender: TObject);
-    procedure Recreatelist;
-    procedure list_txmpMouseDown(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: Integer);
   private
     OniImage_Old: TOniImage;
     OniImage_New: TOniImage;
+    fileid: Integer;
   public
   end;
@@ -46,44 +39,23 @@
 
 implementation
-
+{$R *.dfm}
 uses Main, Code_OniDataClass;
 
-{$R *.dfm}
-
-
-
-procedure TForm_TxmpReplace.Recreatelist;
-var
-  files: TStringArray;
-  i:     LongWord;
-begin
-  list_txmp.Items.Clear;
-  files := OniDataConnection.GetFilesList('TXMP', '', True);
-  if Length(files) > 0 then
-    for i := 0 to High(files) do
-      list_txmp.Items.Add(files[i]);
-  group_bmpselect.Enabled := False;
-  check_transparency.Checked := False;
-  check_fading.Checked := False;
-end;
-
-
-
-
-procedure TForm_TxmpReplace.list_txmpClick(Sender: TObject);
-var
-  id:   LongWord;
+
+
+procedure TForm_TxmpReplace.SelectFile(fileinfo: TFileInfo);
+var
   Data: Tdata;
   mem:  TMemoryStream;
   fadingbyte, depthbyte, storebyte: Byte;
 begin
-  id := OniDataConnection.ExtractFileID(list_txmp.Items.Strings[list_txmp.ItemIndex]);
-  OniDataConnection.LoadDatFilePart(id, $88, SizeOf(fadingbyte), @fadingbyte);
-  OniDataConnection.LoadDatFilePart(id, $89, SizeOf(depthbyte), @depthbyte);
-  OniDataConnection.LoadDatFilePart(id, $90, SizeOf(storebyte), @storebyte);
+  fileid := fileinfo.ID;
+  OniDataConnection.LoadDatFilePart(fileid, $88, SizeOf(fadingbyte), @fadingbyte);
+  OniDataConnection.LoadDatFilePart(fileid, $89, SizeOf(depthbyte), @depthbyte);
+  OniDataConnection.LoadDatFilePart(fileid, $90, SizeOf(storebyte), @storebyte);
   check_fading.Checked := (fadingbyte and $01) > 0;
   check_transparency.Checked := (depthbyte and $04) > 0;
 
-  OniImage_Old.LoadFromTXMP(id);
+  OniImage_Old.LoadFromTXMP(fileid);
   Data := OniImage_Old.GetAsBMP;
   mem  := TMemoryStream.Create;
@@ -96,18 +68,4 @@
 end;
 
-
-
-
-procedure TForm_TxmpReplace.list_txmpMouseDown(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-var
-  pt: TPoint;
-begin
-  pt.X := x;
-  pt.Y := y;
-  list_txmp.ItemIndex := list_txmp.ItemAtPos(pt, true);
-  if list_txmp.ItemIndex > -1 then
-    Self.list_txmpClick(Self);
-end;
 
 procedure TForm_TxmpReplace.btn_loadClick(Sender: TObject);
@@ -134,6 +92,4 @@
 procedure TForm_TxmpReplace.btn_replaceClick(Sender: TObject);
 var
-  id: LongWord;
-
   oldsize, newsize: LongWord;
   old_rawaddr, new_rawaddr: LongWord;
@@ -143,12 +99,11 @@
   datbyte: Word;
 begin
-  if list_txmp.ItemIndex >= 0 then
+  if filelist.ItemIndex >= 0 then
   begin
-    id := OniDataConnection.ExtractFileID(list_txmp.Items.Strings[list_txmp.ItemIndex]);
-    OniDataConnection.LoadDatFilePart(id, $88, 1, @oldfading);
+    OniDataConnection.LoadDatFilePart(fileid, $88, 1, @oldfading);
     if OniDataConnection.OSisMac then
-      OniDataConnection.UpdateDatFilePart(id, $A0, 4, @old_rawaddr)
+      OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @old_rawaddr)
     else
-      OniDataConnection.LoadDatFilePart(id, $9C, 4, @old_rawaddr);
+      OniDataConnection.LoadDatFilePart(fileid, $9C, 4, @old_rawaddr);
 
     if (OniImage_Old.Width <> OniImage_New.Width) or
@@ -161,5 +116,5 @@
         IntToStr(OniImage_New.Width) + 'x' + IntToStr(OniImage_New.Height) + ')' + CrLf +
         'Replace anyways?'),
-        PChar(list_txmp.Items.Strings[list_txmp.ItemIndex]),
+        PChar(filelist.Items.Strings[filelist.ItemIndex]),
         MB_YESNO) = idNo then
         Exit;
@@ -190,5 +145,5 @@
     begin
       new_rawaddr := old_rawaddr;
-      OniDataConnection.UpdateRawFile(id, $9C, Length(tempd), tempd);
+      OniDataConnection.UpdateRawFile(fileid, $9C, Length(tempd), tempd);
     end;
 
@@ -196,17 +151,17 @@
     if check_fading.Checked then
       datbyte := datbyte or $01;
-    OniDataConnection.UpdateDatFilePart(id, $88, 1, @datbyte);
+    OniDataConnection.UpdateDatFilePart(fileid, $88, 1, @datbyte);
     datbyte := $10;
     if check_transparency.Checked then
       datbyte := datbyte or $04;
-    OniDataConnection.UpdateDatFilePart(id, $89, 1, @datbyte);
-    OniDataConnection.UpdateDatFilePart(id, $8C, 2, @OniImage_New.Width);
-    OniDataConnection.UpdateDatFilePart(id, $8E, 2, @OniImage_New.Height);
+    OniDataConnection.UpdateDatFilePart(fileid, $89, 1, @datbyte);
+    OniDataConnection.UpdateDatFilePart(fileid, $8C, 2, @OniImage_New.Width);
+    OniDataConnection.UpdateDatFilePart(fileid, $8E, 2, @OniImage_New.Height);
     datbyte := $08;
-    OniDataConnection.UpdateDatFilePart(id, $90, 1, @datbyte);
+    OniDataConnection.UpdateDatFilePart(fileid, $90, 1, @datbyte);
     if OniDataConnection.OSisMac then
-      OniDataConnection.UpdateDatFilePart(id, $A0, 4, @new_rawaddr)
+      OniDataConnection.UpdateDatFilePart(fileid, $A0, 4, @new_rawaddr)
     else
-      OniDataConnection.UpdateDatFilePart(id, $9C, 4, @new_rawaddr);
+      OniDataConnection.UpdateDatFilePart(fileid, $9C, 4, @new_rawaddr);
 
     ShowMessage('TXMP-image replaced');
@@ -221,5 +176,5 @@
   OniImage_Old.Free;
   OniImage_New.Free;
-  Action := caFree;
+  inherited;
 end;
 
@@ -229,6 +184,9 @@
 procedure TForm_TxmpReplace.FormCreate(Sender: TObject);
 begin
+  inherited;
   OniImage_Old := TOniImage.Create;
   OniImage_New := TOniImage.Create;
+  Self.AllowedExts := 'TXMP';
+  Self.OnNewFileSelected := SelectFile;
 end;
 
@@ -242,3 +200,5 @@
 end;
 
+begin
+  AddToolListEntry('txmpreplace', 'TXMP Replacer', 'TXMP');
 end.
Index: oup/current/todo.txt
===================================================================
--- oup/current/todo.txt	(revision 44)
+++ oup/current/todo.txt	(revision 45)
@@ -1,8 +1,2 @@
--Types+Idents nicht in DB sondern Hardcoded, mit IDs für StructViewer
--StructViewer: statt 12 für dat-links, neuer bereich für typed-dat-links
-
-
--DB mit MAC-Files (andre offsets in dat für raw-links ...)
--Faded repacking TXMP (???)
 -DatLinks patchen
 -Non32bit MipMapping (???)
@@ -22,7 +16,10 @@
 -Links: Wenn level0 dann OUP mit level0 laden?
 
+-History:Geyser:14.04.06 15:11:45, 16.04.06 15:21:29
 -Patching: History Geyser 2006-04-30 - 04:07:00
 
 -Exports: FileExists => Abfrage
+-Export etc: If dest-file exists zZt anhängen, stattdessen neuschreiben?!
+-Export: dat+raw eines Files in eine datei
 
 -TOniImage: Statt Floor (bei farben) Round
@@ -32,22 +29,11 @@
 -DatEdit: Komplette .dat im Hex + Treeview der verschiedenen Parts etc
 
--FileLists: Sort By ID, Name, Extension ...
-
--Class für TForm mit FileList etc? (Form1_CreateContext mit dieser baseclass?)
-
--FileNames: Form_***, Unit_***
-
 -Signed vs Unsigned
 
 -PNG statt/zusätzlich zu BMP
 
--Noob-protection in Settings (Hex-Editing deaktiviert)
 -AppSettings: Erst initialisieren mit defaults, dann .ini lesen
 
 -Exporters (-> TOniImage etc)
-
--Option: show files without first 8 bytes. special-struct-def-loading (substract 8 from every entry's offset)
-
--Open über ein Menüpunkt: Decide upon Extension
 
 -Wiki etc: Links für benutzte Componenten
@@ -55,6 +41,5 @@
 -ProgHelp
 -Localization (eg: http://dybdahl.dk/dxgettext/)
-
--Close File/DB: Menu geht nach rechts
+-About
 
 -StructViewer: Strings bis 0x00, BitSets besser darstellen? (SSG: 18.04.06/10:52:58),
@@ -70,9 +55,5 @@
 -Dateityp-Name anzeigen (SUBT -> Subtitles etc)
 
--DatOpen: Erst Childs schließen, dann OpenDialog, dnan alte .dat schließen?
-
 -IGSt: Bei DEAD: OUP hangs (ValueViewer:String?)
-
--History:Geyser:14.04.06 15:11:45, 16.04.06 15:21:29
 
 -Bug bei SetNewValue mit String
@@ -80,7 +61,4 @@
 -Preview PSpc (!!!)
 -Preview: Models? 3D-Data?
-
--Export etc: If dest-file exists zZt anhängen, stattdessen neuschreiben?!
--Export: dat+raw eines Files in eine datei
 
 -Get files die bestimmten content haben (string etc)
@@ -92,25 +70,17 @@
 
 -Exporter: Checkboxes für was man im einzelnen will (zb Checkbox "in eine Datei ja/nein")
-
--HELP
+-Extrahier-Ordner-Option (mit Platzhalter für .dat-Name)
+-Extractor: Wohin?
 
 -Hex: Paste
-
--Datei von einem Tool in andrem Tool öffnen
-
 
 -Persist.dat editor
 
 
+
 -SELECT [src_id],MIN(datfiles.[name]),SUM(rawmap.[size]) FROM rawmap INNER  JOIN datfiles ON datfiles.[id]=[src_id] GROUP BY [src_id] ORDER BY [src_id] ASC
 
--Extrahier-Ordner-Option (mit Platzhalter für .dat-Name)
-
--About
 
 -BinEdit: Zusatzfunktionen wie: Suche, 
--BinEdit: Bild/Menu/Button irgendwas zum speichern
-
--Extractor: Wohin?
 
 -FileCompare: Ergebnis=Tabelle, jede Zeile eine differenz-addresse, spalten = werte an addr. für compared files
@@ -122,6 +92,4 @@
 -Löschen einer Datei auf die gelinkt wird: Liste der Links und sicherheitsfrage
 
--Filebox-Context: Extract etc
-
 -STRG+C auf Dateilisten etc für kopieren des Namens
 
