View Issue Details

IDProjectCategoryView StatusLast Update
0032229PackagesPackagespublic2018-05-23 11:32
Reporterm_burkhard@gmx.ch Assigned ToOndrej Pokorny  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWin32/64OSWindows 
Product Version1.6.4 
Summary0032229: TListView and symbols, display incorrect
DescriptionIf you select the representation vsIcon or vsSmallIcon in TListView and the TListView is linked to an ImageList, everything is displayed correctly. But if you change the ImageList at runtime, then there is an incorrect representation. The error did not occur with the previous version of Lazarus.
See the demo in the appendix.

On Linux the representation is perfect.

More information in the German forum. http://www.lazarusforum.de/viewtopic.php?f=19&t=10942&p=96968#p96968
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0029905 closedOndrej Pokorny Lazarus Imagelist bug: png icons load in wrong size 

Activities

m_burkhard@gmx.ch

2017-07-31 17:17

reporter  

ListView.tar.gz (131,720 bytes)

wp

2017-07-31 21:55

developer   ~0102015

I can confirm with Laz trunk/fpc 3.0.2 back to 1.6.2/fpc 3.0. The issue does not occur with fpc 1.6.0/fpc 3.0 (all tested as 32bit on Win10/64bit).

wp

2017-07-31 22:21

developer   ~0102016

Last edited: 2017-07-31 22:23

View 2 revisions

Modified the demo to use a TTreeView or a TStringGrid instead of a TListView. The added icons are displayed correctly (with Laz trunk - see attachments). Therefore, the issue seems to be related to TListView, but not to TImageList.

wp

2017-07-31 22:22

developer  

StringGrid.zip (9,377 bytes)

wp

2017-07-31 22:22

developer  

Treeview.zip (9,312 bytes)

wp

2017-07-31 23:12

developer   ~0102018

I could bracket the guilty revision: The bug appears in r52077 ("LCL: ImageList: call DestroyReference in Clear. Resolves Issue 0029905."), the last correct revision was r52076.

Bart, since this revision was yours, I am assigning the report to you. If I remove the added line ("DestroyReference") in TCustomImageList.Clear (in imglist.inc) the bug is gone also in the current trunk.

I know this contradicts my statement above that the bug is not related to TImageList...

Bart Broersma

2017-08-01 00:13

developer   ~0102019

Last edited: 2017-08-01 00:14

View 2 revisions

Sorry I have to unassign.
I currently have no access to a windows machine anymore, and the revision that causes this issue is a Win only one.

@wp: if you remove the DestroyReference, will not the original issue re-appear?
(There is a test project in the related report)

wp

2017-08-01 00:18

developer   ~0102020

Last edited: 2017-08-01 00:22

View 2 revisions

> if you remove the DestroyReference, will not the original issue re-appear?

Yes, probably, it was not understood as final solution - that's why I had assigned it to you. But I can have a closer look tomorrow.

Bart Broersma

2017-08-01 00:50

developer   ~0102021

Thank you for that.
It feels lousy to cause a regression and then being unable to work on that.

wp

2017-08-01 11:49

developer   ~0102023

Yes - the error of issue 29905 is back when I remove the DestroyReference.

A hot candidate, at the moment, could be the method TCustomListview.ImageChanged which is called whenever the image list changes and which essentially has been empty since Feb 2005 (r6848) while TCustomTreeView has an Invalidate here. Putting this into TCustomListview's ImageChanged does not solve anything, though, but if I add

  if Sender is TCustomImageList then
    TCustomImageList(Sender).Handle;

the painting issues reported here are gone, but would probably break 29905 again. My problem is that I don't know too much about the internal workings of these controls...

m_burkhard@gmx.ch

2017-08-01 17:00

reporter   ~0102024

Last edited: 2017-08-01 17:03

View 5 revisions

Under native Windows, it seems to work, but in Wine, the icons now appear, but as it seems, some offset is not set to zero. (See attachement)
I have tried the examples with TreeView and StringGrid, it seems to work. The one with Stringrid Iconen paste, was not known to me so far.

http://www.lazarusforum.de/viewtopic.php?f=19&t=10942&p=97015#p97015&start=10

Bart Broersma

2017-08-02 18:27

developer   ~0102044

> My problem is that I don't know too much about the internal workings of these controls...

Same for me.
I remember spending quite some hours on that.

Ondrej Pokorny

2018-05-13 13:08

developer   ~0108270

Is this issue still valid?

If yes, please describe what you mean with "incorrect representation" in "But if you change the ImageList at runtime, then there is an incorrect representation."

Ondrej Pokorny

2018-05-23 11:32

developer   ~0108490

Since the guilty revision (r52077) has been reverted and I cannot reproduce the bug, I resolve this issue as fixed.

Issue History

Date Modified Username Field Change
2017-07-31 17:17 m_burkhard@gmx.ch New Issue
2017-07-31 17:17 m_burkhard@gmx.ch File Added: ListView.tar.gz
2017-07-31 21:55 wp Note Added: 0102015
2017-07-31 22:21 wp Note Added: 0102016
2017-07-31 22:22 wp File Added: StringGrid.zip
2017-07-31 22:22 wp File Added: Treeview.zip
2017-07-31 22:23 wp Note Edited: 0102016 View Revisions
2017-07-31 23:12 wp Note Added: 0102018
2017-07-31 23:13 wp Assigned To => Bart Broersma
2017-07-31 23:13 wp Status new => assigned
2017-08-01 00:11 Bart Broersma Assigned To Bart Broersma =>
2017-08-01 00:13 Bart Broersma LazTarget => -
2017-08-01 00:13 Bart Broersma Note Added: 0102019
2017-08-01 00:13 Bart Broersma Status assigned => acknowledged
2017-08-01 00:13 Bart Broersma Relationship added related to 0029905
2017-08-01 00:14 Bart Broersma Note Edited: 0102019 View Revisions
2017-08-01 00:18 wp Note Added: 0102020
2017-08-01 00:22 wp Note Edited: 0102020 View Revisions
2017-08-01 00:50 Bart Broersma Note Added: 0102021
2017-08-01 11:49 wp Note Added: 0102023
2017-08-01 17:00 m_burkhard@gmx.ch Note Added: 0102024
2017-08-01 17:00 m_burkhard@gmx.ch Note Edited: 0102024 View Revisions
2017-08-01 17:02 m_burkhard@gmx.ch Note Edited: 0102024 View Revisions
2017-08-01 17:03 m_burkhard@gmx.ch Note Edited: 0102024 View Revisions
2017-08-01 17:03 m_burkhard@gmx.ch Note Edited: 0102024 View Revisions
2017-08-02 18:27 Bart Broersma Note Added: 0102044
2018-05-13 13:08 Ondrej Pokorny Note Added: 0108270
2018-05-13 13:08 Ondrej Pokorny Assigned To => Ondrej Pokorny
2018-05-13 13:08 Ondrej Pokorny Status acknowledged => feedback
2018-05-23 11:32 Ondrej Pokorny Note Added: 0108490
2018-05-23 11:32 Ondrej Pokorny Status feedback => resolved
2018-05-23 11:32 Ondrej Pokorny Resolution open => fixed