- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要在 TVirtualStringTree
中显示一个长数据库表(例如 50000 条记录)。为了减少查询执行时间,我限制了记录数,仅包含那些实际显示在树中的记录数。处理OnGetText
的代码片段如下。问题是 VisibleCount
返回 50000 而不是 20-30,这破坏了这种方法。有没有办法正确地做到这一点?
procedure TContactsFrame.vstContactsGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
begin
if vstContacts.GetNodeLevel(Node) = 0 then
CellText := 'Group'
else if vstContacts.GetNodeLevel(Node) = 1 then
begin
if Contacts[Node.Index].Index = -1 then
begin
// getting DB table values of visible records only
GetContacts(Node.Index + 1, Node.Index + 1 + vstContacts.VisibleCount, Contacts);
end;
CellText := Contacts[Node.Index].Name;
end;
end;
最佳答案
VisibleCount
为您提供设置了 vsVisible
标志的节点数(可见意味着不隐藏)。
要枚举 TreeView 中当前显示的节点,您可以使用 TopNode
和 BottomNode
,方式类似于:
var
Run, LastNode: PVirtualNode;
begin
LastNode := Treeview.GetNextVisible(Treeview.BottomNode);
Run := Treeview.TopNode;
while Assigned(Run) do
begin
// your processing here
Run := Treeview.GetNextVisible(Run);
if Run = LastNode then
Break;
end;
end;
关于delphi - 如何获取TVirtualStringTree中显示的节点数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55042005/
我有一个问题需要分而治之解决。有一个包含 N 个点的集合 S。如果有一个平行于轴的正方形,只包含S中的两个点p1和p2,则我们称p1和p2为 friend 点。 现在,我需要使用分而治之算法来计算 S
为 iPad 编程时,字体(和其他)大小以“磅”为单位指定。我已经看到将点作为独立于屏幕分辨率的像素的引用。但是我无法确定一个点的实际大小(即以英寸为单位)。一个点是否等于标准 iPad 屏幕上的一个
我有一个来自 Hadley Wickham 的 ggplot2 书中的问题。 我在这里有这个数据框: class % group_by(class) %>% summarise(n = n
好的,这是一些代码( pdfDocument 是 com.itextpdf.text.Document ): PdfPTable table = new PdfPTable(1); PdfPCell
我正在尝试添加一个 if 语句,如果小于 17,则将另一张牌添加到 DealerHand 中。 目前,它只是记录: 7 19 [ { suit: '♦', value: 9, points: 9 },
我正在编写一个程序,我需要: 对图像的每个像素进行测试 如果测试结果为真,我必须向点云中添加一个点 如果测试结果为假,什么都不做 我已经在 CPU 端 C++ 上编写了一个工作代码。现在我需要使用 C
我是一名优秀的程序员,十分优秀!