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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Extended ascii characters...
by
Lauriet
[
Today
at 07:56:40 am]
TStringList with .Count m...
by
d2010
[
Today
at 07:51:08 am]
How can I hide an annoyin...
by
dpap
[
Today
at 07:48:50 am]
Error: Internal error: Fa...
by
Khrys
[
Today
at 07:10:47 am]
libTIFF for Lazarus - rea...
by
Packs
[
Today
at 06:55:58 am]
Focus return does not wor...
by
7bit
[
Today
at 06:51:34 am]
How to use the LazarusIDE...
by
fcb
[
Today
at 04:54:00 am]
ThemeServices.DrawText in...
by
regs
[
Today
at 02:59:00 am]
Hively Library
by
Guva
[
Today
at 02:49:04 am]
Where do I get IdHTTP, ...
by
Remy Lebeau
[
Today
at 02:07:51 am]
Problems with calling ffm...
by
jianwt
[
Today
at 01:41:24 am]
IDE does not compile anym...
by
TRon
[February 16, 2025, 10:54:03 pm]
libRAW for Lazarus - read...
by
MarkMLl
[February 16, 2025, 10:05:40 pm]
I've written a program
by
MarkMLl
[February 16, 2025, 09:56:45 pm]
Treeview: full-width back...
by
d7_2_laz
[February 16, 2025, 08:53:21 pm]
MyLangEdit 2.0 for editin...
by
CM630
[February 16, 2025, 08:15:16 pm]
Interoperability between ...
by
setghm
[February 16, 2025, 07:29:12 pm]
[SOLVED] Form not showing...
by
Axessible
[February 16, 2025, 06:40:22 pm]
Can't find unit unixsocke...
by
TCH
[February 16, 2025, 06:28:48 pm]
LZ4 Compression and Decom...
by
Tomxe
[February 16, 2025, 05:22:02 pm]
SWP Simple Web Player.
by
Fred vS
[February 16, 2025, 05:16:13 pm]
OnGuard troubles with TOg...
by
wp
[February 16, 2025, 05:07:48 pm]
A circular / ring buffer ...
by
Thaddy
[February 16, 2025, 05:04:47 pm]
Source code explorer - te...
by
erol
[February 16, 2025, 05:04:05 pm]
Problems with anchors in ...
by
simsee
[February 16, 2025, 04:40:13 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Change in TreeView (treeview.inc) (Read 4790 times)
jcmontherock
Sr. Member
Posts: 278
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.0RC2-64 - FPC 3.2.2
wp
Hero Member
Posts: 12615
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: 10833
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
From the wiki:
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
AlexTP
Hero Member
Posts: 2527
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: 278
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.0RC2-64 - FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
Change in TreeView (treeview.inc)
TinyPortal
© 2005-2018