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
IRC channel
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
Threads - stringlist and ...
by
Warfley
[
Today
at 10:23:41 pm]
Tips for deep debuging of...
by
Martin_fr
[
Today
at 10:14:09 pm]
How to use customize outp...
by
Martin_fr
[
Today
at 09:52:29 pm]
Fpcupdeluxe
by
Awkward
[
Today
at 08:56:04 pm]
LAMW - simple esc/POS pri...
by
jmpessoa
[
Today
at 08:40:57 pm]
Are We Dead Yet?
by
jmpessoa
[
Today
at 08:30:58 pm]
MemDataset validate not d...
by
eldonfsr
[
Today
at 07:02:49 pm]
New version of BGRABitmap
by
circular
[
Today
at 05:18:09 pm]
first generic attempt
by
Paolo
[
Today
at 04:59:25 pm]
Best way to delete an ins...
by
Handoko
[
Today
at 04:46:46 pm]
Bluetooth on Raspberry, d...
by
pascalbythree
[
Today
at 04:21:35 pm]
Online Package Manager
by
GetMem
[
Today
at 03:54:17 pm]
Non-local goto example ne...
by
alpine
[
Today
at 01:56:19 pm]
Can't load because <x> de...
by
marcov
[
Today
at 01:23:43 pm]
Hole punching - Step by S...
by
nummer8
[
Today
at 12:04:20 pm]
Providing *.deb files for...
by
TRon
[
Today
at 11:49:40 am]
Insert variant array to e...
by
TRon
[
Today
at 11:36:03 am]
Load local HTML file into...
by
c4p
[
Today
at 10:27:28 am]
ZenGL +android + MacOS Co...
by
Seenkao
[
Today
at 02:34:38 am]
[SOLVED] Using high inste...
by
lagprogramming
[May 27, 2023, 07:50:48 pm]
LAMW - default manifest r...
by
jmpessoa
[May 27, 2023, 07:25:21 pm]
Improvements in rtl/objpa...
by
PascalDragon
[May 27, 2023, 06:35:26 pm]
Optimization of for loops...
by
lagprogramming
[May 27, 2023, 03:56:09 pm]
How to download a file fr...
by
maurobio
[May 27, 2023, 02:58:43 pm]
Solved- TSQLQuery.ExecSQL...
by
br4d
[May 27, 2023, 02:26:56 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Change in TreeView (treeview.inc) (Read 4053 times)
jcmontherock
Full Member
Posts: 184
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
wp
Hero Member
Posts: 10847
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: 8853
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: 2113
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
Full Member
Posts: 184
Re: Change in TreeView (treeview.inc)
«
Reply #4 on:
November 27, 2021, 03:45:45 pm »
Fine, it's more better...
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Miscellaneous
»
Suggestions
»
Change in TreeView (treeview.inc)
TinyPortal
© 2005-2018