virtualtreeview

How to disable MouseWheel if mouse is not over VirtualTreeView (TVirtualStringTree)

谁都会走 提交于 2019-12-10 12:56:44
问题 TVirtualStringTree behaves by default if it is focused - it will scroll on mouse wheel even if mouse is not over control (except if it is over another TVirtualStringTree). Is there a quick and elegant way to disable this behaviour? I already did this with OnMouseWheel event and checking with PtInRect if Mouse.CursorPos if it is over a control but I have a feeling that there is a better way to do the same because this way I'd have to define a new event for each TreeView I add and also handle

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

VirtualTreeview Nodes, pass them to another form?

若如初见. 提交于 2019-12-09 08:21:27
My application will be looping thru the Virtual Nodes and check their data. I am using another form to do this than the form containing the VirtualStringTree. (I got my reasons ;) ) My question is: How can I pass those nodes + their data to a function in my other form, which will then be able to loop thru the nodes (I know how to loop, I just need the nodes to be available in my other form). Also, please note that the form that contains the VirtualStringTree is destroyed once the Processing form is being shown! How could I do that? I am thinking about creating a dynamic VirtualStringTree, and

What data structure is best suited for VirtualStringTree?

五迷三道 提交于 2019-12-09 06:25:27
问题 I guess everyone who had ever used Delphi's VirtualStringTree will agree that it is a great control. It is a "virtual" control (your data must be held somewhere else) so I was thinking what data structure is the best suited for such a task? IMO that data structure must support hierarchy, it must be fast and easily expandable. The easiest implementation would be using a record and that's what most of the documentation which can be found is suggesting. But what if you need to do some fast

how to add objects to virtualtreeview

柔情痞子 提交于 2019-12-08 13:20:40
问题 In short, I'm trying to add Object into VirtualTreeView but am always getting error EAccessViolation at CellText I'm wondering about the reason for the error i tried to do my best but without result... this is my attempt: TForm1 = class(TForm) private public end; TPerson = class; PPersonNode = ^TPersonNode; TPersonNode = record PersonObj: TPerson; end; TPerson = class(TObject) private FName: string; public property Name: string read FName write FName; end; procedure TForm1.Button1Click(Sender

VirtualTreeview Nodes, pass them to another form?

◇◆丶佛笑我妖孽 提交于 2019-12-08 07:22:57
问题 My application will be looping thru the Virtual Nodes and check their data. I am using another form to do this than the form containing the VirtualStringTree. (I got my reasons ;) ) My question is: How can I pass those nodes + their data to a function in my other form, which will then be able to loop thru the nodes (I know how to loop, I just need the nodes to be available in my other form). Also, please note that the form that contains the VirtualStringTree is destroyed once the Processing

How can I keep the check state of multiple Virtual Tree View nodes in sync?

北慕城南 提交于 2019-12-07 21:47:04
问题 My tree has 2 levels of nodes - it's a Contact List style tree. My problem is, that I would like to have every contact checked, in all the "Contact Categories". Here is a screenshot of my contact list as it looks now (And yes, I have permission to post it) As you see, Todd Hirsch is checked in the Category Test Category , but not in All Contacts . What I am trying to achieve, is to have a contact have the same checked status in every category. Example: I check Todd Hirsch in the Test Category

VirtualTreeView add roots with Threads

点点圈 提交于 2019-12-07 20:33:50
问题 I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like this: function AddRoot ( p : TForm1 ) : Integer; stdcall; begin p.VirtualStringTree1.AddChild(NIL); end; var Dummy : DWORD; i : Integer; begin for i := 0 to 2000 do begin CloseHandle(CreateThread(NIL,0, @ADDROOT, Self,0, Dummy)); end; end; The reason for this is that I want to add all connections from my INDY Server to the TreeView. Indy's onexecute/onconnect get's

Virtual StringTree: How to determine if the node text is completely shown?

青春壹個敷衍的年華 提交于 2019-12-07 15:53:38
问题 When TVirtualStreeTree.HintMode = hmTooltip, the node text will become the hint text when the mouse is hovered over a node and column where the node text is not completely shown. But I have to set HintMode = hmHint, so that I can in the even handler supply various hint text based on the position the current mouse cursor is, and in that HintMode the hint text is not generated automatically. My question is how to know if the a node text is shown completely or not, so that I know should I supply

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.