tvirtualstringtree

How to select all root or all child nodes in VirtualStringTree?

一曲冷凌霜 提交于 2020-01-03 15:15:53
问题 I would like to select either all root nodes or all child nodes (not all nodes in a VirtualTreeView). I've tried to use this code to select all root nodes: procedure SelectAllRoots; var Node: PVirtualNode; begin Form1.VirtualStringTree1.BeginUpdate; Node := Form1.VirtualStringTree1.GetFirst; while True do begin if Node = nil then Break; if not (vsSelected in Node.States) then Node.States := Node.States + [vsSelected]; Node := Form1.VirtualStringTree1.GetNext(Node); end; Form1

When to redraw VirtualTreeView after OnNewText event?

旧巷老猫 提交于 2019-12-14 03:49:25
问题 I use this code to fill VirtualStringTree and allow renaming items: //--------------------------------------------------------------------------- // Structure for the tree //--------------------------------------------------------------------------- struct TVSTdata { UnicodeString Name; }; //--------------------------------------------------------------------------- // Initialization of the tree //--------------------------------------------------------------------------- __fastcall TForm1:

TVirtualStringTree. How to check a node and its children with a single confirmation?

偶尔善良 提交于 2019-12-13 03:29:46
问题 I have a component of type TVirtualStringTree . The option toCheckSupport is enabled. The options related to the propagation of checkstates are also enabled, because the propagation is needed. I want to implement checking a node with a confirmation ("Are you sure you want to check... ?"). Unfortunately, if the options for propagation are enabled, the events OnCheck and OnChecking are triggered including for the child nodes. Therefore, placing the message in the event procedures make it show

Virtual StringTree's hint windows are left out on the screen

南楼画角 提交于 2019-12-13 01:25:44
问题 See this screenshot, in the middle it's the small hint windows that are generated by a TVirtualStringTree control and were left out on the screen, these hint windows will remain there until the application exits. the problem happens when the treeview's hint is shown and the mouse leaves quickly to the window next to it. Any idea about how to avoid this or how to clear those un-erased hint windows if it's difficult to avid this? Few days ago I asked a similar question, while the hint windows

how to draw nodes inline in TvirualTree?

风流意气都作罢 提交于 2019-12-11 04:22:12
问题 I am currently drawing some images inside Tvirtualdrawtree using on before paint. Here is my drawing code procedure TForm2.VDTAniBeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect); var Data: PAnimeData; NewRect: TRect; R: TRect; begin // if not Assigned(Node) then begin exit; end; Data := VDTAni.GetNodeData(Node); case Column of 0, 1 ,2, 3, 4, 5, 6, 7: begin

Saving VirtualStringTree Node Data

妖精的绣舞 提交于 2019-12-11 02:37:46
问题 I am trying to move a project from D6 to D-XE3. I am getting garbage when saving and loading the tree data in the OnSaveNode and OnLoadEvents using version 5.10 of VirtualStringTree. I'm probably not handling Unicode correctly, but there could be some other ignorance on my part: procedure TfMain.vstGridSaveNode(Sender: TBaseVirtualTree; Node: PVirtualNode; Stream: TStream); var Data: PStkData; begin Data := Sender.GetNodeData(Node); // Owned: boolean; Stream.Write(Data.Owned, SizeOf(boolean)

How can I hide a TVirtualStringTree node?

北城以北 提交于 2019-12-10 15:14:09
问题 if I'm not mistaken it's not possible to have invisible nodes in a TVirtualStringTree treeview, as there are no enabled, visible or other properties to do so. Am I right about this? If yes, how did I manage to have a non visible node? Structure of my tree: One Node Another node Subnode 1 Subnode 2 ... Subnode 15 Subnode 16 (which is not visible!) Yet another node Subnode 1 from yet another node Subnode 2 from yet another node I can find Subnode 16 when I do a FirstNode/GetNextNode loop over

How to display an icon or image in a column of TVirtualStringTree?

末鹿安然 提交于 2019-12-10 14:43:47
问题 In a Delphi VCL project, I have created a simple TVirtualStringTree with two columns. The first column will contain text identifying the Name of the data being represented. The data record also contains a status field. The second column is intended to represent the status of the record using an image (16x16 pixel) w/o text. I have searched demos, but have not mastered the full process for how VTV displays a node, and have not been successful in getting an icon to display in the node of a

VirtualTreeView - different color of text in the same node

≡放荡痞女 提交于 2019-12-09 15:54:34
问题 I am attempting to create a view in TVirtualStringTree which will be similar to something like this: In the above example I have shown some of the possible scenarios I want to reach. FolderA has bold text and after that red-colored unbolded text just behind it in the same node. I am looking for way to make this sort of output. However, if this is too hard or too problematic to create, I would be happy with FolderB or FolderC type of output - which could probably be made with 2 columns, one

Color VirtualStringTree rows with hidden nodes

丶灬走出姿态 提交于 2019-12-07 07:30:39
问题 I'm currently using this code in the OnBeforeCellPaint event of my tree: if Node.Index mod 2 = 0 then begin TargetCanvas.Brush.Color := clBlack; TargetCanvas.FillRect(CellRect); end else begin TargetCanvas.Brush.Color := clPurple; TargetCanvas.FillRect(CellRect); end; To color my nodes. But with hidden nodes this doesn't work as the index stays the same. Is there an visible index or an easy workaround? Thanks in advance. 回答1: There is no such method to get visibility node index at this time.