Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to trap downarrow key and uparrow key on dropdown dat

750 views
Skip to first unread message

Lucky

unread,
Jan 22, 2002, 6:43:53 PM1/22/02
to
hi All

How to trap down arrow key and uparrow key on dropdown datawindow column when
focus on it?

Thanks

Lucky


---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Boris Gasin [TeamSybase]

unread,
Jan 22, 2002, 6:39:17 PM1/22/02
to
On Tue, 22 Jan 2002 18:43:53 -0500, "Lucky" <lucky...@yahoo.com>
wrote:

>hi All
>
>How to trap down arrow key and uparrow key on dropdown datawindow column when
>focus on it?

Lucky,

Are you looking for something similar to the DDDW rowfocuschanged
event?

In any case you can get to a lot of DDDW events through the
pbm_command event on the parent datawindow.


iDDDWHandle = Handle ( dwc )

ue_command mapped to pbm_command
=========

IF hwndchild = iDDDWHandle THEN
CHOOSE CASE notificationcode
CASE 2048 // or 2049
// DDDW RowFocusChanged
CASE 1281
// DDDW Clicked
CASE 2314
// DDDW RightMouseButtonDown
CASE 2313
// DDDW LeftMouseButtonUp
CASE 2317
// DDDW VScroll
CASE 2318
// DDDW HScroll
CASE 2311
// DDDW Mouse Move
CASE 769
// DDDW Retrieve End
END CHOOSE
END IF

--

Boris Gasin [TeamSybase]
mailto:bga...@dynamictechgroup.com

Close to NJ? Join the NJ Sybase Tools User Group
http://www.njpbug.org/njpbug/join/join.asp

Simon Caldwell [TeamSybase]

unread,
Jan 23, 2002, 5:21:54 AM1/23/02
to
The ItemChanged event will fire.

--

Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel +44 (0)1904 481999 Fax +44 (0)1904 481666
Visit us at www.getrealsystems.com
Procurement Control Specialists
Controlling corporate spend and streamlining procurement processes


"Lucky" <lucky...@yahoo.com> wrote in message
news:UMLJm65...@forums.sybase.com...

Lucky

unread,
Jan 23, 2002, 12:44:59 PM1/23/02
to
On Tue, 22 Jan 2002 18:39:17 -0500,
in powersoft.public.powerbuilder.datawindow

Thanks for this good code. But I have different problem , I need to trap up/down
arrow key on dddw.

I have big PB application which run on T1 lines , 56 k lines and also on dial up
connection . Application running fine on T1 lines but on 56 k and on dials up
connection it slow and performance is not good. One of the problem is dropdown
datawindow. Some times dddw have 50 , 100 or more rows.

So we come to solution that first time don’t retrieve all row in dddw ,
retrieve only one record. When user click on dddw or up/down arrow key then
retrieve all the rows or what ever “where clause” is .

I trap click event and all other keys. But not able to trap up/down arrow key
on dddw. The code which you sent is very good code and working too , but for
other events. Could you give full list of “notificationcode” or where I can I
get these code?

Or could you suggest me any other way to trap up/down arrow key on dddw ?

I meet you three years back in San Francisco user group meeting. You did
presentation on PFC , was very good. It been long , probably you don’t remember.
Any ways thanks for help.

Boris Gasin [TeamSybase]

unread,
Jan 23, 2002, 2:41:29 PM1/23/02
to
On Wed, 23 Jan 2002 12:44:59 -0500, "Lucky" <lucky...@yahoo.com>
wrote:

>
>Thanks for this good code. But I have different problem , I need to trap up/down
>arrow key on dddw.
>
>I have big PB application which run on T1 lines , 56 k lines and also on dial up
>connection . Application running fine on T1 lines but on 56 k and on dials up
>connection it slow and performance is not good. One of the problem is dropdown
>datawindow. Some times dddw have 50 , 100 or more rows.
>
>So we come to solution that first time don’t retrieve all row in dddw ,
>retrieve only one record. When user click on dddw or up/down arrow key then
>retrieve all the rows or what ever “where clause” is .
>
>I trap click event and all other keys. But not able to trap up/down arrow key
>on dddw. The code which you sent is very good code and working too , but for
>other events. Could you give full list of “notificationcode” or where I can I
>get these code?
>
>Or could you suggest me any other way to trap up/down arrow key on dddw ?
>
>I meet you three years back in San Francisco user group meeting. You did
>presentation on PFC , was very good. It been long , probably you don’t remember.
>Any ways thanks for help.
>
>Lucky


Create a user event on the datawindow and map it to pbm_dwndropdown.
That will do what you ask, mostly... <g>

The users can tab to the DDDW column using the keyboard and then use
the arrow keys to scroll thorough the DDDW values without actually
dropping it or clicking on the arrow.

ItemChanged event on the parent datawindow will fire, but only if data
in the parent column does not match the single row in the DDDW.

I would trigger the event to retrieve the DDDW in two places, the
pbm_dwndropdown and another in ItemChanged. Set a
flag in an instance var to only retrieve once.

