Index: oup/current/Tools/MetaEditor.dfm
===================================================================
--- oup/current/Tools/MetaEditor.dfm	(revision 232)
+++ oup/current/Tools/MetaEditor.dfm	(revision 233)
@@ -12,5 +12,5 @@
     ExplicitTop = 25
     ExplicitWidth = 598
-    ExplicitHeight = 532
+    ExplicitHeight = 424
     object splitter: TSplitter
       Left = 190
@@ -48,6 +48,4 @@
       OnPaintText = VSTPaintText
       OnInitChildren = VSTInitChildren
-      ExplicitWidth = 502
-      ExplicitHeight = 532
       Columns = <
         item
@@ -80,11 +78,11 @@
         Caption = 'Meta Edit'
         ImageIndex = 1
-        ExplicitWidth = 192
-        ExplicitHeight = 504
+        ExplicitLeft = 0
+        ExplicitTop = 0
+        ExplicitWidth = 0
+        ExplicitHeight = 0
       end
       object tab_hex: TTabSheet
         Caption = 'Binary Edit'
-        ExplicitWidth = 192
-        ExplicitHeight = 504
         object splitter_hex_1: TSplitter
           Left = 0
@@ -102,5 +100,5 @@
         object splitter_hex_2: TSplitter
           Left = 0
-          Top = 250
+          Top = 256
           Width = 392
           Height = 8
@@ -115,14 +113,27 @@
         object panel_hex_actions: TPanel
           Left = 0
-          Top = 355
-          Width = 392
-          Height = 41
+          Top = 361
+          Width = 392
+          Height = 35
           Align = alBottom
           BevelOuter = bvNone
           Caption = 'panel_hex_actions'
           TabOrder = 0
-          ExplicitLeft = 3
-          ExplicitTop = 354
-          ExplicitWidth = 192
+          object btn_export: TButton
+            Left = 2
+            Top = 6
+            Width = 117
+            Height = 25
+            Caption = 'Export to file...'
+            TabOrder = 0
+          end
+          object btn_import: TButton
+            Left = 125
+            Top = 6
+            Width = 117
+            Height = 25
+            Caption = 'Import from file...'
+            TabOrder = 1
+          end
         end
         object hex: TMPHexEditor
@@ -151,5 +162,5 @@
           Colors.EvenColumn = clNavy
           Colors.CurrentOffsetBackground = clBtnShadow
-          Colors.OffsetBackground = clBtnFace
+          Colors.OffsetBackGround = clBtnFace
           Colors.CurrentOffset = clBtnHighlight
           Colors.Grid = clBtnFace
@@ -160,7 +171,6 @@
           AllowInsertMode = False
           DrawGridLines = False
-          Version = 'december 06, 2006; '#169' markus stephany, vcl[at]mirkes[dot]de'
+          Version = 'May 23, 2005; '#169' markus stephany, vcl[at]mirkes[dot]de'
           ShowPositionIfNotFocused = True
-          ExplicitWidth = 192
         end
         object value_viewer: TWrapGrid
@@ -168,5 +178,5 @@
           Top = 108
           Width = 392
-          Height = 142
+          Height = 148
           Align = alClient
           ColCount = 1
@@ -179,11 +189,8 @@
           ScrollBars = ssVertical
           TabOrder = 2
-          ExplicitTop = 363
-          ExplicitWidth = 192
-          ExplicitHeight = 0
         end
         object structviewer: TVirtualStringTree
           Left = 0
-          Top = 258
+          Top = 264
           Width = 392
           Height = 97
@@ -225,7 +232,4 @@
           OnFocusChanged = VSTFocusChanged
           OnGetText = VSTGetText
-          ExplicitLeft = -6
-          ExplicitTop = 161
-          ExplicitWidth = 192
           Columns = <
             item
@@ -280,3 +284,31 @@
     end
   end
+  object value_viewer_context: TPopupMenu
+    AutoHotkeys = maManual
+    AutoLineReduction = maManual
+    Left = 300
+    Top = 196
+    object value_viewer_context_copy: TMenuItem
+      Caption = 'Copy to &clipboard'
+    end
+    object value_viewer_context_copyasdec: TMenuItem
+      Caption = 'Copy to clipboard (as &dec)'
+    end
+    object value_viewer_context_copyasfloat: TMenuItem
+      Caption = 'Copy to clipboard (as &float)'
+    end
+    object value_viewer_context_copyasbitset: TMenuItem
+      Caption = 'Copy to clipboard (as &bitset)'
+    end
+    object value_viewer_context_copyasstring: TMenuItem
+      Caption = 'Copy to clipboard (as &string)'
+    end
+    object value_viewer_context_copyashex: TMenuItem
+      Caption = 'Copy to clipboard (as &hex)'
+    end
+  end
+  object VTHPopup: TVTHeaderPopupMenu
+    Left = 292
+    Top = 340
+  end
 end
Index: oup/current/Tools/MetaEditor.pas
===================================================================
--- oup/current/Tools/MetaEditor.pas	(revision 232)
+++ oup/current/Tools/MetaEditor.pas	(revision 233)
@@ -6,5 +6,5 @@
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, _BaseTemplate, ExtCtrls, VirtualTrees, StdCtrls, ComCtrls, Grids,
-  MPHexEditor, Wrapgrid;
+  MPHexEditor, Wrapgrid, VTHeaderPopup, Menus, _TreeElement;
 
 type
@@ -21,4 +21,14 @@
     splitter_hex_2: TSplitter;
     structviewer: TVirtualStringTree;
