virtualtreeview

How best to render an overlay icon on top of basic Delphi TVirtualTreeView node icon

我们两清 提交于 2019-12-04 08:59:34
I'm converting a tree view from the standard TTreeView to use TVirtualStringTree. My final challenge is to implement a feature where I need to draw a 'pass/fail' status indicator on top of the known node icon. With TTreeView I used: var R : TRect; begin R := Node.DisplayRect( True ); StatusIconList.Draw( TreeView1.Canvas, R.Left - StatusIconList.Width - 14, R.Top, 3 {MyOverlayImageIndex} ); The result is the red cross over the basic icon as shown below: With TVirtualStringTree I hoped to find either a better way, or to get better known positions for the required overlay icon position. I'm

Is it possible to select multiple columns in Virtual Treeview?

本小妞迷上赌 提交于 2019-12-04 06:01:14
I need to add functionality to copy a rectangular selection of nodes and columns, but I can't find any way to actually select multiple columns in a Virtual Treeview (beside toFullRowSelect). Am I just missing something? And if not, is there a descendant out there with grid-like multicolumn select support? So after some testing I came up with the following, thanks DiGi for the extra push. DrawSelection won't work with this solution so it needs to be disabled. Since I don't think I'll need to do this again soon I didn't write a descendant. Set toDisableDrawSelection, toExtendedFocus and

Is it possible to display one object multiple times in a VirtualStringTree?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 20:58:21
I realize that I really need to rewrite my programs data structure (not now, but soon, as the deadline is monday), as I am currently using VST (VirtualStringTree) to store my data. What I would like to achieve, is a Contact List structure. The Rootnodes are the Categories, and the children are the Contacts. There is a total of 2 levels. The thing is though, that I need a contact to display in more than 1 category, but they need to be synchronized. Particularly the Checkstate . Currently, to maintain sync, I loop thru my whole tree to find nodes that have the same ID as the one that was just

VirtualStringTree Correct/recommended use

怎甘沉沦 提交于 2019-12-03 16:34:23
I have been using virtualstringtree for a while now. I use it for two different things, first a s a normal tree for selecting ,displaying data and secondly as a grid to show outputs from SQL statements. All my data loaded in to the trees is from a database. For the tree example, i have a parentId field to distinguish the heirarchy, and for the grid examples i simply use an SQL statement with a customized record for each tree (that is unique). My questions relates to the preferred/best way to populate the tree. I have read from the VST docs that you should use the onInitNode event along with

How to underline or highlight a part of node caption

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 15:15:02
问题 I want to implement a search function in my virtualtreeview. And I want to highlight or underline the searched word in the nodes. How can I do this? Thank you 回答1: I would write a handler for the OnDrawText event because it's the only event (at this time) where you'll get passed the node text, the rectangle where that text is about to be rendered as well as the canvas prepared for such rendering. There are more proper events for both tasks (like OnBeforeCellPaint , or OnAfterItemErase for

What data structure is best suited for VirtualStringTree?

▼魔方 西西 提交于 2019-12-03 08:12:12
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 lookups, calculate totals, etc? What data structure you are using together with VirtualStringTree? EDIT1 : I

VirtualTreeView: properly handling selection changes

两盒软妹~` 提交于 2019-12-03 06:08:09
问题 This question will seem obvious to those who haven't encountered the problem themselves. I need to handle selection changes in VTV. I have a flat list of nodes. I need to do stuff with all currently selected nodes whenever User clicks a node; User Shift/Ctrl-clicks a node; User uses arrow keys to navigate the list; User creates selection by dragging the mouse User removes selection by clicking on empty space or Ctrl-clicking the only selected node etc. It's the most common and expected

Firemonkey version of VirtualTreeView

瘦欲@ 提交于 2019-12-03 05:49:25
问题 Does anyone happen to know if there is a Firemonkey version of the popular VirtualTreeView in preparation? Also, has anybody collected some experiences with porting custom controls to Firemonkey and can estimate how much work it would be to port the virtual tree view to Firemonkey? We need this control and switching to Firemonkey is only an option if we can get this control to work. Thanks! 回答1: As far as I understand the FireMonkey is so different from the VCL that it would require major

Firemonkey version of VirtualTreeView

烈酒焚心 提交于 2019-12-02 19:09:15
Does anyone happen to know if there is a Firemonkey version of the popular VirtualTreeView in preparation? Also, has anybody collected some experiences with porting custom controls to Firemonkey and can estimate how much work it would be to port the virtual tree view to Firemonkey? We need this control and switching to Firemonkey is only an option if we can get this control to work. Thanks! As far as I understand the FireMonkey is so different from the VCL that it would require major rewrite, basically rewriting the control from scratch... had a quick look into google code's SVN, doesn't look

How to assign data to node of VirtualStringTree in InitNode event

你。 提交于 2019-12-01 12:32:37
I am not sure how to assign data to a node in a VirtualStringTree. I'm need to assign a pointer to a record object to the Node's Data property in the tree control's InitNode event. However I'm getting a 'Pointer type required' compile-time error. type TDiagData = record DiagID: Integer; DiagName: String; Selected: Byte; end; PDiagData = ^TDiagData; var FDiagDataList: TObjectList; c: Integer; // used as an iterator for the list // incremented in vst1InitNode procedure Btn1Click; var DiagData : PDiagData; begin try FDiagDataList := TObjectList.Create; // TODO: Move this to form constructor for c