Changeset 241 for oup/current/Tools
- Timestamp:
- Jul 18, 2007, 12:27:16 AM (17 years ago)
- Location:
- oup/current/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Tools/BinEdit.dfm
r231 r241 19 19 end 20 20 inherited tab_meta: TTabSheet 21 ExplicitLeft = 0 22 ExplicitTop = 0 23 ExplicitWidth = 0 24 ExplicitHeight = 0 21 inherited filelist_meta: TVirtualStringTree 22 Height = 443 23 end 25 24 end 26 25 end -
oup/current/Tools/MetaEditor.dfm
r239 r241 40 40 Header.Font.Style = [] 41 41 Header.Options = [hoColumnResize, hoDrag, hoVisible] 42 HintAnimation = hatNone 43 HintMode = hmHint 44 ParentShowHint = False 45 ShowHint = True 42 46 TabOrder = 0 43 47 TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoDeleteMovedNodes] … … 47 51 OnGetText = VSTGetText 48 52 OnPaintText = VSTPaintText 53 OnGetHint = VSTGetHint 49 54 OnGetPopupMenu = VSTGetPopupMenu 50 55 OnInitChildren = VSTInitChildren … … 53 58 Position = 0 54 59 Width = 250 55 WideText = ' FName'60 WideText = 'Name' 56 61 end 57 62 item 58 63 Position = 1 59 WideText = 'FType' 64 Width = 100 65 WideText = 'Type' 60 66 end 61 67 item 62 68 Position = 2 63 WideText = 'FID'64 end65 item66 Position = 367 69 Width = 150 68 WideText = ' Data'70 WideText = 'Value' 69 71 end> 70 72 end … … 74 76 Width = 400 75 77 Height = 424 76 ActivePage = tab_ hex78 ActivePage = tab_meta 77 79 Align = alRight 78 80 TabOrder = 1 -
oup/current/Tools/MetaEditor.pas
r240 r241 53 53 procedure vst_setRootClick(Sender: TObject); 54 54 procedure vst_newRootClick(Sender: TObject); 55 procedure VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; 56 Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; 57 var HintText: WideString); 55 58 private 56 59 root: TTreeElement; … … 63 66 implementation 64 67 {$R *.dfm} 65 uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main; 68 uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main, 69 TypeDefs; 66 70 67 71 type … … 88 92 if ID >= 0 then 89 93 SetRoot(ConManager.Connection[FConnectionID].MetaData.Root); 94 //SetRoot(ConManager.Connection[FConnectionID].MetaData.FileById[454]); 90 95 end; 91 96 … … 119 124 newnode: PVirtualNode; 120 125 i: Integer; 121 Meta: TMetaManager;122 126 begin 123 127 data := Sender.GetNodeData(node); 124 Meta := ConManager.Connection[ConnectionID].MetaData;125 128 126 129 if data.Field.ChildCount > 0 then … … 152 155 if data.Field is TFile then 153 156 ffile := TFile(data.Field); 154 if data.Field is TDatLink then155 if Assigned( TDatLink(data.Field).TargetFile) then156 ffile := TFile( TDatLink(data.Field).TargetFile);157 if data.Field is _MetaTypes.TDatLink then 158 if Assigned(_MetaTypes.TDatLink(data.Field).TargetFile) then 159 ffile := TFile(_MetaTypes.TDatLink(data.Field).TargetFile); 157 160 if Assigned(ffile) then 158 161 begin … … 214 217 begin 215 218 case Column of 216 0: 217 begin 218 CellText := Data.Field.GetCaption; 219 end; 220 1: 221 begin 222 if Data.Field is TFile then 223 CellText := TFile(Data.Field).FileInfo.Extension; 224 end; 219 0: CellText := Data.Field.Caption; 220 1: CellText := data.Field.VType; 225 221 2: 226 begin227 if Data.Field is TFile then228 CellText := IntToStr(TFile(Data.Field).FileInfo.ID);229 end;230 3:231 222 begin 232 223 if Data.Field is TDataField then … … 264 255 265 256 257 procedure TForm_Meta.VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; 258 Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; 259 var HintText: WideString); 260 var 261 data: PNodeData; 262 CellText: WideString; 263 264 i: Integer; 265 links: TStrings; 266 begin 267 inherited; 268 if Assigned(Node) then 269 begin 270 VSTGetText(Sender, Node, Column, ttNormal, CellText); 271 if Length(CellText) > 0 then 272 begin 273 data := Sender.GetNodeData(Node); 274 if data.Field is TDataField then 275 begin 276 case Column of 277 0,1: HintText := TDataField(data.Field).Description; 278 2: HintText := ''; 279 end; 280 end; 281 if (data.Field is _MetaTypes.TDatLink) and (Column = 2) then 282 begin 283 links := nil; 284 links := ConManager.Connection[FConnectionID].GetFilesList(_MetaTypes.TDatLink(data.Field).PosExts, '', False, ST_NameAsc); 285 HintText := IntToStr(links.Count); 286 for i := 0 to Min(links.Count - 1, 99) do 287 begin 288 if (i mod 5) = 0 then 289 HintText := HintText + #13+#10; 290 HintText := HintText + links.Strings[i] + ' '; 291 end; 292 end; 293 end; 294 end 295 else 296 HintText := ''; 297 end; 298 266 299 procedure TForm_Meta.VSTGetPopupMenu(Sender: TBaseVirtualTree; 267 300 Node: PVirtualNode; Column: TColumnIndex; const P: TPoint; … … 279 312 if Column = 0 then 280 313 begin 281 if TTreeElement(data.Field). GetChildCount > 0 then314 if TTreeElement(data.Field).ChildCount > 0 then 282 315 PopupMenu := vst_popup 283 316 else -
oup/current/Tools/_TemplateFileList.dfm
r233 r241 33 33 Margins.Right = 1 34 34 Margins.Bottom = 0 35 ActivePage = tab_ meta35 ActivePage = tab_files 36 36 Align = alClient 37 37 TabOrder = 0 … … 261 261 Align = alClient 262 262 ItemHeight = 13 263 PopupMenu = filepopup 263 264 TabOrder = 1 264 265 OnClick = listClick … … 269 270 Caption = 'Tree' 270 271 ImageIndex = 1 271 ExplicitLeft = 0272 ExplicitTop = 0273 ExplicitWidth = 0274 ExplicitHeight = 0275 272 object filelist_meta: TVirtualStringTree 276 273 Left = 0 … … 309 306 end 310 307 object filepopup: TPopupMenu 308 OnPopup = filepopupPopup 311 309 Left = 72 312 310 Top = 216 … … 316 314 object popup_linkshere: TMenuItem 317 315 Caption = 'What links here? Where does this file link to?' 316 OnClick = popup_linkshereClick 318 317 end 319 318 object popup_separator: TMenuItem … … 322 321 object popup_import: TMenuItem 323 322 Caption = 'Import binary .dat-file' 323 OnClick = popup_importClick 324 324 end 325 325 object popup_export: TMenuItem 326 326 Caption = 'Export binary .dat-file' 327 OnClick = popup_exportClick 327 328 end 328 329 end
Note:
See TracChangeset
for help on using the changeset viewer.