6.3 Визуальное программирование в среде Lazarus
____________________________________________________________________
then begin
repeat
// Показываем только каталоги
if (srNode.Attr and faDirectory <> 0) and (Real_Directory(srNode.Name)) then begin
Node:= TreeView1.Items.AddChild(nil,
SysToUTF8(srNode.Name));
Node.ImageIndex:= 0;
Node.SelectedIndex:= 0;
{$IFDEF WINDOWS}
searchMask:= path + srNode.Name + '\*'; {$ELSE}
searchMask:= path + srNode.Name + '/*'; {$ENDIF}
if FindFirst(searchMask, faDirectory, srChild) = 0 then
repeat
if (srChild.Attr and faDirectory <> 0) and Real_Directory(srChild.Name)
then Node.HasChildren:= true; until (FindNext(srChild) <> 0) or Node.HasChildren;
// Освобождение занятых ресурсов
SysUtils.FindClose(srChild);
end;
until FindNext(srNode) <> 0;
// Освобождение занятых ресурсов