Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] VirtualStringTree icons
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Program experiencing runt...
by
Cainnech
[
Today
at 03:48:11 pm]
Lazarus Bugfix Release 4....
by
wp
[
Today
at 03:35:18 pm]
If FileExists(
by
Bart
[
Today
at 02:18:50 pm]
Interesting video
by
440bx
[
Today
at 10:54:16 am]
IndySecOpenSSL is now ava...
by
LeP
[
Today
at 10:22:50 am]
TDWEdit
by
Ed78z
[
Today
at 10:20:58 am]
Strange Behaviour at Runt...
by
andrew Bubble
[
Today
at 09:54:40 am]
FPC Debug mode releases [...
by
Martin_fr
[
Today
at 09:22:25 am]
Implementing an Elo ratin...
by
paule32
[
Today
at 08:43:20 am]
Death of the Power User
by
wp
[
Today
at 01:29:18 am]
how to add a ForEach call...
by
mas steindorff
[June 11, 2026, 11:42:24 pm]
How to define a type of ...
by
PascalDragon
[June 11, 2026, 09:24:45 pm]
Gitlab site history date.
by
Martin_fr
[June 11, 2026, 08:46:17 pm]
Arkanoid
by
lazarusprogrammer
[June 11, 2026, 08:14:21 pm]
[New Component] ExtTabCtr...
by
d7_2_laz
[June 11, 2026, 05:01:49 pm]
Conscious Artificial Inte...
by
schuler
[June 11, 2026, 04:39:11 pm]
Pdf Viewer in Pascal
by
Tomxe
[June 11, 2026, 03:52:37 pm]
Eye Candy TESCheme
by
Dzandaa
[June 11, 2026, 11:51:52 am]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[June 11, 2026, 11:35:42 am]
I found an actual use for...
by
marcov
[June 11, 2026, 11:35:23 am]
Who can explain this ?
by
J-G
[June 11, 2026, 11:30:42 am]
XLibre, finally and fortu...
by
Fred vS
[June 11, 2026, 06:20:26 am]
WEBP, no DLLs
by
Tomxe
[June 11, 2026, 04:04:37 am]
Discipline your AI coding...
by
440bx
[June 11, 2026, 02:44:06 am]
Version 4.8 was recently ...
by
Ten_Mile_Hike
[June 11, 2026, 01:43:17 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] VirtualStringTree icons (Read 947 times)
Pe3s
Hero Member
Posts: 647
[SOLVED] VirtualStringTree icons
«
on:
March 04, 2023, 06:33:26 pm »
Hello forum users, I wrote a code that displays icons in VST. How can I modify the code to add a different icon to the child?
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
VSTGetImageIndex
(
Sender
:
TBaseVirtualTree
;
Node
:
PVirtualNode
;
Kind
:
TVTImageKind
;
Column
:
TColumnIndex
;
var
Ghosted
:
Boolean
;
var
ImageIndex
:
Integer
)
;
begin
case
Kind
of
ikNormal
,
ikSelected
:
case
Column
of
0
:
ImageIndex
:
=
0
;
end
;
end
;
end
;
«
Last Edit: March 04, 2023, 08:16:57 pm by Pe3s
»
Logged
paweld
Hero Member
Posts: 1639
Re: VirtualStringTree icons
«
Reply #1 on:
March 04, 2023, 06:56:50 pm »
something like this:
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
VSTGetImageIndex
(
Sender
:
TBaseVirtualTree
;
Node
:
PVirtualNode
;
Kind
:
TVTImageKind
;
Column
:
TColumnIndex
;
var
Ghosted
:
Boolean
;
var
ImageIndex
:
Integer
)
;
var
nl
:
Integer
;
begin
nl
:
=
Sender
.
GetNodeLevel
(
Node
)
;
case
nl
of
0
:
ImageIndex
:
=
0
;
//root
1
..
3
:
ImageIndex
:
=
1
;
//child level between 1 and 3
4
..
6
:
ImageIndex
:
=
2
;
//etc.
end
;
end
;
Logged
Best regards / Pozdrawiam
paweld
Pe3s
Hero Member
Posts: 647
Re: VirtualStringTree icons
«
Reply #2 on:
March 04, 2023, 07:14:21 pm »
Everything would be ok if there were no duplicate icons
Logged
paweld
Hero Member
Posts: 1639
Re: VirtualStringTree icons
«
Reply #3 on:
March 04, 2023, 07:23:31 pm »
You need to add a column condition
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
VSTGetImageIndex
(
Sender
:
TBaseVirtualTree
;
Node
:
PVirtualNode
;
Kind
:
TVTImageKind
;
Column
:
TColumnIndex
;
var
Ghosted
:
Boolean
;
var
ImageIndex
:
Integer
)
;
var
nl
:
Integer
;
begin
if
Column
=
0
then
begin
nl
:
=
Sender
.
GetNodeLevel
(
Node
)
;
case
nl
of
0
:
ImageIndex
:
=
0
;
//root
1
..
3
:
ImageIndex
:
=
1
;
//child level between 1 and 3
4
..
6
:
ImageIndex
:
=
2
;
//etc.
end
;
end
;
end
;
Logged
Best regards / Pozdrawiam
paweld
Pe3s
Hero Member
Posts: 647
Re: VirtualStringTree icons
«
Reply #4 on:
March 04, 2023, 08:16:40 pm »
@paweld Thank you
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] VirtualStringTree icons
TinyPortal
© 2005-2018