IF KeyDown(KeyDownArrow!) OR KeyDown(KeyUpArrow!) THEN
//Reject the value and retrieve the dddw


San Francisco? That was 2 maybe 3 years ago! That was my first time
there and I was blown away! I stayed over the weekend with my son and
we had a blast!

Who is Lucky? I remember Amine, Brendan Campbell, David Golden, Linda
Dudzic...

Simon Caldwell [TeamSybase]

unread,
Jan 24, 2002, 4:29:45 AM1/24/02
to

"Lucky" <lucky...@yahoo.com> wrote in message
news:k0GVtWD...@forums.sybase.com...

> Thanks for this good code. But I have different problem , I need to trap
up/down
> arrow key on dddw.
>
> I have big PB application which run on T1 lines , 56 k lines and also on
dial up
> connection . Application running fine on T1 lines but on 56 k and on dials
up
> connection it slow and performance is not good. One of the problem is
dropdown
> datawindow. Some times dddw have 50 , 100 or more rows.
>

I'd suggest retrieving the dddw data up front, when the application is
started, and caching it in a datastore. Then when you open your window,
share (or copy, this is much quicker if you have a lot of rows in your dddw)
the data with your dddw.

I'd also suggest that 100 or more rows in a dddw is too many, it's very
difficult to use. A popup search window would be more friendly.

Simon

Lucky

unread,
Jan 25, 2002, 5:31:26 PM1/25/02
to
Hi
As Boris Gasin wrote “The users can tab to the DDDW column using the keyboard

and then use the arrow keys to scroll thorough the DDDW values without actually
dropping it or clicking on the arrow”

That’s exactly I am trying to do . When first time user tab to DDDW , DDDW have
only one row and when user use up/down arrow key then I am go to retrieve DDDW
with some additional retrieval argument.


I use all type of codes to trap down/up key when focus on DDDW , But not able
to do it. I search all over the net but not able to find it.
I used GetKeyState() API , Pbm_command function but not able to to trap down/up
key when focus on DDDW.

Need some help

Lucky


Here code which I used
http://my.sybase.com/detail?id=44545
http://my.sybase.com/detail?id=47760

GetKeyState( )
This function returns the present state of a specific key on the keyboard based
on that key's ASCII representation. A zero value represents that the key is not
pressed. There is no PowerBuilder equivalent.
Global External Function:
Function int GetKeyState(integer VirtualKeycode) Library "User32.dll"
Script:
int rtn
rtn = GetKeyState(40 ) // 65 = down key
if rtn = 0 then
MessageBox("Key State"," down key not pressed!")
else
MessageBox("Key State"," down key is pressed!")
end if

---------------------------------------------
iDDDWHandle = Handle ( dwc_child1 )
//
//ue_command mapped to pbm_command
//=========
//


IF hwndchild = iDDDWHandle THEN
CHOOSE CASE notificationcode
CASE 2048 // or 2049
// DDDW RowFocusChanged

CASE 1281
// DDDW Clicked

CASE 2314
// DDDW RightMouseButtonDown

CASE 2313
// DDDW LeftMouseButtonUp

CASE 2317
// DDDW VScroll

CASE 2318
// DDDW HScroll
CASE 2311
// DDDW Mouse Move

CASE 769
// DDDW Retrieve End

CASE 2339
// pageup / pagedown
CASE 2326

CASE 2306
// up arrow

END CHOOSE
END IF

On Wed, 23 Jan 2002 14:41:29 -0500,


in powersoft.public.powerbuilder.datawindow
Boris Gasin [TeamSybase] <NOSPAM...@dynamictechgroup.com> wrote:

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Lucky

unread,
Jan 25, 2002, 5:37:11 PM1/25/02
to
I think up/down arrow is not doing any thing when DDDW have only one row. Its
not firing “pbm_dwnkey” at all.

Lucky


On Fri, 25 Jan 2002 17:31:26 -0500,
in powersoft.public.powerbuilder.datawindow

Lucky

unread,
Jan 25, 2002, 5:47:31 PM1/25/02
to
I have DDDW all over place it not just one dddw so can’t retrieve all rows in
datastore from different tables. Popup search window is nice idea but its
training issue to user. There are more then 500 users.

Thanks

Lucky


On Thu, 24 Jan 2002 09:29:45 -0000,
in powersoft.public.powerbuilder.datawindow

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Simon Caldwell [TeamSybase]

unread,
Jan 28, 2002, 4:33:40 AM1/28/02
to
How about this then.
Pre-populate the dddw dataobject with 2 dummy rows (on the Data view in the
dw painter).
Then in the itemchanged event (I think this is the only place that you can
trap the down key), check whether the dummy rows still exist. If they do,
then remove them and populate the dddw.
A bit of a 'clunky' solution, but it should work.

--

Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel +44 (0)1904 481999 Fax +44 (0)1904 481666
Visit us at www.getrealsystems.com
Procurement Control Specialists
Controlling corporate spend and streamlining procurement processes

"Lucky" <lucky...@yahoo.com> wrote in message

news:p$f2FJfp...@forums.sybase.com...

0 new messages