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.

TreeViews in PB 8

6 posts in Objects Last posting was on 2002-07-27 04:30:03.0Z
Dave_Lloyd Posted on 2002-07-26 16:14:45.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Dave_Lloyd
Date: Fri, 26 Jul 2002 12:14:45 -0400
Subject: TreeViews in PB 8
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1072
Article PK: 713637

We have migrated a large application from PB 6.5 to PB 8.0.

We have found a problem with TreeViews that did not happen in 6.5.

We have a Treeview that sits on a User object. There is a refresh event
that should get the current node and refresh it from the Database.

In 6.5 this works fine. However after migrating it does not work anymore.
If you refresh the children items are remove and the node you refreshed
sit's there with a minus sign next to it. There is no way to get the
children back.

We have noticed other strange behaviour with the treeview. For example when
you select an item on the tree view we make it bold. When you select
another the original remains bolded.

I have pasted the code we use for refresh below.

long ll_handle, &
ll_child, &
ll_messagetopass
u_frm_tv ltv_del
treeviewitem ltvi_refresh
int li_rc

ltv_del = of_getactivetree()
ltv_del.setredraw(false)
ll_handle = ltv_del.finditem(currentTreeItem!,0)
ll_child = ltv_del.finditem(childTreeItem!,ll_handle)

ltv_del.getitem(ll_handle, ltvi_refresh)
do while ll_child > 0 and ll_handle >= 0
ll_child = ltv_del.finditem(childTreeItem!,ll_handle)
ltv_del.deleteitem(ll_child)
loop

ltvi_refresh.Children = True
ltv_del.setitem(ll_handle,ltvi_refresh)

if ltvi_refresh.expanded = True then
ltv_del.hideselection = false
ltv_del.collapseitem(ll_handle)
li_rc = ltv_del.expanditem(ll_handle)
end if

ltv_del.setredraw(true)


Dave_Lloyd Posted on 2002-07-26 16:47:17.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Dave_Lloyd
Date: Fri, 26 Jul 2002 12:47:17 -0400
Subject: Re: TreeViews in PB 8
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums>
References: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1071
Article PK: 713634

I have narrowed the problem down a little.

Events don't seem to be fired properly in PB 8.0

We have code in the itemexpanding which loads the data back in after a
refresh.

This even is never fired.

Does tv.expanditem(ll_handle) not fire this event.

If anyone knows how to fix this or work around it please let me know.

Thanks in advance for any help in this matter.
Dave


Bug Posted on 2002-07-26 18:16:37.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bug" <fenterbug@hotmail.com>
Subject: Re: TreeViews in PB 8
Date: Fri, 26 Jul 2002 13:16:37 -0500
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
NNTP-Posting-Host: 206.66.2.100
Message-ID: <364_Hi1GDJNNCHA.196@forums.sybase.com>
References: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums> <364_AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1070
Article PK: 713632

tv.expanditem (ll_handle)
tv.event trigger itemexpanding (ll_handle)

--
Jason 'Bug' Fenter
Best Dern Programmer Out There
fenterbug_at_hotmail_dot_com

<Dave_Lloyd> wrote in message
news:AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums...
> I have narrowed the problem down a little.
>
> Events don't seem to be fired properly in PB 8.0
>
> We have code in the itemexpanding which loads the data back in after a
> refresh.
>
> This even is never fired.
>
> Does tv.expanditem(ll_handle) not fire this event.
>
> If anyone knows how to fix this or work around it please let me know.
>
> Thanks in advance for any help in this matter.
> Dave


Dave_Lloyd Posted on 2002-07-26 19:14:13.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Dave_Lloyd
Date: Fri, 26 Jul 2002 15:14:13 -0400
Subject: Re: TreeViews in PB 8
Lines: 11
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_2087AF41D59526FB0069AC0D85256C02.0067DA1985256C02@webforums>
References: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums> <364_AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums> <364_Hi1GDJNNCHA.196@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:1069
Article PK: 713635

Thanks for your response.

Your solution works. But it doesn't solve the problem.

In PB 6.5 the expanditem function fired the itemexpanding event. Now it
doesn't.

Has anyone heard mention of a fix for this.

Dave


Bug Posted on 2002-07-26 21:07:45.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bug" <fenterbug@hotmail.com>
Subject: Re: TreeViews in PB 8
Date: Fri, 26 Jul 2002 16:07:45 -0500
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
NNTP-Posting-Host: 206.66.2.100
Message-ID: <364_JlPnqoONCHA.196@forums.sybase.com>
References: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums> <364_AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums> <364_Hi1GDJNNCHA.196@forums.sybase.com> <364_2087AF41D59526FB0069AC0D85256C02.0067DA1985256C02@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1068
Article PK: 713626

