Discussion:
Double and Cell Clicks Not Recognized
Chuck Pelto
2006-12-28 11:40:54 UTC
Permalink
I have a listbox that I'm working with.

MouseDown events within it are recognized and trigger activities in
the MouseDown code. But not CellClicks or DoubleClicks.

Is this a configuration issue? Or is the LB corrupted?

Regards,

Chuck
Charles Yeomans
2006-12-28 13:32:47 UTC
Permalink
Are you returning TRUE from the MouseDown event handler?

Charles Yeomans
Post by Chuck Pelto
I have a listbox that I'm working with.
MouseDown events within it are recognized and trigger activities in
the MouseDown code. But not CellClicks or DoubleClicks.
Is this a configuration issue? Or is the LB corrupted?
Regards,
Chuck
Chuck Pelto
2006-12-28 17:22:45 UTC
Permalink
Post by Charles Yeomans
Are you returning TRUE from the MouseDown event handler?
Doesn't matter whether I return TRUE, FALSE or NOTHING.

Indeed. If I comment out all code in the MouseDown event handler, it
doesn't matter; CellClick and DoubleClick don't seem to be catching
anything.

Regards,

Chuck
Post by Charles Yeomans
Post by Chuck Pelto
I have a listbox that I'm working with.
MouseDown events within it are recognized and trigger activities
in the MouseDown code. But not CellClicks or DoubleClicks.
Is this a configuration issue? Or is the LB corrupted?
Terry Ford
2006-12-28 17:49:53 UTC
Permalink
Post by Chuck Pelto
Post by Charles Yeomans
Are you returning TRUE from the MouseDown event handler?
Doesn't matter whether I return TRUE, FALSE or NOTHING.
Indeed. If I comment out all code in the MouseDown event handler,
it doesn't matter; CellClick and DoubleClick don't seem to be
catching anything.
Is the cell in question editable? That will stop both events.

Terry
Chuck Pelto
2006-12-28 18:02:31 UTC
Permalink
Hi Terry,
Post by Terry Ford
Is the cell in question editable? That will stop both events.
No. None of the columns are set to be editable.

The intention is that when the user DoubleClicks on a row, any cell
in the row, one of two things will happen.

[1] If the row has data in it, the user will be taken to the
appropriate record in another table in a form view.
[2] If the row has no data in it, i.e., there is no record associated
with it, a new record will be generated in the system and the user
will be taken to a blank form view in which they'll enter data.

Right now there are no associated records in the system. I'm clicking
on a row that is empty of data.

Is that the problem?
Terry Ford
2006-12-28 18:08:59 UTC
Permalink
Post by Chuck Pelto
Right now there are no associated records in the system. I'm
clicking on a row that is empty of data.
Is that the problem?
Yes.

Terry
Chuck Pelto
2006-12-28 18:18:52 UTC
Permalink
Post by Chuck Pelto
Right now there are no associated records in the system. I'm
clicking on a row that is empty of data.
Is that the problem?
Yes.
Okay.....

....how would one implement a system that can detect a DoubleClick on
an empty row?

A feature request here; CellClicks and DoubleClicks should be
detectable on empty rows.

Mere MouseDown seems to detect such an event in an empty cell. It
should not be too difficult to have that happen for CellClick and
DoubleClick.

Regards,

Chuck
Terry Ford
2006-12-28 18:30:24 UTC
Permalink
Post by Chuck Pelto
Post by Chuck Pelto
Right now there are no associated records in the system. I'm
clicking on a row that is empty of data.
Is that the problem?
Yes.
Okay.....
....how would one implement a system that can detect a DoubleClick
on an empty row?
A feature request here; CellClicks and DoubleClicks should be
detectable on empty rows.
Mere MouseDown seems to detect such an event in an empty cell. It
should not be too difficult to have that happen for CellClick and
DoubleClick.
I think you are confusing an empty row of a ListBox with a non-
existing row. There are ways to detect these using the MouseDown
event but you'll have to code them yourself. You can also use the
MouseDown event for detecting clicks in Editable Cells.

If you like, I'll send you an example off list (No attachments
allowed in the lists). You (or anyone else) can write me directly if
you are interested.

