D7控件\dw_cd_VirtualTreeview_v4.5.2\Demos\Advanced---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
  

  

上传容量有限,含packge和source V5.5.2: (10 Nov 2014) * Various improvements regarding code style * Implemented #471: Added emVisibleDueToExpansion and emSelected to TVTExportMode * Fixed issue #488: XE7 packages should depend on one another and use suffix 21 * Fixed issue #462: Undo r636, make VirtualTreesD require VirtualTreesR again * Fixed issue #489 XE2 compiler switch error V5.5.1: (13 Oct 2014) * Fixed issue #479: The style hooks for the VCL styles are now registered for TVirtualStringTree and TVirtualDrawTree instead of TBaseVirtualTree, which makes it easier to use own style hooks in derived classes. * Partial fix for issue #478: The standard VCL property StyleElemets (public in TControl in RAD Studio XE3 and higher) is now supported and published for TVirtualStringTree and TVirtualDrawTree (XE3 and higher). This means you can define if the font and the backgrounbd color is taken from the VCL style or the control's properties. Leaving out seBorder is not yet working well, more work will be necessary. * Fixed issue #473: Return type of GetUtilityImages should be TCustomImageList * Fix for issue #470: VCL Styles and sorting failure * Added missing inherited to CMMouseEnter() * Fixed issue #468: Redundant code in CreateSystemImageSet() * Fixed issue #482: AutoScale() could cause exception during form load. * Added fix for #466: No parent window if column created in constructor * Fixed issue #446: ScrollIntoView does not work properly after applying patch from issue #339 * Improvements for toAlwaysSelectNode option: Selection of next sibling has been improved in case the currently selected node is being removed. * Added missing begin/end-block in MeasureItemHeight() * Improved fix for issue #438: Now correctly initializing member of property TVTColors.UnfocusedColor * Improved fix for issue #447: DoMeasureItem() was called for Node instead of Child. * Minor improvement in appearance of border lines in HTML export. * Fixed issue #480: Warning when compiling Delphi XE2 packages * Fixed #472: Redundant conditions in TVclStyleScrollBarsHook.WMMouseMove * Fixed #476: Simplify TVTDragImage.WillMove() * Fixed issue #485: unit VirtualTrees does not compile with {$TYPEDADDRESS ON}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值