+    value_viewer_context: TPopupMenu;
+    value_viewer_context_copy: TMenuItem;
+    value_viewer_context_copyasdec: TMenuItem;
+    value_viewer_context_copyasfloat: TMenuItem;
+    value_viewer_context_copyasbitset: TMenuItem;
+    value_viewer_context_copyasstring: TMenuItem;
+    value_viewer_context_copyashex: TMenuItem;
+    VTHPopup: TVTHeaderPopupMenu;
+    btn_export: TButton;
+    btn_import: TButton;
     procedure FormCreate(Sender: TObject);
     procedure VSTInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode;
@@ -36,4 +46,5 @@
       TextType: TVSTTextType);
   private
+    root: TTreeElement;
     procedure NewCon(ID: Integer);
   public
@@ -49,5 +60,5 @@
 
   TNodeData = record
-    Field: TObject;
+    Field: TTreeElement;
   end;
 
@@ -70,5 +81,5 @@
   node: PVirtualNode;
   Meta: TMetaManager;
-  root: TExtensions;
+  root: TTreeElement;
 begin
   if ID >= 0 then
@@ -78,7 +89,7 @@
     VST.BeginUpdate;
     root := ConManager.Connection[FConnectionID].MetaData.Root;
-    for i := 0 to High(root) do
-    begin
-      data.Field := root[i];
+    for i := 0 to root.ChildCount - 1 do
+    begin
+      data.Field := root.Child[i];
       node := AddVSTEntry(VST, nil, data);
       VST.HasChildren[node] := True;
@@ -96,42 +107,19 @@
   newnode: PVirtualNode;
   i: Integer;
-  id: Integer;
   Meta: TMetaManager;
 begin
   data := Sender.GetNodeData(node);
   Meta := ConManager.Connection[ConnectionID].MetaData;
-  if data.Field is TFile then
-  begin
-    if TFile(data.Field).ChildCount > 0 then
-    begin
-      for i := 0 to TFile(data.Field).ChildCount - 1 do
-      begin
-        id := TFile(data.Field).LinkByIndex[i].DestID;
-        Meta.InitFile(id);
-        newdata.Field := Meta.FileById[id];
-        newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata);
-        if Meta.FileById[id].ChildCount > 0 then
-          Sender.HasChildren[newnode] := True;
-      end;
-    end;
-    if TFile(data.Field).RawCount > 0 then
-    begin
-      for i := 0 to TFile(data.Field).RawCount - 1 do
-      begin
-//        Exit;
-      end;
-    end;
-  end;
   if data.Field is TExtension then
-  begin
-    if TExtension(data.Field).FileCount = 0 then
+    if TExtension(data.Field).ChildCount = 0 then
       TExtension(data.Field).InitList;
-    for i := 0 to TExtension(data.Field).FileCount - 1 do
-    begin
-      id := TExtension(data.Field).Files[i];
-      Meta.InitFile(id);
-      newdata.Field := Meta.FileById[id];
+
+  if data.Field.ChildCount > 0 then
+  begin
+    for i := 0 to data.Field.ChildCount - 1 do
+    begin
+      newdata.Field := data.Field.Child[i];
       newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata);
-      if Meta.FileById[id].ChildCount > 0 then
+      if newdata.Field.ChildCount > 0 then
         Sender.HasChildren[newnode] := True;
     end;
@@ -205,12 +193,5 @@
       0:
         begin
-          if Data.Field is TFile then
-          begin
-            CellText := TFile(Data.Field).FileInfo.Name;
-            if CellText = '' then
-              CellText := 'Unnamed';
-          end;
-          if Data.Field is TExtension then
-            CellText := TExtension(Data.Field).Ext;
+          CellText := Data.Field.GetCaption;
         end;
       1:
Index: oup/current/Tools/_TemplateFileList.dfm
===================================================================
--- oup/current/Tools/_TemplateFileList.dfm	(revision 232)
+++ oup/current/Tools/_TemplateFileList.dfm	(revision 233)
@@ -269,4 +269,8 @@
           Caption = 'Tree'
           ImageIndex = 1
+          ExplicitLeft = 0
+          ExplicitTop = 0
+          ExplicitWidth = 0
+          ExplicitHeight = 0
           object filelist_meta: TVirtualStringTree
             Left = 0
Index: oup/current/Tools/_TemplateFileList.pas
===================================================================
--- oup/current/Tools/_TemplateFileList.pas	(revision 232)
+++ oup/current/Tools/_TemplateFileList.pas	(revision 233)
@@ -173,5 +173,5 @@
     filelist_meta.Clear;
     filelist_meta.BeginUpdate;
-    root := ConManager.Connection[FConnectionID].MetaData.Root;
+{    root := ConManager.Connection[FConnectionID].MetaData.Root;
     for i := 0 to High(root) do
     begin
@@ -181,5 +181,5 @@
     end;
     filelist_meta.EndUpdate;
-  end;
+}  end;
 end;
 
@@ -453,5 +453,5 @@
 begin
   inherited;
-  data := Sender.GetNodeData(Node);
+{  data := Sender.GetNodeData(Node);
   if data.Field is TExtension then
   begin
@@ -465,5 +465,5 @@
       CellText := TFile(data.Field).FileInfo.Extension + ': ' + TFile(data.Field).FileInfo.Name;
   end;
-end;
+}end;
 
 
@@ -481,5 +481,5 @@
   Self.Cursor := crHourGlass;
   Application.ProcessMessages;
-  if data.Field is TExtension then
+{  if data.Field is TExtension then
   begin
     if TExtension(data.Field).FileCount = 0 then
@@ -509,5 +509,5 @@
     ChildCount := filelist_meta.ChildCount[node];
   end;
-  Self.Cursor := crDefault;
+}  Self.Cursor := crDefault;
 end;
 
