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.

Disable selection of Treevew Items with keyboard

3 posts in Objects Last posting was on 2007-08-01 18:42:16.0Z
Sreerama Posted on 2007-08-01 17:59:04.0Z
Sender: 6fde.46a712da.1804289383@sybase.com
From: Sreerama
Newsgroups: sybase.public.powerbuilder.objects
Subject: Disable selection of Treevew Items with keyboard
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46b0c9e8.7e07.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Aug 2007 10:59:04 -0700
X-Trace: forums-1-dub 1185991144 10.22.241.41 (1 Aug 2007 10:59:04 -0700)
X-Original-Trace: 1 Aug 2007 10:59:04 -0700, 10.22.241.41
Lines: 7
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9393
Article PK: 736552

Hi,

Can someone let me know, how can i disable selection of
items in a treeview with Keyboard.

Thanks...
Sreeram.


Chris Werner Posted on 2007-08-01 18:23:56.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.objects
References: <46b0c9e8.7e07.1681692777@sybase.com>
Subject: Re: Disable selection of Treevew Items with keyboard
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: 62.8.156.42
X-Original-NNTP-Posting-Host: 62.8.156.42
Message-ID: <46b0cfbc$1@forums-1-dub>
Date: 1 Aug 2007 11:23:56 -0700
X-Trace: forums-1-dub 1185992636 62.8.156.42 (1 Aug 2007 11:23:56 -0700)
X-Original-Trace: 1 Aug 2007 11:23:56 -0700, 62.8.156.42
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9394
Article PK: 736548

Hi Sreeram,

if you return 1 in the selectionChanging event of a treeView
control, the selection is prevented from changing. Of course
you have to differentiate what caused the selection to change.
So I'd declare a boolean instance variable

BOOLEAN ib_selChangeAllowed=false

In the selectionChanging event I'd code:

long ll_ret
if ib_selChangeAllowed then
ll_ret = 0
else
ll_ret = 1
end if
return ll_ret

Now I'd implement a function long of_changeSel(long al_handle):

long ll_ret
ib_selChangeAllowed = true
ll_ret = selectItem(al_handle)
ib_selChangeAllowed = false
return ll_ret

In the clicked event (and on other places where I like the
selection to change I'd call of_changeSel():

long ll_ret
if handle > 0 then
ll_ret = of_changeSel(handle)
end if

Although I haven't tested that I assume it shows a way to
achieve what you're after.

Chris Werner
f+s software gmbh



<Sreerama> schrieb im Newsbeitrag
news:46b0c9e8.7e07.1681692777@sybase.com...

> Hi,
>
> Can someone let me know, how can i disable selection of
> items in a treeview with Keyboard.
>
> Thanks...
> Sreeram.


Sreerama Posted on 2007-08-01 18:42:16.0Z
Sender: 6fde.46a712da.1804289383@sybase.com
From: Sreerama
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Disable selection of Treevew Items with keyboard
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <46b0d408.7f1e.1681692777@sybase.com>
References: <46b0cfbc$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Aug 2007 11:42:16 -0700
X-Trace: forums-1-dub 1185993736 10.22.241.41 (1 Aug 2007 11:42:16 -0700)
X-Original-Trace: 1 Aug 2007 11:42:16 -0700, 10.22.241.41
Lines: 70
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9395
Article PK: 736551

Hi Chris,

Thanks a lot. Its working.

Selection through keyboard do not work for PB5 based
application.
But, it works for PB9.

I thought there would be a property of TreeView object
setting which, we could achieve this.

Thanks...
Sreeram.

> Hi Sreeram,
>
> if you return 1 in the selectionChanging event of a
> treeView control, the selection is prevented from
> changing. Of course you have to differentiate what caused
> the selection to change. So I'd declare a boolean instance
> variable
>
> BOOLEAN ib_selChangeAllowed=false
>
> In the selectionChanging event I'd code:
>
> long ll_ret
> if ib_selChangeAllowed then
> ll_ret = 0
> else
> ll_ret = 1
> end if
> return ll_ret
>
> Now I'd implement a function long of_changeSel(long
> al_handle):
>
> long ll_ret
> ib_selChangeAllowed = true
> ll_ret = selectItem(al_handle)
> ib_selChangeAllowed = false
> return ll_ret
>
> In the clicked event (and on other places where I like the
> selection to change I'd call of_changeSel():
>
> long ll_ret
> if handle > 0 then
> ll_ret = of_changeSel(handle)
> end if
>
> Although I haven't tested that I assume it shows a way to
> achieve what you're after.
>
> Chris Werner
> f+s software gmbh
>
>
>
> <Sreerama> schrieb im Newsbeitrag
> news:46b0c9e8.7e07.1681692777@sybase.com...
> > Hi,
> >
> > Can someone let me know, how can i disable selection of
> > items in a treeview with Keyboard.
> >
> > Thanks...
> > Sreeram.
>
>