virtualtreeview

add small icon to virtualtreeview

耗尽温柔 提交于 2019-12-01 12:04:59
i am trying to add small icon to VirtualTreeview in delphi2010 i have ImageList attached to VirtualTreeview using the property images procedure TMainFrm.VSTGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer); var FileInfo: PFileInfoRec; begin if Kind in [ikNormal , ikSelected] then begin if Column = 0 then ImageIndex :=ImageList1.AddIcon(FileInfo.FileIco); end; end; but after adding the icons look too dark: FileInfo Strucutre (Record with methods) filled whene i load the files so what i need is

How to assign data to node of VirtualStringTree in InitNode event

霸气de小男生 提交于 2019-12-01 11:10:42
问题 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 :

How to reliably scroll Virtual TreeView to the bottom?

假装没事ソ 提交于 2019-11-30 20:33:16
A TVirtualStringTree object with custom node height, How to reliably scroll Virtual TreeView to the bottom (i.e. the scrollbar gets to the bottom)? I tried calling tree1.FullExpand then tree1.ScrollIntoView.(tree1.GetLast) , but it does not work. Thank you in advance. ScrollIntoView works well for me. You can also try tree1.FocusedNode := tree1.GetLast; Are you setting custom node height in OnMeasureItem event? If it doesn't work, try to set tree's DefaultNodeHeight to the bigger value and in OnMeasureItem event change it to lower. I noticed that tree recalculates scrollbar's length better

Virtual TreeView selection width with toUseExplorerTheme

a 夏天 提交于 2019-11-30 15:13:54
问题 When I use toUseExplorerTheme in TVirtualStringTree.PaintOptions it draws the selection like this: Notice that the selection extends from the left side of the control to the position of the rightmost extent of any node caption; the selections are all the same width. I want it to look as in this image (someone else's project, using Virtual TreeView), where the selection covers only the text of the node caption: Unless there is a regression in Virtual TreeView (I'm using 5.2.2) then this must

Virtual TreeView selection width with toUseExplorerTheme

隐身守侯 提交于 2019-11-30 13:55:19
When I use toUseExplorerTheme in TVirtualStringTree.PaintOptions it draws the selection like this: Notice that the selection extends from the left side of the control to the position of the rightmost extent of any node caption; the selections are all the same width. I want it to look as in this image ( someone else's project , using Virtual TreeView), where the selection covers only the text of the node caption: Unless there is a regression in Virtual TreeView (I'm using 5.2.2) then this must be possible, but I cannot find the right combination of options. Here's my set-up code: fTree :=

How to color blend cells with a background image in VirtualTreeView?

眉间皱痕 提交于 2019-11-30 09:48:57
I'm using VT.Background to display a background image in VT with a few columns. But I can't find a way to use different colors for cells because they hide the background image. I have tried to use OnBeforeItemErase but if I use EraseAction := eaColor the background bitmap area on the cell is also being painted, if I use eaDefault the color is not being applied. Any idea how this can be done? Just an attempt to guess if that's what you are looking for: Update: Added a color blending function for non MMX CPU machines. procedure ColorBlend(const ACanvas: HDC; const ARect: TRect; const ABlendColor

How do you drag and drop a file from Explorer Shell into a VirtualTreeView control in a Delphi application?

♀尐吖头ヾ 提交于 2019-11-30 07:25:15
There is extensive drag and drop support in VirtualTreeView by Mike Lischke, and I am using TVirtualStringTree, which has some on-drag-and-drop events, but I can not figure out how to get it to accept a shell drag-and-drop of some files from the windows explorer shell, into my application. I want to load the files, when they are dragged onto the drop control. I tried using a third-party set of code from Anders Melander, to handle drag and drop, but because VirtualTreeView already registers itself as a drop target, I can't use that. edit: I found a simple workaround: Turn off toAcceptOLEDrop in

How to color blend cells with a background image in VirtualTreeView?

非 Y 不嫁゛ 提交于 2019-11-29 15:21:00
问题 I'm using VT.Background to display a background image in VT with a few columns. But I can't find a way to use different colors for cells because they hide the background image. I have tried to use OnBeforeItemErase but if I use EraseAction := eaColor the background bitmap area on the cell is also being painted, if I use eaDefault the color is not being applied. Any idea how this can be done? 回答1: Just an attempt to guess if that's what you are looking for: Update: Added a color blending

Delphi, VirtualStringTree - classes (objects) instead of records

泄露秘密 提交于 2019-11-29 10:15:47
问题 I need to use a class instead of record for VirtualStringTree node. Should I declare it standard (but in this case - tricky) way like that: PNode = ^TNode; TNode = record obj: TMyObject; end; //.. var fNd: PNode; begin fNd:= vstTree.getNodeData(vstTree.AddChild(nil)); fNd.obj:= TMyObject.Create; //.. or should I use directly TMyObject ? If so - how?! How about assigning (constructing) the object and freeing it? Thanks in advance m. 回答1: Setup datasize for holding object vstTree.NodeDataSize :

Tree-like Datastructure (for use with VirtualTreeview)

微笑、不失礼 提交于 2019-11-29 02:44:47
I have come to the point where I need to stop storing my data in a VCL component, and have an "underlying datastructure", as Mr. Rob Kennedy suggested. First of all, this question is about "how do I make an underlying datastructure". :) My hierachy consists of 2 levels of nodes. Right now, I go thru my stuff by looping rootnodes, wherein I loop thru the rootnode's childnodes, to get what I need (Data). I would love to be able to store all my data in a so-called Underlying Datastructure, so that I can easily modify the entries using threads (I suppose I am able to do that?) However, when