I haven't, but I think I may know the cause. PB 6.5 used a custom control as
a treeview. With PB7, they started implementing the Microsoft common
treeview control instead. (In PB7+, all controls are based on the MS common
controls.) That difference is probably responsible for the change in
behavior.

--
Jason 'Bug' Fenter
Best Dern Programmer Out There
fenterbug_at_hotmail_dot_com

<Dave_Lloyd> wrote in message
news:2087AF41D59526FB0069AC0D85256C02.0067DA1985256C02@webforums...
> Thanks for your response.
>
> Your solution works. But it doesn't solve the problem.
>
> In PB 6.5 the expanditem function fired the itemexpanding event. Now it
> doesn't.
>
> Has anyone heard mention of a fix for this.
>
> Dave
>


Edward Muesch Posted on 2002-07-27 04:30:03.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Edward Muesch" <emuesch_AT_hotmail_DOT_com>
Subject: Re: TreeViews in PB 8
Date: Sat, 27 Jul 2002 00:30:03 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: vzw-166-152-11-145.airbridge.net 166.152.11.145
Message-ID: <364_7tHaygSNCHA.196@forums.sybase.com>
References: <364_A795FA35AFFBAEB200593DCF85256C02.00593DF985256C02@webforums> <364_AC3A9EB298297335005C384A85256C02.005A575485256C02@webforums> <364_Hi1GDJNNCHA.196@forums.sybase.com> <364_2087AF41D59526FB0069AC0D85256C02.0067DA1985256C02@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:1066
Article PK: 713628

As Bug said, the Treeview (and Listview) objects have changed from PB
implementstions to the standard Microsoft Windows controls. I found an
explination from Sybase and have pasted it below.

--- Begin Excerpt ---

ListView and TreeView controls events changed
---------------------------------------------
PowerBuilder 7 and later use Microsoft ListView and TreeView controls.
As a result, you may see some changes in behavior that require you to
remap some events. When you perform mouse actions, some events do not
fire, and some fire in a different order from previous releases.

TreeView
--------
In PowerBuilder 7 and later, the pbm_rbuttonup event does not fire,
but is immediately followed by a pbm_tvnrclicked (the 'stock'
RightClicked! event for a TreeView). Therefore, you can copy any code
from pbm_rbuttonup to RightClicked! or have the RightClicked! event
trigger whatever code exists in the pbm_rbuttonup. If you trigger
the code, keep in mind that in PowerBuilder 6 BOTH pbm_rbuttonup and
pbm_tvnrclicked fire. To make this code work in PowerBuilder 6 as
well as 7 or later, you should make sure the code is executed only
once in PowerBuilder 6. For example, you could set a boolean variable
in pbm_rbuttonup that prevents the code in pbm_tvnrclicked from
executing if the variable is TRUE. You would then reset the variable
to FALSE at the end of pbm_tvnrclicked.

Additionally, in PowerBuilder 7 and later, using the right mouse
button to select a previously unselected TreeView item causes the
previous TreeView item to regain focus when the button is released.
In PowerBuilder 6, using the right mouse button to select a TreeView
item caused it to become 'permanently' selected. To duplicate this
behavior in PowerBuilder 7 and later, place the line of code
this.SelectItem(handle) in the RightClicked! event of the TreeView
before triggering (or otherwise executing) code from the
pbm_rbuttonup event.

In PowerBuilder 7 and later, the pbm_tvnrdoubleclick (the 'stock'
RightDoubleClicked! event) does not fire but is immediately preceded
by a pbm_rbuttondblclk event. Therefore, you can copy any code from
the RightDoubleClicked! event to the pbm_rbuttondblclk event or have
the pbm_rbuttondblclk event trigger existing code in the
RightDoubleClicked! event. Again, both events fire in PowerBuilder 6,
so you will need to use a technique similar to that described above
to achieve version-independent code. [CR 215628]

--- End Excerpt ---

HTH

-EGM

<Dave_Lloyd> wrote in message
news:2087AF41D59526FB0069AC0D85256C02.0067DA1985256C02@webforums...
> Thanks for your response.
>
> Your solution works. But it doesn't solve the problem.
>
> In PB 6.5 the expanditem function fired the itemexpanding event. Now it
> doesn't.
>
> Has anyone heard mention of a fix for this.
>
> Dave
>