Xojo Conferences
MBSOct2019CologneDE

Simulate a cellclick event. Why not? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: [ANN] SortingListbox
Next thread: any way to disable the yellow button?


Re: Jaguar RB?   -   German Bauer
  Simulate a cellclick event. Why not?   -   Jann Linder
   Re: Simulate a cellclick event. Why not?   -   Andrea Suraci

Simulate a cellclick event. Why not?
Date: 07.05.02 21:58 (Tue, 07 May 2002 13:58:09 -0700)
From: Jann Linder
Now, first off, being into reusable code and all, I know the "best" way to
do this is to create a module that you call from both the cellclick event
AND the keydown event, but just as a point of information:

I have a listbox wherein subroutine is listed under the cellclick event.
That fires whenever anyone clicks the cell. HOWEVER, when someone SCROLLS
To the cell whith the arrow keys and HITS return (which I capture via the
keydown event in the listbox) I wish to run the same code and continue just
as if the cellclick event fired. Having said that, the OOP way of doing
this is as follows (in PSUEDO CODE)

In the KEYDOWN EVENT:
If keydown = chr(13) or keydown = chr(3) then
//simulate the click of the cell in whatever row we are in

WINDOW1.LISTBOX.cellclick = true
(OR)
WINDOW1.LISTBOX.cellclick(1)
Or whatever it would take to fire cellclick
return true

End if

This does two things...it allows me to just fire off an event and continue
where that event would take the program without worrying about handling a
keydown differently that a cellclick

Is there a reason RB doesn't allow this? Jeepers, am I off in 'This is not
good to do'-Land or what?

TIA

Jann


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: Simulate a cellclick event. Why not?
Date: 08.05.02 16:47 (Wed, 8 May 2002 17:47:15 +0200)
From: Andrea Suraci
I noticed you had no replies, so I'll try to help.
AFAIK there is no way to fire an event by code, so you'll need to make a
function which takes the same parameters as the CellClick event, put
your code there and then call that function from CellClick and from
KeyDown.

HTH,
Andrea.

Tuesday, May 7, 2002, alle 10:58 pm, Jann Linder ha scritto:

> In the KEYDOWN EVENT:
> If keydown = chr(13) or keydown = chr(3) then
> //simulate the click of the cell in whatever row we are in
>
> WINDOW1.LISTBOX.cellclick = true
> (OR)
> WINDOW1.LISTBOX.cellclick(1)
> Or whatever it would take to fire cellclick
> return true
>
> End if
>
> This does two things...it allows me to just fire off an event and
> continue
> where that event would take the program without worrying about
> handling a
> keydown differently that a cellclick
>
> Is there a reason RB doesn't allow this? Jeepers, am I off in 'This is
> not
> good to do'-Land or what?

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>