⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 treeutils.pas

📁 是一个delphi的流程制作软件
💻 PAS
字号:
unit TreeUtils;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

function IsDuplicateName(  Node : TTreeNode;
                           sNewName : string;
                           bInclusive : boolean
                         ) : boolean;


implementation


function IsDuplicateName(  Node : TTreeNode;
                           sNewName : string;
                           bInclusive : boolean
                         ) : boolean;
var
   TestNode : TTreeNode;
begin
   if(  Node = nil  ) then
   begin
      Result := false;
      Exit;
   end;

      {Include this Node?}
   if(  bInclusive  ) then
      if(   CompareText(  Node.Text,  sNewName  ) = 0   ) then
      begin
         Result := true;
         Exit;
      end;


      {Test all previous siblings}
   TestNode := Node;
   repeat
         {Get next}
      TestNode := TestNode.GetPrevSibling;

      if(  TestNode <> nil  ) then
            {Is this a duplicate}
         if(   CompareText(  TestNode.Text,  sNewName  ) = 0   ) then
         begin
            Result := true;
            Exit;
         end;
   until (TestNode = nil);


      {Test all next siblings}
   TestNode := Node;
   repeat
         {Get next}
      TestNode := TestNode.GetNextSibling;

      if(  TestNode <> nil  ) then
            {Is this a duplicate}
         if(   CompareText(  TestNode.Text,  sNewName  ) = 0   ) then
         begin
            Result := true;
            Exit;
         end;
   until (TestNode = nil);

   Result := false;
end;









end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -