Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-05

ListView.OnSelectItem - which LCL backend is correct?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I found a bug in LCL's TListView. The OnSelectItem event. When you select an item in the Listview, that event is triggered twice. Once with the Selected = True (indicating the new selection) and once with the Selected = False (indicating the old selection).

But the order of those events are reversed between LCL-Win32/64 and LCL-GTK2. I haven't tried other LCL backends, so don't know the order of them.

So which backend has the correct behaviour, so I can file a bug report for the other one. Seeing has LCL by design is very Windows centric, I'm assuming the LCL-Win32/64 is the correct behaviour?

Unfortunately the documentation doesn't specify the expected behaviour. http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tcustomlistview.onselectitem.html

Also, it seems that under LCL-GTK2 the first time you select a new item, it generates this event more times than under LCL-Win32/64.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Bart
to Graeme Geldenhuys
Graeme Geldenhuys wrote
But the order of those events are reversed between LCL-Win32/64 and LCL-GTK2. I haven't tried other LCL backends, so don't know the order of them.

Without looking into it, I would expect that the order is unselect, then select.

Also, it seems that under LCL-GTK2 the first time you select a new item, it generates this event more times than under LCL-Win32/64.

This is a known issue:
http://bugs.freepascal.org/view.php?id=23813

I tried to find the root cause of it, but failed miserably.

Bart

Reply by email

Graeme Geldenhuys
to Bart
Bart wrote
Without looking into it, I would expect that the order is unselect, then select.

I would have expected that behaviour too. It is like that when using LCL-Win32/64, but the reverse order with LCL-GTK2.

This is a known issue: http://bugs.freepascal.org/view.php?id=23813 I tried to find the root cause of it, but failed miserably.

An old bug. The report mentions only ShellListView. I'm assuming ShellListView is a descendant of TListView then. Thanks for trying to look into this.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email