Vincent Snijders wrote:
Graeme Geldenhuys schreef:
Hi,

Can someone confirm this before I submit a Mantis bug report.
Clicking on items in a ListView with vsReport style:
 - If you click on the items 99% of the time the OnClick doesn't fire
 - Clicking to the left of the last column (black space) then the
OnClick fires every time

OnClick seems to work okay in Linux (Gtk1).

Steps to repoduce:
1) Create a new project, drop a TListView and TMemo on the form.
2) Change the TListView style to vsReport, Add one column and add
about 5 items to the ListView.
3) Create a OnClick event handler for the ListView. In the event
handel add the text 'clicked' to the memo.
4) Run the app and click on the items (first and only column only).
OnClick doesn't fire 99% of the times.
5) Click to the left (in the blank space - background) on the
items/columns and OnClick fires every time.

Strangely enough it fires after a double click.
It looks like the same issue we had for the right click (and popup) until recently.

Oops, I was messing up this bug with another one regarding right mouse button 
clicks. OnClick indeed does not fire on the ListView when clicking on items in 
ListView (and double clicking gives strange results also). Note that MouseDown 
does fire when clicking on items, but MouseUp does not.

MouseUp does also not fire for right clicks on items, though it does fire the 
errorneous MouseUp event described below (and in bug 8768, which I have just 
filed).


The actual problem regarding right clicks and popup menus seems to be that a 
right click on a TListView generates an extra MouseUp event, even before the 
MouseDown event.

This MouseUp event seems to arrive first at the ListView's Parent, but has X,Y 
coordinates that are actually relative to the ListView.

What actually happens depends on what control is at the Parent at these X,Y 
coordinates. For example:
- if there is no child control at X,Y, OnMouseUp fires at the Parent
- if there is a child control at X,Y, OnMouseUp will fire
- if there is a child control with a popup menu, the popup menu will appear 
there (displaced by ListView.Left, ListView.Top)

I extended Graeme's test a little more by adding some more events and some more 
ListViews. The project is attached to bug report 8768 
(http://www.freepascal.org/mantis/view.php?id=8768).

Tested: Laz: 0.9.23 (rev 10998), FPC: 2.1.2, Target: i386, OS: WinXP, 
Widgetset: Win32

Regards,

Bram

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to