Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

best way to search in a TreeView ????

7 posts in Objects Last posting was on 2005-10-05 05:56:29.0Z
M.Erlinger Posted on 2005-10-04 23:15:17.0Z
From: "M.Erlinger" <michael.erlinger@vienna.at>
Newsgroups: sybase.public.powerbuilder.objects
Subject: best way to search in a TreeView ????
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 62.212.169.105
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <43430d05@forums-1-dub>
Date: 4 Oct 2005 16:15:17 -0700
X-Trace: forums-1-dub 1128467717 62.212.169.105 (4 Oct 2005 16:15:17 -0700)
X-Original-Trace: 4 Oct 2005 16:15:17 -0700, 62.212.169.105
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8652
Article PK: 735868

Hello

what's the best and fastest way to look for an item in a treeView?
i stored for all items the primary key in the data-property........

have anyone a clue or a sample for my problem
many thank's in advance
Michael


Roy Kiesler [TeamSybase] Posted on 2005-10-04 23:28:02.0Z
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: best way to search in a TreeView ????
References: <43430d05@forums-1-dub>
In-Reply-To: <43430d05@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: c-24-4-166-164.hsd1.ca.comcast.net
Message-ID: <43430f72$1@forums-2-dub>
X-Original-Trace: 4 Oct 2005 16:25:38 -0700, c-24-4-166-164.hsd1.ca.comcast.net
Lines: 21
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2005 16:25:40 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2005 16:28:02 -0700
X-Trace: forums-1-dub 1128468482 10.22.108.75 (4 Oct 2005 16:28:02 -0700)
X-Original-Trace: 4 Oct 2005 16:28:02 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!forums-2-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8653
Article PK: 735867


M.Erlinger wrote:
> Hello
>
> what's the best and fastest way to look for an item in a treeView?
> i stored for all items the primary key in the data-property........
>
> have anyone a clue or a sample for my problem
> many thank's in advance
> Michael
>
>

