VirtualStringTree - 同一多行节点中的不同文本格式

时间:2016-11-29 18:30:50

标签: delphi virtualtreeview tvirtualstringtree

我有TVirtualStringTree的实例,它以两种不同的方式格式化节点的文本。该实施基于使用toShowStaticText中的StringOptions,如此问题的接受答案中所述:VirtualTreeView - different color of text in the same node

在我为节点设置MultiLine标志之前,一切都已正常工作。现在OnPaintText将不再触发TextType = ttStatic事件。

可以在TCustomVirtualStringTree.DoPaintNode方法中找到此行为的原因,显然是:

// ... and afterwards the static text if not centered and the node is not multiline enabled.
if (Alignment <> taCenter) and not (vsMultiline in PaintInfo.Node.States) and (toShowStaticText in TreeOptions.FStringOptions) then
begin
  S := '';
  with PaintInfo do
    DoGetText(Node, Column, ttStatic, S);
  if Length(S) > 0 then
    PaintStaticText(PaintInfo, TextOutFlags, S);
end;

尽管如此,我希望在同一个MultiLine节点中有两种不同的文本格式。我怎么能这样做?

0 个答案:

没有答案