Sign in Join

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

Mailing lists / lazarus / 2015-04

Bug in TListView custom draw item ?

17 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

aradeonas

Hi,

Months ago I did work with listview and saw a weird behavior: I made a simple drag and drop demo for listview: 1- Add 10 item and set all items imageindex=-1. 2- Write dragdrop code for reorder items. 3- Test reorder and it work well. 4- Assign listview custom draw item and run again. 5- Now when I drag an item,item show new image ! 6- Delete custom draw item procedure and now everything work fine!

Why?

Before I made a topic in the forum for it and because in the mail list different people are active I think with my self may some one new have new idea or solution. Take a look at topic for a example project that I attached before.
http://forum.lazarus.freepascal.org/index.php/topic,26604.0.html

Regards, Ara

http://www.fastmail.com - Access your email from home and the web -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150409/5ac21c9f/attachment.html>

Reply by email

zeljko
to aradeonas
aradeonas wrote 15 lines
Hi, Months ago I did work with listview and saw a weird behavior: I made a simple drag and drop demo for listview: 1- Add 10 item and set all items imageindex=-1. 2- Write dragdrop code for reorder items. 3- Test reorder and it work well. 4- Assign listview custom draw item and run again. 5- Now when I drag an item,item show new image ! 6- Delete custom draw item procedure and now everything work fine! Why? Before I made a topic in the forum for it and because in the mail list different people are active I think with my self may some one new have new idea or solution. Take a look at topic for a example project that I attached before. http://forum.lazarus.freepascal.org/index.php/topic,26604.0.html

Open an issue about it and attach example project. I'll take a look. What widgetset do you use ?

zeljko

Reply by email

zeljko
to aradeonas
aradeonas wrote

I've tested your example and it works fine here. Qt,gtk2 and win32 (under wine). But I've tested with trunk lazarus, so it's possible that your problem is fixed in the meantime (since you're using 1.2.6 according to the mantis issue). So, would be nice if you can re-test with trunk lazarus or at least with 1.4RC3 and give your feedback.

zeljko

Reply by email

aradeonas
to zeljko

Sure.
I test it with Lazarus 1.5 (2015-04-08) SVN 48392 and FPC 3.1.1 and its not work correct.

Are you test it as I said? move first item in middle of list (drag 1 over 6 ant drop it) you should see the problem.

Regards,
Ara

http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -------------- next part -------------- A non-text attachment was scrubbed... Name: List.png Type: image/png Size: 1976 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150409/8f2d0ed5/attachment.png>

Reply by email

zeljko
to aradeonas
aradeonas wrote 6 lines
Sure. I test it with Lazarus 1.5 (2015-04-08) SVN 48392 and FPC 3.1.1 and its not work correct. Are you test it as I said? move first item in middle of list (drag 1 over 6 ant drop it) you should see the problem.

I don't see any problem here :) I've tested win32 widgetset under wine so that might be the reason (if I correctly understood your issue - there should be no visible images at all).

zeljko

Reply by email

zeljko
to aradeonas
aradeonas wrote
Thanks.Yes there ist any code for changing image index but it will get image when it drop. So we will wait for some one else check this project.

Indeed, I've just tested on real windows (winXP in vmware), and it shows image when OnCustomDrawItem is assigned, without it everything is ok.

zeljko

Reply by email

zeljko
to aradeonas: Sure. I test it with Lazarus 1.5 (2015-04-08) SVN 48392 and FPC 3.1.1 and its not work…
aradeonas wrote 6 lines
Sure. I test it with Lazarus 1.5 (2015-04-08) SVN 48392 and FPC 3.1.1 and its not work correct. Are you test it as I said? move first item in middle of list (drag 1 over 6 ant drop it) you should see the problem.

I've attached possible patch to the issue, so you can test if it's correct. Pls someone with more win32 knowledge than me, review that patch.

zeljko

Reply by email

Juha Manninen
to aradeonas
aradeonas wrote
Thanks,What is the easiest way to apply this patch?I didnt use SVN and my version is 1.2.6 stable version.

You must get the development version (trunk) from SVN.

Juha

Reply by email

zeljko
to aradeonas
aradeonas wrote
Just asking because of curiosity : I reported this bug and it fixed but I cant test it for any reason,what will happen on this report and bug?

It's not fixed. I've only attached possible patch. If it's tested by more ppl, and reviewed by at least one core developer with more knowledge of win32 widgetset it can be applied to lazarus 1.4.

zeljko

Reply by email