Sign in Join

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

Mailing lists / lazarus / 2012-02

ListView problems

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Hans-Peter Diettrich

As mentioned in Mantis #18820 I tried to verify the OwnerData implementation, and get nothing displayed (Win7). Most probably because [Do]OnData is never called.

Some questions are still open:

Can OwnerData be changed at runtime?
If so, what happens to the non-OwnerData Items? Are these lost when switching into OwnerData mode and back again?
My test program crashed with an AV in TListItems.IndexOf when switched into OwnerData mode.

How is Sorted supposed to work?
Added(?) items seem not to be sorted properly, when changing SortType from stNone to stText.

Provided that we agree that OwnerData should be changeable at runtime, I can extend the ListView example with according test facilities, so that we have a common test application for the demonstration of the remaining problems.

DoDi

Reply by email

zeljko
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 21 lines
As mentioned in Mantis #18820 I tried to verify the OwnerData implementation, and get nothing displayed (Win7). Most probably because [Do]OnData is never called. Some questions are still open: Can OwnerData be changed at runtime? If so, what happens to the non-OwnerData Items? Are these lost when switching into OwnerData mode and back again? My test program crashed with an AV in TListItems.IndexOf when switched into OwnerData mode. How is Sorted supposed to work? Added(?) items seem not to be sorted properly, when changing SortType from stNone to stText. Provided that we agree that OwnerData should be changeable at runtime, I can extend the ListView example with according test facilities, so that we have a common test application for the demonstration of the remaining problems.

Before any extending of example, open new issue and attach example which crashes (and explanation how to reproduce please). I haven't tested OwnerData on pure windows , but with wine under linux, so maybe it could be problem (but doubt about it).

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120210/bf39145a/attachment.html>

Reply by email

Hans-Peter Diettrich
to zeljko
Before any extending of example, open new issue and attach example which crashes (and explanation how to reproduce please).

After a look at your new code I found these problems:

1) After changing OwnerData it's necessary to Clear the listview. This should be done in the widget automatically. The same for BeginUpdate and EndUpdate, which also must be called for a change of the Item.Count. Otherwise the widget is misconfigured and can show blank entries.

2) The number of OwnerData items is AllocBy in Delphi, not Items.Count. This property seems to be ignored or otherwise unusable - fix or remove it? The (Win32) widget shows AllocBy items, but only for the first Items.Count items the OnData event occurs, the remaining items show as blank.

The example code is not really instructive, due to the default names for all controls. How shall a user know what e.g. Button1Click or Edit1Change code is good for?

No further problems with OwnerData, so far :-)

DoDi

Reply by email

dmitry boyarintsev
to Hans-Peter Diettrich

Zeljan,

I'm reassigning the item to you.

thanks,
Dmitry

Hans-Peter Diettrich wrote 36 lines
zeljko schrieb: > Before any extending of example, open new issue and attach example which > crashes (and explanation how to reproduce please). After a look at your new code I found these problems: 1) After changing OwnerData it's necessary to Clear the listview. This should be done in the widget automatically. The same for BeginUpdate and EndUpdate, which also must be called for a change of the Item.Count. Otherwise the widget is misconfigured and can show blank entries. 2) The number of OwnerData items is AllocBy in Delphi, not Items.Count. This property seems to be ignored or otherwise unusable - fix or remove it? The (Win32) widget shows AllocBy items, but only for the first Items.Count items the OnData event occurs, the remaining items show as blank. The example code is not really instructive, due to the default names for all controls. How shall a user know what e.g. Button1Click or Edit1Change code is good for? No further problems with OwnerData, so far :-) DoDi -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

zeljko
to dmitry boyarintsev
dmitry boyarintsev wrote
Zeljan, I'm reassigning the item to you.

No problem, I've resolved it again since issue is indeed fixed.

zeljko

Show quoted text 47 lines
thanks, Dmitry On Fri, Feb 10, 2012 at 3:16 PM, Hans-Peter Diettrich wrote: > zeljko schrieb: >> Before any extending of example, open new issue and attach example which >> crashes (and explanation how to reproduce please). > > After a look at your new code I found these problems: > > 1) After changing OwnerData it's necessary to Clear the listview. This > should be done in the widget automatically. The same for BeginUpdate and > EndUpdate, which also must be called for a change of the Item.Count. > Otherwise the widget is misconfigured and can show blank entries. > > 2) The number of OwnerData items is AllocBy in Delphi, not Items.Count. > This property seems to be ignored or otherwise unusable - fix or remove > it? The (Win32) widget shows AllocBy items, but only for the first > Items.Count items the OnData event occurs, the remaining items show as > blank. > > > The example code is not really instructive, due to the default names for > all controls. How shall a user know what e.g. Button1Click or > Edit1Change code is good for? > > > No further problems with OwnerData, so far :-) > > > DoDi > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120212/8806caa4/attachment.html>

Reply by email

Hans-Peter Diettrich
to dmitry boyarintsev: I'm reassigning the item to you. Dmitry On Fri, Feb 10, 2012 at 3:16 PM, Hans-Peter…
Zeljan, I'm reassigning the item to you.

I just tested the new version, the OwnerData issues look fixed now :-) I've removed excess code from the example, to verify that Clear and BeginUpdate/EndUpdate is no more required with OwnerData mode.

Sorting still doesn't work (on Windows only?). I added an according note, because Zeljan mentioned:
1.I've fixed sorting some time ago and it works ok. Should I report an new issue, or what?

Finally I renamed the controls in the example to something meaningful, so that the code is better understandable, and supplied an according patch.

DoDi

Reply by email

Hans-Peter Diettrich
to zeljko
Show quoted text 13 lines
On Sunday 12 of February 2012 12:18:00 Hans-Peter Diettrich wrote: > Sorting still doesn't work (on Windows only?). I added an according > note, because Zeljan mentioned: > 1.I've fixed sorting some time ago and it works ok. > Should I report an new issue, or what? Yes, please + example.

#21273

The procedures to reproduce have been given already in #18820.

Just a note: please do not close issues before confirmation by the reporter! Like it can take some time to fix an bug, it can take some time to verify the operation of the updated code.

DoDi

Reply by email