Changeset 231 for oup/current/Tools/_TemplateFileList.pas
- Timestamp:
- Jun 21, 2007, 12:24:04 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/Tools/_TemplateFileList.pas
r230 r231 9 9 10 10 type 11 TNewFileSelectingEvent = procedure(FileInfo: TFileInfo; var allowed: Boolean) of object; 12 11 13 TForm_TemplateFileList = class(TForm_TemplateFile) 12 14 panel_files: TPanel; … … 62 64 const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; 63 65 TextType: TVSTTextType); 66 procedure filelist_metaFocusChanging(Sender: TBaseVirtualTree; OldNode, 67 NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; 68 var Allowed: Boolean); 69 procedure filelist_metaFocusChanged(Sender: TBaseVirtualTree; 70 Node: PVirtualNode; Column: TColumnIndex); 64 71 private 65 72 FSortBy: TSortType; 66 73 FAllowedExts: String; 67 74 FAllowMultiSelect: Boolean; 75 FOnNewFileSelecting: TNewFileSelectingEvent; 68 76 procedure SetAllowedExts(exts: String); 69 77 procedure SetMultiSelect(allow: Boolean); … … 75 83 property AllowedExts: String read FAllowedExts write SetAllowedExts; 76 84 property AllowMultiSelect: Boolean read FAllowMultiSelect write SetMultiSelect; 85 property OnNewFileSelecting: TNewFileSelectingEvent read FOnNewFileSelecting write FOnNewFileSelecting; 77 86 end; 78 87 … … 404 413 405 414 415 procedure TForm_TemplateFileList.filelist_metaFocusChanged( 416 Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex); 417 var 418 data: PNodeData; 419 begin 420 inherited; 421 data := Sender.GetNodeData(Node); 422 if data.Field is TFile then 423 begin 424 if Assigned(FOnNewFileSelected) then 425 begin 426 FOnNewFileSelected(TFile(data.Field).FileInfo); 427 end; 428 end; 429 end; 430 431 procedure TForm_TemplateFileList.filelist_metaFocusChanging( 432 Sender: TBaseVirtualTree; OldNode, NewNode: PVirtualNode; OldColumn, 433 NewColumn: TColumnIndex; var Allowed: Boolean); 434 var 435 data: PNodeData; 436 begin 437 inherited; 438 data := Sender.GetNodeData(NewNode); 439 if data.Field is TFile then 440 begin 441 if Assigned(FOnNewFileSelecting) then 442 begin 443 FOnNewFileSelecting(TFile(data.Field).FileInfo, Allowed); 444 end; 445 end; 446 end; 447 406 448 procedure TForm_TemplateFileList.filelist_metaGetText(Sender: TBaseVirtualTree; 407 449 Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; … … 418 460 if data.Field is TFile then 419 461 begin 420 if TFile(data.Field).File Name = '' then421 CellText := TFile(data.Field).File Ext+ ' (unnamed)'462 if TFile(data.Field).FileInfo.Name = '' then 463 CellText := TFile(data.Field).FileInfo.Extension + ' (unnamed)' 422 464 else 423 CellText := TFile(data.Field).File Ext + ': ' + TFile(data.Field).FileName;465 CellText := TFile(data.Field).FileInfo.Extension + ': ' + TFile(data.Field).FileInfo.Name; 424 466 end; 425 467 end; … … 479 521 if Data.Field is TFile then 480 522 begin 481 if Length(TFile(Data.Field).File Name) = 0 then523 if Length(TFile(Data.Field).FileInfo.Name) = 0 then 482 524 TargetCanvas.Font.Color := $C06060; 483 if TFile(Data.Field).File Size = 0 then525 if TFile(Data.Field).FileInfo.Size = 0 then 484 526 TargetCanvas.Font.Color := $2020A0; 485 527 end;
Note:
See TracChangeset
for help on using the changeset viewer.