打印本文 打印本文 关闭窗口 关闭窗口
Delphi下Treeview控件基于节点编号的访问
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2220  更新时间:2009/4/23 18:34:25  文章录入:mintao  责任编辑:mintao
'' then
             Break
         else
             pos:=pos+1;
     end;
     Result:=pos-1;
end;

function TCtrlTree.GetTheLastPointPos(inString: String): Integer;
{功能:找到编号中最后的''''.''''的位置
 入口参数:inString: String为节点编号
 返回:节点编号中最后的''''.''''的位置
}
var
     tmp:Char;
     pos:integer;
begin
     pos:=Integer(StrLen(PChar(inString)));
     while pos>=1 do
     begin
        tmp:=inString[pos];
        if tmp=''''.'''' then
            Break
        else
            pos:=pos-1;
     end;
     Result:=pos;
end;

function TCtrlTree.InsertAsFinalChild(inString: String; inNode: TTreeNode):TTReeNode;
{功能:为当前节点插入一个孩子节点,位置为最后
 入口参数:inString: String为节点编号为待插入节点的字符串
           inNode: TTreeNode,当前节点
}
begin
    Result:=Items.AddChild(inNode,inString);
end;

function TCtrlTree.InsertAsPreviousSibling(inString: String;
  inNode: TTreeNode):TTReeNode;
{功能:为当前节点插入一个前导的兄弟节点
 入口参数:inString: String为节点编号为待插入节点的字符串
           inNode: TTreeNode,当前节点
}
begin
    Result:=Items.AddChildFirst(inNode,inString);
end;

end.

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口