Recent

Author Topic: Virtual TListView  (Read 11689 times)

Dali

  • Newbie
  • Posts: 4
Virtual TListView
« on: July 28, 2009, 03:13:32 pm »
To start, for this is my first message in this forum, let me say hi and thanks to everyone, specially to all of those who are working so hard in this great project.

This has been already submitted as a bug (http://bugs.freepascal.org/view.php?id=7749), but I don't know if the solution is actually either projected or discarded. As so many other coders, I'm starting to port Delphi apps to Lazarus, and I found what, for me, is a huge problem: TListView has not the ability to act as a virtual list. i.e., the component has a property "OwnerData", but is unusable unless methods such as "OnOwnerData" or the function "OwnerDataFetch" are inheritable from TCustomListView.

Some years ago, I developed a TDBListView component which is the core of almost all the apps from my company. It is, essentially, a virtual list which can handle tables containing millions of rows.

So, for me, the lack of this ability is a great handicap. Is anyone working on this? Should I give up? Please feed me back!

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1945

Dali

  • Newbie
  • Posts: 4
Re: Virtual TListView
« Reply #2 on: July 28, 2009, 04:58:10 pm »
Thanks for the quick answer, Theo.

I already knew about VirtualTreeView, and I must give it the try it surely worthes, but I really do need the ability to show objects as both icons and details, which is one of the reasons because I think it may be pretty hard to migrate from my (very) customized list view to the tree one.

And that's why I posted this issue in the LCL forum: I'm trying to port some apps and components derived from pure Delphi code to Lazarus. The TListView component is part of the LCL, while the VirtualTreeView is not (at least, not yet). So, I'd really like to know whether this enhancement is projected or not.
« Last Edit: August 21, 2009, 06:29:01 pm by Dali »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Virtual TListView
« Reply #3 on: July 28, 2009, 05:20:50 pm »
I'm working on implementing Virtual ListView.

Dali

  • Newbie
  • Posts: 4
Re: Virtual TListView
« Reply #4 on: July 28, 2009, 06:33:40 pm »
Thank you, skalogryyz, that's great news!

Please, keep us informed on your advances.  :)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Virtual TListView
« Reply #5 on: August 01, 2009, 07:23:36 pm »
ok. if anyone is interested.
here's a patch.
It's not yet commited, to LCL, because i've not made any tests, but it seems to work on a simple test:

Code: [Select]
procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem);
begin
  Item.Caption := 'Hello world'+IntToStR(Item.Index);
  if Item.Index mod 2 = 0 then Item.SubItems.Add('SubItem of '+IntToStr(Item.index));
end;

So far it looks delphi compatible.
It's win32 only (carbon is the next widget to be supported).
Text only (images are not yet supported).

The patch is made against trunk lazarus (r21059). So if you want to apply it, make sure you have the proper sources.
It patches LCL and Win32 sources.
« Last Edit: August 04, 2009, 08:10:51 am by skalogryyz »

Dali

  • Newbie
  • Posts: 4
Re: Virtual TListView
« Reply #6 on: August 19, 2009, 06:05:39 pm »
here's a patch.

Hmmmmm. Maybe I'm going blind, or just lost, so this may sound a bit silly but... Where's the patch?

And yet another couple of questions: What about gtk? And, when it's done, will it support images?

Thank you very much for your work!

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Virtual TListView
« Reply #7 on: August 19, 2009, 06:10:20 pm »
Hmmmmm. Maybe I'm going blind, or just lost, so this may sound a bit silly but... Where's the patch?
you're right. the patch attached to the post has been deleted (after some bugs fixed).
you can find the latest (win32) patch at the bug tracker: http://bugs.freepascal.org/view.php?id=7749

And yet another couple of questions: What about gtk? And, when it's done, will it support images?
i'm currently working on Carbon version, as it's most wanted (thanks to Alexander aka nero76)

 

TinyPortal © 2005-2018