Home > Archive > Programming with dBASE > October 2005 > Cursor Key Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Cursor Key Problem
John Noble

2005-10-11, 7:27 am

In my form I am using a seeker with a grid. I have overwritten the onkey event of the seeker as follows:

if (nChar == 9 OR nChar = 13) // tab or CR
form.seeker1.value = form.rowset.fields[1].value
form.mygrid1.visible = false
elseif (nChar == 24)
form.rowset.next(-1)
elseif (nChar == 25)
form.rowset.next()
else
form.grid1.visible = true
seeker::onKey(nChar,
nPosition,bShift,bCo
ntrol)
endif

My problem is the up and down keys (24 + 25). I cannot get the rowset to move up or down when the cursor keys are pressed. When I insert the line msgbox("" + nChar, "", 16) and then press the up or down button....nothing happens.

And advice appreciated.

John
Roger Sauer

2005-10-11, 7:27 am

Does the grid have focus?

Also, are you sure about up=24 and down=25? How about up=5 and down=24?

Roger

John Noble Wrote:

> In my form I am using a seeker with a grid. I have overwritten the onkey event of the seeker as follows:
>
> if (nChar == 9 OR nChar = 13) // tab or CR
> form.seeker1.value = form.rowset.fields[1].value
> form.mygrid1.visible = false
> elseif (nChar == 24)
> form.rowset.next(-1)
> elseif (nChar == 25)
> form.rowset.next()
> else
> form.grid1.visible = true
> seeker::onKey(nChar,
nPosition,bShift,bCo
ntrol)
> endif
>
> My problem is the up and down keys (24 + 25). I cannot get the rowset to move up or down when the cursor keys are pressed. When I insert the line msgbox("" + nChar, "", 16) and then press the up or down button....nothing happens.
>
> And advice appreciated.
>
> John


Todd Kreuter

2005-10-11, 7:27 am

John Noble wrote:
>
> My problem is the up and down keys (24 + 25). I cannot get the rowset to move up or down when the cursor keys are pressed. When I insert the line msgbox("" + nChar, "", 16) and then press the up or down button....nothing happens.


These are not recognized by the key or onKey events. As far as I know,
only the paintbox onKeyDown/Up events recognize these keystrokes.

I have done some work with a paintbox key handler for seekers and
combobox type controls, which will do what you desire. Or you could
train your users to tab to the grid to navigate up and down.

--
Todd Kreuter [dBVIPS]
Todd Kreuter

2005-10-17, 1:26 pm

Todd Kreuter wrote:
>
> I have done some work with a paintbox key handler for seekers and
> combobox type controls, which will do what you desire.


And I finally got around to updating that. I just posted it to the
shared-code newsgroup if iterested.

--
Todd Kreuter [dBVIPS]
Rich Assaf

2005-10-27, 7:28 am

In addition to what Todd wrote, you can override the the onGotFocus and
redefine the up/down arrows with ON KEY statements - make sure to clear the
ON KEY in onLostFocus....

// arrow handler
on key label UpArrow _app.ActiveForm.MoveRecord(-1)
on key label DnArrow _app.ActiveForm.MoveRecord(+1)

Rich

"Todd Kreuter" <tkreuter@dbvips.usa> wrote in message
news:434ACB2E.10F133C9@dbvips.usa...
> John Noble wrote:
>
> These are not recognized by the key or onKey events. As far as I know,
> only the paintbox onKeyDown/Up events recognize these keystrokes.
>
> I have done some work with a paintbox key handler for seekers and
> combobox type controls, which will do what you desire. Or you could
> train your users to tab to the grid to navigate up and down.
>
> --
> Todd Kreuter [dBVIPS]



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com