zoukankan      html  css  js  c++  java
  • D7控件dw_cd_VirtualTreeview_v4.5.2DemosAdvanced---TVirtualStringTree用法

    VST1: TVirtualStringTree; 
    //按钮公用函数,根据不同 标签tag区分,
    Screen.Cursor := crHourGlass; //设置屏幕鼠标的形状为crhourGlass 
      with VST1 do
      try
        Start := GetTickCount;  // Start: Cardinal;
        case (Sender as TButton).Tag of
          0: // add to root
            begin
              Count := StrToInt(NodeCountEdit.Text);
              RootNodeCount := Integer(RootNodeCount) + Count; //TVirtualStringTree的属性,写函数写好添加功能
            end;
          1: // add as child
            if Assigned(FocusedNode) then
            begin
              Count := StrToInt(NodeCountEdit.Text);
              ChildCount[FocusedNode] := Integer(ChildCount[FocusedNode]) + Count; //TVirtualStringTree的属性,写函数写好添加子项功能
              Expanded[FocusedNode] := True;
              InvalidateToBottom(FocusedNode);
            end;
        end;
        Label1.Caption := Format('Last operation duration: %d ms', [GetTickCount - Start]);//计算耗时毫秒
        Label3.Caption := Format('Nodes in tree: %d', [VST1.TotalCount]);
      finally
        Screen.Cursor := crDefault;//恢复光标
      end;
      -------------------
      VST1.Clear; //清除
      VST1.DeleteSelectedNodes;//删除 所选择的项
      VST1.TreeOptions.PaintOptions + [toShowBackground] //在子集里面添加可以显示背景图
      ------------------
      begin
      with OPD do //TOpenPictureDialog
      begin
        if Execute then
        begin
          VST1.Background.LoadFromFile(FileName);  //加载背景图片,貌似bmp格式会好些
          //  VST1.Invalidate //隐藏背景图
        end;
      end;
    end;
    
    ----------------
    通过TRadioGroup的第二个单选,巧妙地:
    with VST2.TreeOptions do
        if ThemeRadioGroup.ItemIndex = 0 then
          PaintOptions := PaintOptions + [toThemeAware]  //添加子集
        else
          PaintOptions := PaintOptions - [toThemeAware];
      RadioGroup1.Enabled := ThemeRadioGroup.ItemIndex = 1; //巧妙地取为 boolean类型
      RadioGroup2.Enabled := ThemeRadioGroup.ItemIndex = 1;
      ---------------
        TCheckImageKind = (  //定义的枚举类型
        ckLightCheck,     // gray cross
        ckDarkCheck,      // black cross
        ckLightTick,      // gray tick mark
        ckDarkTick,       // black tick mark
        ckFlat,           // flat images (no 3D border)
        ckXP,             // Windows XP style
        ckCustom,         // application defined check images
        ckSystem,         // System defined check images.
        ckSystemFlat      // Flat system defined check images.
      );
      VST2.CheckImageKind := TCheckImageKind(CheckMarkCombo.ItemIndex);//通过combobox的值巧妙地取出枚举类型值并赋值给
      -------------
      with Sender as TCheckBox, AlignTree.Header do
      Options := Options + [hoShowImages];//显示图像
      Options := Options + [hoVisible]  //可以显示表格 头标题 [coEnabled]是否可以失效
      ChangeHeaderText; //显示文字或隐藏
      ----------------
      可以做像预览的效果,当页面上无法完全显示时,可以浮动显示整个字段。--有待分析。
      Label显示多行字还是不错的,比Memo好看,但后者可以复制操作等。
      -------------
      Columns = < //设定里面的每一栏 是否可以点击或高亮显示,--有待分析。
          item
            ImageIndex = 1
            Options = [coDraggable, coEnabled, coResizable, coShowDropMark, coVisible] 
            Position = 0
            Spacing = -1
            Width = 200
            WideText = 'Default drawing'
            WideHint = 'This column is drawn entirely by the tree.'
          end
      
    

      

  • 相关阅读:
    jQuery1.3.2 源码学习8 index 函数
    转发:在 IE 和 FireFox 中 Javascript 代码的调试视频
    关于 Fiddler 使用的两个常见问题的解决视频
    jQuery1.3.2 源码学习7 setArray,each 函数
    一个 Free 的 Web Server
    服务器端编程的10大性能问题
    Windows Socket五种I/O模型——代码全攻略
    几种winsock I/O模型的分析
    小谈Onlinegame服务器端设计(3)
    [转载]理解 I/O Completion Port (IOCP完成端口)
  • 原文地址:https://www.cnblogs.com/rogge7/p/4530276.html
Copyright © 2011-2022 走看看