Terry
Chuck Pelto
2006-12-28 18:39:16 UTC
Permalink
Post by Terry Ford
Post by Chuck Pelto
Post by Chuck Pelto
Right now there are no associated records in the system. I'm
clicking on a row that is empty of data.
Is that the problem?
Yes.
Okay.....
....how would one implement a system that can detect a DoubleClick
on an empty row?
A feature request here; CellClicks and DoubleClicks should be
detectable on empty rows.
Mere MouseDown seems to detect such an event in an empty cell. It
should not be too difficult to have that happen for CellClick and
DoubleClick.
I think you are confusing an empty row of a ListBox with a non-
existing row. There are ways to detect these using the MouseDown
event but you'll have to code them yourself. You can also use the
MouseDown event for detecting clicks in Editable Cells.
I can see where the MouseDown can detect a non-existing row. How can
we get it to detect a DoubleClick in an non-existing row?
Post by Terry Ford
If you like, I'll send you an example off list (No attachments
allowed in the lists). You (or anyone else) can write me directly
if you are interested.
I'll accept any advice you can provide in order to avoid unusually
cumbersome code.

Regards,

Chuck
Terry Ford
2006-12-28 20:53:11 UTC
Permalink
Post by Chuck Pelto
I can see where the MouseDown can detect a non-existing row. How
can we get it to detect a DoubleClick in an non-existing row?
By detecting a DoubleClick in the MouseDown event.
Post by Chuck Pelto
Post by Terry Ford
If you like, I'll send you an example off list (No attachments
allowed in the lists). You (or anyone else) can write me directly
if you are interested.
I'll accept any advice you can provide in order to avoid unusually
cumbersome code.
Contact me off-list then. :)

REALbasic's ListBox is one of the most complex controls and often a
"One Size Fits All" solution is not possible.

It has CellClick and DoubleClick events that only work in certain
circumstances and, when used as intended, work great. It's only when
one wishes to step outside the envelope that they run into trouble or
confusion. Fortunately there are ways and means to use the properties
of the listbox to accommodate them. The problem is that each solution
is based upon the circumstances surrounding a Click or DoubleClick of
the mouse.

In the Examples provided with Rb there is a Double-clickable Canvas
example in the Classes Folder. This example (from 2001) will give you
the code for detecting the DoubleClick time based on Mouse-Up.

It also *only* works (as is) in Mac PEF, OS9, Windows or Linux.
Modifications must be made to the declares for Mach-O or UB usage.

Also, because one often needs other events to respond in a ListBox
one must modify it for the MouseDown event.

Terry

PS. All direct e-mails are welcome.

CV
2006-12-28 17:48:08 UTC
Permalink
Post by Chuck Pelto
Post by Charles Yeomans
Are you returning TRUE from the MouseDown event handler?
Doesn't matter whether I return TRUE, FALSE or NOTHING.
Are you testing this in a new project with content in the cells? For
example, add some rows to a listbox, put a msgbox in CellClick, no
code elsewhere. Then click on a cell. The msgbox should display. Then
put Return True in MouseDown and click on the cell. The msgbox should
not display.

Best,


Jack
Post by Chuck Pelto
Indeed. If I comment out all code in the MouseDown event handler,
it doesn't matter; CellClick and DoubleClick don't seem to be
catching anything.
Regards,
Chuck
Post by Charles Yeomans
Post by Chuck Pelto
I have a listbox that I'm working with.
MouseDown events within it are recognized and trigger activities
in the MouseDown code. But not CellClicks or DoubleClicks.
Is this a configuration issue? Or is the LB corrupted?
Chuck Pelto
2006-12-28 18:13:26 UTC
Permalink
Hi Jack,
Post by CV
Are you testing this in a new project with content in the cells?
For example, add some rows to a listbox, put a msgbox in CellClick,
no code elsewhere. Then click on a cell. The msgbox should display.
Then put Return True in MouseDown and click on the cell. The msgbox
should not display.
Yes. I'm working on a new project.

No. There is no content in any of the cells (see earlier post as to
methodology), at this point.

I'm checking for catching the DoubleClick event by having the code I
want used in it and putting a breakpoint in there. But the system is
not passing through the DoubleClick event handler when a blank row is
clicked on.

Regards,

Chuck
Chuck Pelto
2006-12-28 17:52:30 UTC
Permalink
P.S. If I interpreted your question wrongly, and you were interested
in whether MouseDown was catching events if it was returning TRUE....

....it catches events no matter if I put in TRUE, FALSE or nothing.

And CellClick and DoubleClick don't catch anything.
Post by Chuck Pelto
Post by Charles Yeomans
Are you returning TRUE from the MouseDown event handler?
Doesn't matter whether I return TRUE, FALSE or NOTHING.
Indeed. If I comment out all code in the MouseDown event handler,
it doesn't matter; CellClick and DoubleClick don't seem to be
catching anything.
Regards,
Chuck
Post by Charles Yeomans
Post by Chuck Pelto
I have a listbox that I'm working with.
MouseDown events within it are recognized and trigger activities
in the MouseDown code. But not CellClicks or DoubleClicks.
Is this a configuration issue? Or is the LB corrupted?
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
Loading...