问题标签 [tvirtualstringtree]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1773 浏览

delphi - 当隐藏一列时,VirtualStringTree 列应调整大小

我有一个带有 3 列的 VST,它们均匀地占用了可用空间。

  • 我已经hoAutoSpringHeader.Options中设置了,并且
  • 所有列都有Column[x].OptioncoAutoSpring设置。

现在我希望能够隐藏最后一列并保持其他列均匀占用可用空间(有点像带有 的控件alClient)。

当我只将列设置为不可见(见下文)时,该列占用的空间就根本未被使用。

当我将Header.Options.hoAutoResize设置为True并将Header.AutoSizeIndex设置为 时1,第二列将占用所有新空间。

有没有办法告诉列填充可用空间并均匀调整大小?

截屏:

在此处输入图像描述

0 投票
2 回答
2016 浏览

delphi - Delphi:第一次点击后获取VirtualStringTree的编辑模式

我想VirtualStringTree在单击单元格后直接从 编辑单元格(节点)(类似于StringGrid带有选项的 agoEditing:TruegoAlwaysShowEditor:True

我已经设置了选项toEditable:True,但是在第二次单击toEditOnClick:True后组件进入编辑模式(首先是聚焦单元格,其次是编辑)editDelay:0VirtualStringTree

0 投票
1 回答
242 浏览

delphi - TVirtaulStringTree - How to trigger FocusChanged on "idle"?

Let me try to explain my situation:

I'm using VirtualTree as a grid, and every time when the OnFocusChanged event is fired, and the active focus node was changed, I have a synchronous operation which may take 0-1 sec which blocks the main Thread (sometimes more).

I can live with this.
For now, I can't move this logic to a worker thread.

My problem happens when I use the arrows keys to move up and down in the grid, and the focus node is changing rapidly. It is not smooth because of the blocking.

So I tried to use a Post message like:

This helps a little, but still I realize I need some "Idle" mechanism. So if I move arrows up and down my working process will only be triggered when the VirtualTree is Idle for 100 ms or so. I realize I need to use some timer or maybe "eat" the Post messages and process only the last one, but I can't figure how to do it. I tried many variations with TTimer/GetTickCount and it seems I'm really messing something so trivial.

0 投票
1 回答
259 浏览

delphi - 使用 poUnbuffered 时 TVirtualStringTree 中的 PaintTree 行为不正确

使用 poUnbuffered 选项时,TVirtualStringTree 中的 PaintTree 逻辑似乎存在错误。只有树的第一个节点在输出中可见。我使用 Minimal VST 示例进行了测试,并且行为是相同的。当 poUnbuffered 用作选项时,只有第一个节点可见,删除该选项并正确绘制树。

如果我单步执行代码,那么所有对象都被绘制在画布上,所以它看起来像是一个剪切问题,但我使用 VST 的工作不足以确定问题所在。他们在画布原点和剪裁方面发挥了很多作用。

要查看实际问题,只需将以下代码放在包含 VST 的任何表单上,根据需要更改名称以保护无辜者,然后单击离开。

有没有人遇到过这个?

更多细节:

poUnbuffered 的绘制代码和没有它的绘制代码之间几乎没有区别。我没有使用列,所以主要区别是:

在不使用 poUnbuffered 时,稍后有几个 BitBlt 将位图复制到画布上。

0 投票
1 回答
924 浏览

delphi - 如何定义 TVirtualStringTree 的节点出现在屏幕上?

很容易检查节点是否可见。但我不知道如何正确定义屏幕上显示的节点。我只能这样发现:

(代码不检查)

但我认为这是相当粗糙的方式。可能有更准确的方法吗?

0 投票
0 回答
261 浏览

delphi - 如何在 VirtualStringTree 的节点上播放动画 GIF?

可以在 TVirtualStringTree 中播放一些动画 GIF 节点图像吗?

这就是我的问题。怎么做?

0 投票
1 回答
589 浏览

delphi - 如何防止某个Virtual StringTree NodeLevel被拖动?

我想要完成的事情

我有一个虚拟字符串树,其中包含用户可以扩展的子级行。所有节点的最高层级应是可拖动的。但是没有一个子节点级别应该是。

如何测试

对于测试,我使用当前 Virtual TreeView 版本的 Advanced Demo 项目。第二个演示(通用能力和特性)具有足够的节点层次结构,您可以拖动节点。

考虑

我以为我可以通过使用字符串树的OnDragAllowed事件来完成我的任务,但是当我拖动它时它不会被触发。我的目的是GetNodeLevel在拖动开始之前检查节点级别 ( ),并且只允许拖动顶级节点级别 0。

如何防止拖动虚拟字符串树的某些节点级别?

0 投票
1 回答
1467 浏览

delphi - TVirtualStringTree 在树中绘制节点自己的图像/图标

我需要绘制一些图形作为节点图像。就像它在 OnGetImageIndex 事件中从 ImageList 中绘制图像一样,但来自 TIcon、TImage、TBitmap 等单一来源。

在我的情况下,所有节点在 UserData 记录中都有自己的图标和位置。

我如何将这些图标绘制到节点上?

我在这里找到了这段代码,并试图适应我的情况:

单击按钮后,我看到: 在此处输入图像描述

为什么会这样?图标大小 100% - 16 x 16 像素。

我在哪里可以解决绘制文本的问题?

我做错了什么?

0 投票
1 回答
591 浏览

delphi - VirtualStringTree 锁列 0

VirtualStringTree是否可以像在 Excel 中那样在水平滚动期间锁定第 0 列(带有节点名称) ?

0 投票
1 回答
417 浏览

delphi - 为具有隐藏节点的 VirtualStringTree 行着色

我目前在我的树的 OnBeforeCellPaint 事件中使用此代码:

为我的节点着色。但是对于隐藏节点,这不起作用,因为索引保持不变。是否有可见的索引或简单的解决方法?

提前致谢。