Changeset 241 for oup/current/Tools/MetaEditor.pas
- Timestamp:
- Jul 18, 2007, 12:27:16 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.