tvirtualstringtree

How to set the color of VirtualStringTree header?

拜拜、爱过 提交于 2019-12-06 17:41:43
问题 The VirtualStringTree header has a 'Background' property but setting it to a different color does not change the color. I suspect the tree is rendered using Windows themes. How can I set the color? 回答1: You can use property THeader.Background but you'll have to exclude toThemeAware from TreeOptions.PaintOptions . That would turn off themes, as TLama already said in his comment above. I recommend you to use the events OnAdvancedHeaderDraw and OnHeaderDrawQueryElements . hoOwnerDraw has to be

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

情到浓时终转凉″ 提交于 2019-12-06 04:53:09
问题 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

Color VirtualStringTree rows with hidden nodes

三世轮回 提交于 2019-12-05 18:19:11
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. There is no such method to get visibility node index at this time. But you can make your own where you will iterate through the visible nodes and count each iteration.

VirtualStringTree Correct/recommended use

与世无争的帅哥 提交于 2019-12-05 01:05:38
问题 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

How to set the color of VirtualStringTree header?

别说谁变了你拦得住时间么 提交于 2019-12-04 21:09:40
The VirtualStringTree header has a 'Background' property but setting it to a different color does not change the color. I suspect the tree is rendered using Windows themes. How can I set the color? You can use property THeader.Background but you'll have to exclude toThemeAware from TreeOptions.PaintOptions . That would turn off themes, as TLama already said in his comment above. I recommend you to use the events OnAdvancedHeaderDraw and OnHeaderDrawQueryElements . hoOwnerDraw has to be included in Header.Options for them to take effect. In OnHeaderDrawQueryElements you set Elements to (at

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

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 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

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 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