Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
Change in TreeView (treeview.inc)
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
Hint not being shown
by
J-G
[
Today
at 03:34:25 pm]
Portable verion of FPC an...
by
Martin_fr
[
Today
at 02:34:35 pm]
embed .jpg file into .pp ...
by
cdbc
[
Today
at 02:22:50 pm]
UnoLib - library in Pasca...
by
ackarwow
[
Today
at 02:16:15 pm]
[New Component] ExtTabCtr...
by
wp
[
Today
at 01:52:10 pm]
Splitting Picture into Qu...
by
ADMGNS
[
Today
at 01:16:55 pm]
Lazarus 4.99 - New featur...
by
zeljko
[
Today
at 12:24:18 pm]
Lazarus Main and Gnome/Wa...
by
zeljko
[
Today
at 12:19:20 pm]
Knigo
by
Guva
[
Today
at 11:38:57 am]
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 10:44:12 am]
GDB 17 for Windows
by
Martin_fr
[
Today
at 10:05:07 am]
Very rough version of a s...
by
hedgehog
[
Today
at 08:24:00 am]
Release ray4laz 6.0
by
Guva
[
Today
at 07:45:39 am]
water filling simulation
by
ADMGNS
[June 06, 2026, 09:54:50 pm]
Array of structure -> str...
by
Seenkao
[June 06, 2026, 09:44:44 pm]
TStringGrid Question
by
J-G
[June 06, 2026, 08:05:52 pm]
Benchmark: converting arr...
by
LemonParty
[June 06, 2026, 03:25:25 pm]
Read/Parse PDB file to ge...
by
marcov
[June 06, 2026, 02:48:12 pm]
[SOVLED]Curved text in La...
by
paweld
[June 06, 2026, 11:00:52 am]
Fast Canvas Library V1.05...
by
microxa
[June 06, 2026, 07:03:07 am]
"Identifier idents no mem...
by
Thaddy
[June 06, 2026, 05:43:52 am]
[SOLVED] TPrintDialog Pro...
by
spuds
[June 06, 2026, 01:30:20 am]
TPairsplitter could be be...
by
jamie
[June 06, 2026, 12:36:34 am]
FloatToStr issue
by
J-G
[June 06, 2026, 12:06:38 am]
Pascal for AI Agent CLI T...
by
Martin_fr
[June 05, 2026, 08:01:11 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Change in TreeView (treeview.inc) (Read 5233 times)
jcmontherock
Sr. Member
Posts: 355
Change in TreeView (treeview.inc)
«
on:
November 27, 2021, 12:06:11 pm »
Hello,
I suggest a little change in the function FindNodeWithText:
Change:
Code: Pascal
[Select]
[+]
[-]
function
TTreeNodes
.
FindNodeWithText
(
const
NodeText
:
string
)
:
TTreeNode
;
begin
Result
:
=
GetFirstNode
;
while
Assigned
(
Result
)
and
(
Result
.
Text
<> NodeText
)
do
Result
:
=
Result
.
GetNext
;
end
;
To:
Code: Pascal
[Select]
[+]
[-]
function
TTreeNodes
.
FindNodeWithText
(
StrtIndex
:
Integer
=
0
;
const
NodeText
:
string
)
:
TTreeNode
;
begin
Result
:
=
TreeView1
.
Items
[
StrtIndex
]
;
while
Assigned
(
Result
)
and
(
Result
.
Text
<> NodeText
)
do
Result
:
=
Result
.
GetNext
;
end
;
If you have 2 (or more) nodes with the same text with a different parent node, you cannot find the next one.
Logged
Windows 11 UTF8-64 - Lazarus 4.6-64 - FPC 3.2.2
wp
Hero Member
Posts: 13548
Re: Change in TreeView (treeview.inc)
«
Reply #1 on:
November 27, 2021, 12:49:45 pm »
Please post this in the bugtracker and mark it as feature request. The optional parameter must be at the end, though.
Logged
Martin_fr
Administrator
Hero Member
Posts: 12392
Debugger - SynEdit - and more
Re: Change in TreeView (treeview.inc)
«
Reply #2 on:
November 27, 2021, 01:12:08 pm »
Also, since it returns a TTreeNode, maybe it should take a TTreeNode as optional arg?
Code: Pascal
[Select]
[+]
[-]
function
TTreeNodes
.
FindNodeWithText
(
const
NodeText
:
string
;
ContinueAfterNode
:
TTreeNode
=
nil
)
:
TTreeNode
;
Just an idea.
Logged
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
AlexTP
Hero Member
Posts: 2713
Re: Change in TreeView (treeview.inc)
«
Reply #3 on:
November 27, 2021, 01:37:52 pm »
Martin, +1.
Logged
CudaText editor
-
ATSynEdit
-
More from me
jcmontherock
Sr. Member
Posts: 355
Re: Change in TreeView (treeview.inc)
«
Reply #4 on:
November 27, 2021, 03:45:45 pm »
Fine, it's more better...
Logged
Windows 11 UTF8-64 - Lazarus 4.6-64 - FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
Change in TreeView (treeview.inc)
TinyPortal
© 2005-2018