That's an age-old debate... take a look at something like this
(http://www.absoluteastronomy.com/encyclopedia/t/tr/tree_search_algorithm.htm)
then role up your sleeves and get ready to code.

You may also want to give PFC's n_cst_tree::of_find() method a look,
just in case.

--
Roy


M.Erlinger Posted on 2005-10-04 23:53:27.0Z
From: "M.Erlinger" <michael.erlinger@vienna.at>
Newsgroups: sybase.public.powerbuilder.objects
References: <43430d05@forums-1-dub> <43430f72$1@forums-2-dub>
Subject: Re: best way to search in a TreeView ????
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <43431567@forums-2-dub>
X-Original-Trace: 4 Oct 2005 16:51:03 -0700, 62.212.169.105
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2005 16:51:04 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2005 16:53:27 -0700
X-Trace: forums-1-dub 1128470007 10.22.108.75 (4 Oct 2005 16:53:27 -0700)
X-Original-Trace: 4 Oct 2005 16:53:27 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!forums-2-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8654
Article PK: 735869

Hello

my problem is the LOOP through the TreeView - here my example:
******************************************************
ll_Item = THIS.FindItem(RootTreeItem!, 0);

DO WHILE TRUE
ll_item = THIS.FindItem( NextVisibleTreeItem!, ll_Item );

// CHECK data from TreeViewItem.......if found EXIT.
LOOP
******************************************************

the loop - or the findItem( nextVisibleTreeItem......) don't work correct ?
i want loop througth the TreeView from RootItem beginning up to the last
Entry-Item - all nodes


thank's
Michael


Roy Kiesler [TeamSybase] Posted on 2005-10-05 01:15:56.0Z
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: best way to search in a TreeView ????
References: <43430d05@forums-1-dub> <43430f72$1@forums-2-dub> <43431567@forums-2-dub>
In-Reply-To: <43431567@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: c-24-4-166-164.hsd1.ca.comcast.net
X-Original-NNTP-Posting-Host: c-24-4-166-164.hsd1.ca.comcast.net
Message-ID: <4343294c$1@forums-1-dub>
Date: 4 Oct 2005 18:15:56 -0700
X-Trace: forums-1-dub 1128474956 24.4.166.164 (4 Oct 2005 18:15:56 -0700)
X-Original-Trace: 4 Oct 2005 18:15:56 -0700, c-24-4-166-164.hsd1.ca.comcast.net
Lines: 30
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8656
Article PK: 735870

What exactly do you mean by "don't work correct"? If you need a code
example of traversing a tree from root to leaf nodes, look at the PFC
tree of_print() method.

--
Roy

M.Erlinger wrote:
> Hello
>
> my problem is the LOOP through the TreeView - here my example:
> ******************************************************
> ll_Item = THIS.FindItem(RootTreeItem!, 0);
>
> DO WHILE TRUE
> ll_item = THIS.FindItem( NextVisibleTreeItem!, ll_Item );
>
> // CHECK data from TreeViewItem.......if found EXIT.
> LOOP
> ******************************************************
>
> the loop - or the findItem( nextVisibleTreeItem......) don't work correct ?
> i want loop througth the TreeView from RootItem beginning up to the last
> Entry-Item - all nodes
>
>
> thank's
> Michael
>
>


ss Posted on 2005-10-05 01:26:21.0Z
From: "ss" <serge_samson@yahoo.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <43430d05@forums-1-dub> <43430f72$1@forums-2-dub> <43431567@forums-2-dub>
Subject: Re: best way to search in a TreeView ????
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: modemcable234.254-201-24.mc.videotron.ca
Message-ID: <43432b2b$1@forums-2-dub>
X-Original-Trace: 4 Oct 2005 18:23:55 -0700, modemcable234.254-201-24.mc.videotron.ca
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2005 18:23:56 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2005 18:26:21 -0700
X-Trace: forums-1-dub 1128475581 10.22.108.75 (4 Oct 2005 18:26:21 -0700)
X-Original-Trace: 4 Oct 2005 18:26:21 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!forums-2-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8657
Article PK: 735873

Does this function help:

// Function of_find_in_TV (String itemname)
// this function select the itemname (tree itemname) in the treeview

treeviewitem l_tvinew
long ll_tvi
int r_c, li_count

// Count items in the TreeView control: tv_2
li_count = Send(handle(tv_2), 4357, 0, 0)

ll_tvi = tv_2.FindItem(RootTreeItem!, 0)
tv_2.GetItem(ll_tvi, l_tvinew)

do while string(l_tvinew.Label) <> itemname

ll_tvi = tv_2.FindItem(NextVisibleTreeItem! ,ll_tvi)
tv_2.GetItem(ll_tvi, l_tvinew)
if string(l_tvinew.Label) = itemname then

tv_2.SetFirstVisible(0)
tv_2.SelectItem(ll_tvi)
exit
end if

r_c ++

if r_c > li_count then exit

loop

Samson

"M.Erlinger" <michael.erlinger@vienna.at> wrote in message
news:43431567@forums-2-dub...
> Hello
>
> my problem is the LOOP through the TreeView - here my example:
> ******************************************************
> ll_Item = THIS.FindItem(RootTreeItem!, 0);
>
> DO WHILE TRUE
> ll_item = THIS.FindItem( NextVisibleTreeItem!, ll_Item );
>
> // CHECK data from TreeViewItem.......if found EXIT.
> LOOP
> ******************************************************
>
> the loop - or the findItem( nextVisibleTreeItem......) don't work correct
> ?
> i want loop througth the TreeView from RootItem beginning up to the last
> Entry-Item - all nodes
>
>
> thank's
> Michael
>


Philip Salgannik Posted on 2005-10-05 02:02:22.0Z
From: "Philip Salgannik" <philemaxNOSPAM@comcast.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <43430d05@forums-1-dub>
Subject: Re: best way to search in a TreeView ????
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: c-24-34-95-135.hsd1.ma.comcast.net
Message-ID: <4343339a$1@forums-2-dub>
X-Original-Trace: 4 Oct 2005 18:59:54 -0700, c-24-34-95-135.hsd1.ma.comcast.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2005 18:59:57 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2005 19:02:22 -0700
X-Trace: forums-1-dub 1128477742 10.22.108.75 (4 Oct 2005 19:02:22 -0700)
X-Original-Trace: 4 Oct 2005 19:02:22 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!forums-2-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8658
Article PK: 735872

Judging by the fact that you use PowerBuilder and mention "primary key", I
can assume that you populate the treeview from the database. If that's the
case you just need to have smart datastructures like datastores do the
population of the treeview and at the same time make those datastores
"remember" the item handles of the treeview that they populated.
This way you'll be searching the datastores using their methods instead of
traversing the treeview...

--
This is a FAQ, read Help, then search
www.groups.google.com/advanced_group_search

pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"M.Erlinger" <michael.erlinger@vienna.at> wrote in message
news:43430d05@forums-1-dub...
> Hello
>
> what's the best and fastest way to look for an item in a treeView?
> i stored for all items the primary key in the data-property........
>
> have anyone a clue or a sample for my problem
> many thank's in advance
> Michael
>


M.Erlinger Posted on 2005-10-05 05:56:29.0Z
From: "M.Erlinger" <michael.erlinger@vienna.at>
Newsgroups: sybase.public.powerbuilder.objects
References: <43430d05@forums-1-dub> <4343339a$1@forums-2-dub>
Subject: Re: best way to search in a TreeView ????
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: 62.212.169.105
Message-ID: <43436a77$1@forums-2-dub>
X-Original-Trace: 4 Oct 2005 22:53:59 -0700, 62.212.169.105
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2005 22:54:02 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2005 22:56:29 -0700
X-Trace: forums-1-dub 1128491789 10.22.108.75 (4 Oct 2005 22:56:29 -0700)
X-Original-Trace: 4 Oct 2005 22:56:29 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!forums-2-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8659
Article PK: 735874

thank's for your help!!
Michael


"Philip Salgannik" <philemaxNOSPAM@comcast.net> schrieb im Newsbeitrag
news:4343339a$1@forums-2-dub...

> Judging by the fact that you use PowerBuilder and mention "primary key", I
> can assume that you populate the treeview from the database. If that's the
> case you just need to have smart datastructures like datastores do the
> population of the treeview and at the same time make those datastores
> "remember" the item handles of the treeview that they populated.
> This way you'll be searching the datastores using their methods instead of
> traversing the treeview...
>
> --
> This is a FAQ, read Help, then search
> www.groups.google.com/advanced_group_search
>
> pbm_thisusuallydoesnothelp:-))
> Philip Salgannik
>
> "M.Erlinger" <michael.erlinger@vienna.at> wrote in message
> news:43430d05@forums-1-dub...
>> Hello
>>
>> what's the best and fastest way to look for an item in a treeView?
>> i stored for all items the primary key in the data-property........
>>
>> have anyone a clue or a sample for my problem
>> many thank's in advance
>> Michael
>>
>
>