| 52 |
|
var PopupMenu: TPopupMenu); |
| 53 |
|
procedure vst_setRootClick(Sender: TObject); |
| 54 |
|
procedure vst_newRootClick(Sender: TObject); |
| 55 |
+ |
procedure VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; |
| 56 |
+ |
Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; |
| 57 |
+ |
var HintText: WideString); |
| 58 |
|
private |
| 59 |
|
root: TTreeElement; |
| 60 |
|
procedure NewCon(ID: Integer); |
| 65 |
|
|
| 66 |
|
implementation |
| 67 |
|
{$R *.dfm} |
| 68 |
< |
uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main; |
| 68 |
> |
uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main, |
| 69 |
> |
TypeDefs; |
| 70 |
|
|
| 71 |
|
type |
| 72 |
|
PNodeData = ^TNodeData; |
| 91 |
|
begin |
| 92 |
|
if ID >= 0 then |
| 93 |
|
SetRoot(ConManager.Connection[FConnectionID].MetaData.Root); |
| 94 |
+ |
//SetRoot(ConManager.Connection[FConnectionID].MetaData.FileById[454]); |
| 95 |
|
end; |
| 96 |
|
|
| 97 |
|
|
| 123 |
|
newdata: TNodeData; |
| 124 |
|
newnode: PVirtualNode; |
| 125 |
|
i: Integer; |
| 121 |
– |
Meta: TMetaManager; |
| 126 |
|
begin |
| 127 |
|
data := Sender.GetNodeData(node); |
| 124 |
– |
Meta := ConManager.Connection[ConnectionID].MetaData; |
| 128 |
|
|
| 129 |
|
if data.Field.ChildCount > 0 then |
| 130 |
|
begin |
| 154 |
|
ffile := nil; |
| 155 |
|
if data.Field is TFile then |
| 156 |
|
ffile := TFile(data.Field); |
| 157 |
< |
if data.Field is TDatLink then |
| 158 |
< |
if Assigned(TDatLink(data.Field).TargetFile) then |
| 159 |
< |
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); |
| 160 |
|
if Assigned(ffile) then |
| 161 |
|
begin |
| 162 |
|
if Assigned(ffile.Editor) then |
| 216 |
|
if TextType = ttNormal then |
| 217 |
|
begin |
| 218 |
|
case Column of |
| 219 |
< |
0: |
| 220 |
< |
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; |
| 221 |
|
2: |
| 222 |
|
begin |
| 227 |
– |
if Data.Field is TFile then |
| 228 |
– |
CellText := IntToStr(TFile(Data.Field).FileInfo.ID); |
| 229 |
– |
end; |
| 230 |
– |
3: |
| 231 |
– |
begin |
| 223 |
|
if Data.Field is TDataField then |
| 224 |
|
CellText := TDataField(Data.Field).ValueAsString; |
| 225 |
|
end; |
| 254 |
|
|
| 255 |
|
|
| 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 |
+ |
|
| 299 |
|
procedure TForm_Meta.VSTGetPopupMenu(Sender: TBaseVirtualTree; |
| 300 |
|
Node: PVirtualNode; Column: TColumnIndex; const P: TPoint; |
| 301 |
|
var AskParent: Boolean; var PopupMenu: TPopupMenu); |
| 311 |
|
data := Sender.GetNodeData(Node); |
| 312 |
|
if Column = 0 then |
| 313 |
|
begin |
| 314 |
< |
if TTreeElement(data.Field).GetChildCount > 0 then |
| 314 |
> |
if TTreeElement(data.Field).ChildCount > 0 then |
| 315 |
|
PopupMenu := vst_popup |
| 316 |
|
else |
| 317 |
|
PopupMenu := nil; |