| 4 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 5 | 
   | 
 uses | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 6 | 
   | 
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | 
 
 
 
 
 
 
 
 
 
 
 
 | 7 | 
 < | 
   Dialogs, _BaseTemplate, ExtCtrls, VirtualTrees, StdCtrls; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 | 
 > | 
   Dialogs, _BaseTemplate, ExtCtrls, VirtualTrees, StdCtrls, ComCtrls, Grids, | 
 
 
 
 
 
 | 8 | 
 > | 
   MPHexEditor, Wrapgrid, VTHeaderPopup, Menus, _TreeElement; | 
 
 
 
 
 
 
 
 
 
 
 
 | 9 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 | 
   | 
 type | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 | 
   | 
   TForm_Meta = class(TForm_BaseTemplate) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 12 | 
   | 
     VST: TVirtualStringTree; | 
 
 
 
 
 
 
 
 
 
 | 12 | 
 – | 
     Panel2: TPanel; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 13 | 
   | 
     splitter: TSplitter; | 
 
 
 
 
 
 
 
 
 | 14 | 
 + | 
     rightPages: TPageControl; | 
 
 
 
 
 
 
 
 
 | 15 | 
 + | 
     tab_hex: TTabSheet; | 
 
 
 
 
 
 
 
 
 | 16 | 
 + | 
     tab_meta: TTabSheet; | 
 
 
 
 
 
 
 
 
 | 17 | 
 + | 
     panel_hex_actions: TPanel; | 
 
 
 
 
 
 
 
 
 | 18 | 
 + | 
     hex: TMPHexEditor; | 
 
 
 
 
 
 
 
 
 | 19 | 
 + | 
     splitter_hex_1: TSplitter; | 
 
 
 
 
 
 
 
 
 | 20 | 
 + | 
     value_viewer: TWrapGrid; | 
 
 
 
 
 
 
 
 
 | 21 | 
 + | 
     splitter_hex_2: TSplitter; | 
 
 
 
 
 
 
 
 
 | 22 | 
 + | 
     structviewer: TVirtualStringTree; | 
 
 
 
 
 
 
 
 
 | 23 | 
 + | 
     value_viewer_context: TPopupMenu; | 
 
 
 
 
 
 
 
 
 | 24 | 
 + | 
     value_viewer_context_copy: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 25 | 
 + | 
     value_viewer_context_copyasdec: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 26 | 
 + | 
     value_viewer_context_copyasfloat: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 27 | 
 + | 
     value_viewer_context_copyasbitset: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 28 | 
 + | 
     value_viewer_context_copyasstring: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 29 | 
 + | 
     value_viewer_context_copyashex: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 30 | 
 + | 
     VTHPopup: TVTHeaderPopupMenu; | 
 
 
 
 
 
 
 
 
 | 31 | 
 + | 
     btn_export: TButton; | 
 
 
 
 
 
 
 
 
 | 32 | 
 + | 
     btn_import: TButton; | 
 
 
 
 
 
 
 
 
 | 33 | 
 + | 
     vst_popup: TPopupMenu; | 
 
 
 
 
 
 
 
 
 | 34 | 
 + | 
     vst_newRoot: TMenuItem; | 
 
 
 
 
 
 
 
 
 | 35 | 
 + | 
     vst_setRoot: TMenuItem; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 36 | 
   | 
     procedure FormCreate(Sender: TObject); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 | 
   | 
     procedure VSTInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
   | 
       var ChildCount: Cardinal); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 | 
   | 
     procedure VSTPaintText(Sender: TBaseVirtualTree; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 48 | 
   | 
       const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | 
   | 
       TextType: TVSTTextType); | 
 
 
 
 
 
 
 
 
 | 50 | 
 + | 
     procedure VSTGetPopupMenu(Sender: TBaseVirtualTree; Node: PVirtualNode; | 
 
 
 
 
 
 
 
 
 | 51 | 
 + | 
       Column: TColumnIndex; const P: TPoint; var AskParent: Boolean; | 
 
 
 
 
 
 
 
 
 | 52 | 
 + | 
       var PopupMenu: TPopupMenu); | 
 
 
 
 
 
 
 
 
 | 53 | 
 + | 
     procedure vst_setRootClick(Sender: TObject); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 | 
   | 
   private | 
 
 
 
 
 
 
 
 
 | 55 | 
 + | 
     root: TTreeElement; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 56 | 
   | 
     procedure NewCon(ID: Integer); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 | 
   | 
   public | 
 
 
 
 
 
 
 
 
 | 58 | 
 + | 
     procedure SetRoot(TreeElem: TTreeElement); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 59 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 60 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 33 | 
 – | 
 var | 
 
 
 
 
 
 
 
 
 
 | 34 | 
 – | 
   Form_Meta: TForm_Meta; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 | 
   | 
 {$R *.dfm} | 
 
 
 
 
 
 
 
 
 
 
 
 | 64 | 
 < | 
 uses _MetaManager, _FileTypes, Data; | 
 
 
 
 
 
 
 
 
 
 | 64 | 
 > | 
 uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes; | 
 
 
 
 
 
 
 
 
 
 
 
 | 65 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 | 
   | 
 type | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 67 | 
   | 
   PNodeData = ^TNodeData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 68 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 | 
   | 
   TNodeData = record | 
 
 
 
 
 
 
 
 
 
 
 
 | 70 | 
 < | 
     Field: TObject; | 
 
 
 
 
 
 
 
 
 
 | 70 | 
 > | 
     Field: TTreeElement; | 
 
 
 
 
 
 
 
 
 
 
 
 | 71 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
   | 
 function AddVSTEntry(AVST: TCustomVirtualStringTree; ANode: PVirtualNode; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 84 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | 
   | 
 procedure TForm_Meta.NewCon(ID: Integer); | 
 
 
 
 
 
 
 
 
 | 86 | 
 + | 
 begin | 
 
 
 
 
 
 
 
 
 | 87 | 
 + | 
   if ID >= 0 then | 
 
 
 
 
 
 
 
 
 | 88 | 
 + | 
     SetRoot(ConManager.Connection[FConnectionID].MetaData.Root); | 
 
 
 
 
 
 
 
 
 | 89 | 
 + | 
 end; | 
 
 
 
 
 
 
 
 
 | 90 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 91 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 92 | 
 + | 
 procedure TForm_Meta.SetRoot(TreeElem: TTreeElement); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 | 61 | 
 – | 
   a,b,c: Int64; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
   | 
   i: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 95 | 
   | 
   data: TNodeData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 96 | 
   | 
   node: PVirtualNode; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 97 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 98 | 
 < | 
   if ID >= 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 98 | 
 > | 
   if FConnectionID <> TreeElem.ConnectionID then | 
 
 
 
 
 
 | 99 | 
 > | 
     SelectConnection(TreeElem.ConnectionID); | 
 
 
 
 
 
 | 100 | 
 > | 
   root := TreeElem; | 
 
 
 
 
 
 | 101 | 
 > | 
   VST.Clear; | 
 
 
 
 
 
 | 102 | 
 > | 
   VST.BeginUpdate; | 
 
 
 
 
 
 | 103 | 
 > | 
   for i := 0 to root.ChildCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 | 104 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 105 | 
 < | 
     QueryPerformanceFrequency(c); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 106 | 
 < | 
     QueryPerformanceCounter(a); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 107 | 
 < | 
     if not Assigned(Meta) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 108 | 
 < | 
       Meta := TMetaManager.Create(ID); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 | 
 < | 
     QueryPerformanceCounter(b); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
 < | 
     ShowMessage('Loading Done - ' + FloatToStr((b-a)/c) + 's'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 | 
 < | 
     VST.Clear; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 76 | 
 < | 
     VST.BeginUpdate; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | 
 < | 
     for i := 0 to Meta.FileCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | 
 < | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 | 
 < | 
       if Assigned(Meta.FileById[i]) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 80 | 
 < | 
       begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 81 | 
 < | 
         data.Field := Meta.FileById[i]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 82 | 
 < | 
         node := AddVSTEntry(VST, nil, data); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 | 
 < | 
         if Meta.FileById[i].ChildCount > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 84 | 
 < | 
           VST.HasChildren[node] := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | 
 < | 
       end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 86 | 
 < | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 87 | 
 < | 
     VST.EndUpdate; | 
 
 
 
 
 
 
 
 
 
 | 105 | 
 > | 
     data.Field := root.Child[i]; | 
 
 
 
 
 
 | 106 | 
 > | 
     node := AddVSTEntry(VST, nil, data); | 
 
 
 
 
 
 | 107 | 
 > | 
     if data.Field.ChildCount > 0 then | 
 
 
 
 
 
 | 108 | 
 > | 
       VST.HasChildren[node] := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 109 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 | 110 | 
 + | 
   VST.EndUpdate; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 111 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 112 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 91 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
   | 
 procedure TForm_Meta.VSTInitChildren(Sender: TBaseVirtualTree; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 114 | 
   | 
   Node: PVirtualNode; var ChildCount: Cardinal); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 115 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 117 | 
   | 
   newdata: TNodeData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 118 | 
   | 
   newnode: PVirtualNode; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
   | 
   i: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 | 120 | 
 < | 
   id: Integer; | 
 
 
 
 
 
 
 
 
 
 | 120 | 
 > | 
   Meta: TMetaManager; | 
 
 
 
 
 
 
 
 
 
 
 
 | 121 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 < | 
   data := VST.GetNodeData(node); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 123 | 
 < | 
   for i := 0 to Meta.FileById[TFile(data.Field).FileID].ChildCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 > | 
   data := Sender.GetNodeData(node); | 
 
 
 
 
 
 | 123 | 
 > | 
   Meta := ConManager.Connection[ConnectionID].MetaData; | 
 
 
 
 
 
 | 124 | 
 > | 
  | 
 
 
 
 
 
 | 125 | 
 > | 
   if data.Field.ChildCount > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 126 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
 < | 
     id := Meta.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
 < | 
     Meta.InitFile(id); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 | 
 < | 
     newdata.Field := Meta.FileById[id]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 | 
 < | 
     newnode := AddVSTEntry(VST, Node, newdata); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 | 
 < | 
     if Meta.FileById[id].ChildCount > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 | 
 < | 
       VST.HasChildren[newnode] := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
 > | 
     for i := 0 to data.Field.ChildCount - 1 do | 
 
 
 
 
 
 | 128 | 
 > | 
     begin | 
 
 
 
 
 
 | 129 | 
 > | 
       newdata.Field := data.Field.Child[i]; | 
 
 
 
 
 
 | 130 | 
 > | 
       newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata); | 
 
 
 
 
 
 | 131 | 
 > | 
       if newdata.Field.ChildCount > 0 then | 
 
 
 
 
 
 | 132 | 
 > | 
         Sender.HasChildren[newnode] := True; | 
 
 
 
 
 
 | 133 | 
 > | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 134 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 135 | 
 < | 
   ChildCount := Meta.FileById[TFile(data.Field).FileID].ChildCount; | 
 
 
 
 
 
 
 
 
 
 | 135 | 
 > | 
   ChildCount := Sender.ChildCount[Node]; | 
 
 
 
 
 
 
 
 
 
 
 
 | 136 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 138 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 147 | 
   | 
     TFile(data.Field).InitEditor; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 148 | 
   | 
     if Assigned(TFile(data.Field).Editor) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 149 | 
   | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 150 | 
 < | 
       panel2.InsertControl(TFile(data.Field).Editor); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 150 | 
 > | 
       TFile(data.Field).Editor.Align := alClient; | 
 
 
 
 
 
 | 151 | 
 > | 
       tab_meta.InsertControl(TFile(data.Field).Editor); | 
 
 
 
 
 
 
 
 
 
 
 
 | 152 | 
   | 
       TFile(data.Field).Opened := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 153 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 154 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 178 | 
   | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 179 | 
   | 
       if TFile(data.Field).Opened then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 180 | 
   | 
       begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 181 | 
 < | 
         if panel2.ControlCount > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 182 | 
 < | 
           for i := 0 to panel2.ControlCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 183 | 
 < | 
             panel2.RemoveControl(panel2.Controls[i]); | 
 
 
 
 
 
 
 
 
 
 | 181 | 
 > | 
         if tab_meta.ControlCount > 0 then | 
 
 
 
 
 
 | 182 | 
 > | 
           for i := 0 to tab_meta.ControlCount - 1 do | 
 
 
 
 
 
 | 183 | 
 > | 
             tab_meta.RemoveControl(tab_meta.Controls[i]); | 
 
 
 
 
 
 
 
 
 
 
 
 | 184 | 
   | 
         TFile(data.Field).Opened := False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 185 | 
   | 
       end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 186 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 200 | 
   | 
     case Column of | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 | 
   | 
       0: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 202 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 203 | 
 < | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 179 | 
 < | 
           begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 180 | 
 < | 
             CellText := TFile(Data.Field).FileName; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 181 | 
 < | 
             if CellText = '' then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 182 | 
 < | 
               CellText := 'Unnamed'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 183 | 
 < | 
           end; | 
 
 
 
 
 
 
 
 
 
 | 203 | 
 > | 
           CellText := Data.Field.GetCaption; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 204 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 205 | 
   | 
       1: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 206 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 | 208 | 
 < | 
             CellText := TFile(Data.Field).FileExt; | 
 
 
 
 
 
 
 
 
 
 | 208 | 
 > | 
             CellText := TFile(Data.Field).FileInfo.Extension; | 
 
 
 
 
 
 
 
 
 
 
 
 | 209 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 210 | 
   | 
       2: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 211 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 212 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 | 213 | 
 < | 
             CellText := IntToStr(TFile(Data.Field).FileID); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 213 | 
 > | 
             CellText := IntToStr(TFile(Data.Field).FileInfo.ID); | 
 
 
 
 
 
 | 214 | 
 > | 
         end; | 
 
 
 
 
 
 | 215 | 
 > | 
       3: | 
 
 
 
 
 
 | 216 | 
 > | 
         begin | 
 
 
 
 
 
 | 217 | 
 > | 
           if Data.Field is TDataField then | 
 
 
 
 
 
 | 218 | 
 > | 
             CellText := TDataField(Data.Field).ValueAsString; | 
 
 
 
 
 
 
 
 
 
 
 
 | 219 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 220 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 221 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 236 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 237 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 238 | 
   | 
           begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 239 | 
 < | 
             if Length(TFile(Data.Field).FileName) = 0 then | 
 
 
 
 
 
 
 
 
 
 | 239 | 
 > | 
             if Length(TFile(Data.Field).FileInfo.Name) = 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 240 | 
   | 
               TargetCanvas.Font.Color := $C06060; | 
 
 
 
 
 
 
 
 
 
 
 
 | 241 | 
 < | 
             if TFile(Data.Field).FileSize = 0 then | 
 
 
 
 
 
 
 
 
 
 | 241 | 
 > | 
             if TFile(Data.Field).FileInfo.Size = 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 242 | 
   | 
               TargetCanvas.Font.Color := $2020A0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 243 | 
   | 
           end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 244 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 248 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 249 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 250 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 251 | 
 + | 
 procedure TForm_Meta.VSTGetPopupMenu(Sender: TBaseVirtualTree; | 
 
 
 
 
 
 
 
 
 | 252 | 
 + | 
   Node: PVirtualNode; Column: TColumnIndex; const P: TPoint; | 
 
 
 
 
 
 
 
 
 | 253 | 
 + | 
   var AskParent: Boolean; var PopupMenu: TPopupMenu); | 
 
 
 
 
 
 
 
 
 | 254 | 
 + | 
 var | 
 
 
 
 
 
 
 
 
 | 255 | 
 + | 
   data: PNodeData; | 
 
 
 
 
 
 
 
 
 | 256 | 
 + | 
 begin | 
 
 
 
 
 
 
 
 
 | 257 | 
 + | 
   inherited; | 
 
 
 
 
 
 
 
 
 | 258 | 
 + | 
   AskParent := False; | 
 
 
 
 
 
 
 
 
 | 259 | 
 + | 
   if Assigned(Node) then | 
 
 
 
 
 
 
 
 
 | 260 | 
 + | 
   begin | 
 
 
 
 
 
 
 
 
 | 261 | 
 + | 
     Sender.Selected[Node] := True; | 
 
 
 
 
 
 
 
 
 | 262 | 
 + | 
     Sender.FocusedNode := Node; | 
 
 
 
 
 
 
 
 
 | 263 | 
 + | 
     data := Sender.GetNodeData(Node); | 
 
 
 
 
 
 
 
 
 | 264 | 
 + | 
     if Column = 0 then | 
 
 
 
 
 
 
 
 
 | 265 | 
 + | 
     begin | 
 
 
 
 
 
 
 
 
 | 266 | 
 + | 
       if TTreeElement(data.Field).GetChildCount > 0 then | 
 
 
 
 
 
 
 
 
 | 267 | 
 + | 
         PopupMenu := vst_popup | 
 
 
 
 
 
 
 
 
 | 268 | 
 + | 
       else | 
 
 
 
 
 
 
 
 
 | 269 | 
 + | 
         PopupMenu := nil; | 
 
 
 
 
 
 
 
 
 | 270 | 
 + | 
     end; | 
 
 
 
 
 
 
 
 
 | 271 | 
 + | 
   end; | 
 
 
 
 
 
 
 
 
 | 272 | 
 + | 
 end; | 
 
 
 
 
 
 
 
 
 | 273 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 274 | 
 + | 
 procedure TForm_Meta.vst_setRootClick(Sender: TObject); | 
 
 
 
 
 
 
 
 
 | 275 | 
 + | 
 var | 
 
 
 
 
 
 
 
 
 | 276 | 
 + | 
   data: PNodeData; | 
 
 
 
 
 
 
 
 
 | 277 | 
 + | 
 begin | 
 
 
 
 
 
 
 
 
 | 278 | 
 + | 
   inherited; | 
 
 
 
 
 
 
 
 
 | 279 | 
 + | 
   data := VST.GetNodeData(VST.FocusedNode); | 
 
 
 
 
 
 
 
 
 | 280 | 
 + | 
   SetRoot(data.Field); | 
 
 
 
 
 
 
 
 
 | 281 | 
 + | 
 end; | 
 
 
 
 
 
 
 
 
 | 282 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 283 | 
   | 
 procedure TForm_Meta.FormClose(Sender: TObject; var Action: TCloseAction); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 284 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 285 | 
 < | 
   Meta.Free; | 
 
 
 
 
 
 
 
 
 
 | 285 | 
 > | 
 //  Meta.Free; | 
 
 
 
 
 
 
 
 
 
 
 
 | 286 | 
   | 
   inherited; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 287 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 288 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 290 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 291 | 
   | 
   inherited; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 292 | 
   | 
   OnNewConnection := NewCon; | 
 
 
 
 
 
 
 
 
 
 | 236 | 
 – | 
   FConnectionID := -1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 293 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 294 | 
   | 
   VST.NodeDataSize := SizeOf(TNodeData); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 295 | 
   | 
   VST.Font.Charset := AppSettings.CharSet; |