实现VirtualTree的Editor的功能定制之setBounds

理光在路上

理光在路上

2016-02-19 20:45

岁数大了,QQ也不闪了,微信也不响了,电话也不来了,但是图老师依旧坚持为大家推荐最精彩的内容,下面为大家精心准备的实现VirtualTree的Editor的功能定制之setBounds,希望大家看完后能赶快学习起来。

  
  //做的改动

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  1.//function TStringEditLink.PrepareEdit(Tree: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex): Boolean;

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

      //you can set the value diaplaying int the editor here

      Text :=FTree.GetText(Node,Column);

      FirstMatch :=Pos ('(',Text );

      if FirstMatch 0 then
         LastMatch :=Pos (')',Text )
      else
      begin
        FirstMatch :=Pos ('"',Text );
        if FirstMatch 0 then
           LastMatch :=Pos (';',Text )-1;
      end;

     if LastMatch 0 then
        Text :=Copy (Text,FirstMatch ,LastMatch -firstmatch+1);

  
  2.//procedure TStringEditLink.SetBounds(R: TRect);

    //to change the left of bound

         text:= FTree.GetText(FNode,0);
         Offset :=Pos ('(',Text );

         if Offset =0 then
            Offset :=Pos ('"',Text );

         R.Left :=R.Left +Offset*5;
         R.Right :=R.Right -5;

  3.//function TStringEditLink.BeginEdit: Boolean;
    //to show hint while editing
    FTree.Hint :=FTree.GetText(FNode,0);
    FTree.ShowHint :=True ;

  4.
  procedure TScriptsForm.DataTreeCreateEditor(Sender: TBaseVirtualTree;
    Node: PVirtualNode; Column: TColumnIndex; out EditLink: IVTEditLink);

  begin
     EditLink:= TStringEditLink.Create ;

  end;

展开更多 50%)
分享

猜你喜欢

实现VirtualTree的Editor的功能定制之setBounds

编程语言 网络编程
实现VirtualTree的Editor的功能定制之setBounds

Collections API定制实现(一)

编程语言 网络编程
Collections API定制实现(一)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

定制php4的session功能

PHP
定制php4的session功能

中望CAD定制功能详解

cad教程 autocad教程 CAD
中望CAD定制功能详解

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

JSP登录验证功能的实现

Web开发
JSP登录验证功能的实现

组件制作之四(定制外观)

编程语言 网络编程
组件制作之四(定制外观)

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

Windows 7系统自动连接宽带设置方法

Windows 7系统自动连接宽带设置方法

Dreamweaver中加入竖直线的办法

Dreamweaver中加入竖直线的办法
下拉加载更多内容 ↓