Recent

Author Topic: TTreeListView  (Read 36524 times)

BeniBela

  • Hero Member
  • *****
  • Posts: 908
    • homepage
TTreeListView
« on: March 05, 2011, 01:54:11 am »
The TTreeListView is a combination of a TTreeView and TListView which paints a tree whose nodes can contain additional columns.
The component has (almost) all features of a tree view (like collapsing nodes, expanding, different tree lines) and of a list view (like columns, sorting, multiselection, owner drawing, alternating rows)
The visible item data is added as strings which will be managed by the ttreelistview, so you don't have to worry about memory allocation; and the view automatically supports sorting by columns and incremental searching by a search bar. However, you can also add custom data for owner drawing.
It has no external dependencies and should be able to run everywhere, no matter if you have linux/windows, gtk2/win32, 32/64-bit or Lazarus/Delphi.



BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Re: TTreeListView
« Reply #1 on: March 05, 2011, 08:44:28 am »
It's nice!!. I can't wait to test it  :D

/BlueIcaro

AmatCoder

  • Jr. Member
  • **
  • Posts: 57
    • My site
Re: TTreeListView
« Reply #2 on: March 05, 2011, 10:23:47 am »
This is exactly what I wanted for my project.
Really this is an useful component. Good Job!

Edit: On Gtk2 it's working fine, but with QT it doesn't repaint until focus changes...Are you aware?
Minor issue anyway (and maybe it is caused by some limitation of Qt widget)
I reaffirm what I said: Really good job!

Regards.
« Last Edit: March 05, 2011, 10:34:52 am by AmatCoder »

Hydexon

  • Full Member
  • ***
  • Posts: 170
Re: TTreeListView
« Reply #3 on: March 05, 2011, 04:24:47 pm »
I'm installed TTreeListView and when put the component into the form in the IDE, shows and error: "Invalid Value: 100000" and i try to reducing that and shows me and simple treeview and runtime and exception is raised... :(
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook (old)
Lazarus 2.0.2 Stable - FPC 3.0.2 - Windows | Lenovo IdeaPad Y

matthius

  • Full Member
  • ***
  • Posts: 155
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: TTreeListView : VirtualDBTreeEx
« Reply #4 on: March 05, 2011, 05:32:57 pm »
Don't forget The VirtualDBTreeEx, which permits to use data rules for checking :
http://www.lazarus-components.org/remository/Components-with-sources/Visual-Components/Trees/TVirtualDBTreeEx/
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

BeniBela

  • Hero Member
  • *****
  • Posts: 908
    • homepage
Re: TTreeListView
« Reply #5 on: March 05, 2011, 05:39:45 pm »
On Gtk2 it's working fine, but with QT it doesn't repaint until focus changes...Are you aware?
Not really aware, but I kind of expected it, because qt is said to not allow to bypass  the paint event.
I will fix this bug, if I ever manage to compile the qt-LCL.

I'm installed TTreeListView and when put the component into the form in the IDE, shows and error: "Invalid Value: 100000" and i try to reducing that and shows me and simple treeview and runtime and exception is raised... :(
Do you have a recent Lazarus? (~0.9.30).
I honestly never place it in the design mode, but create it during runtime, since there aren't many option to set anyways.
(but one of the reasons to make this announcement was, that it was just confirmed to work fine in design mode)

Hydexon

  • Full Member
  • ***
  • Posts: 170
Re: TTreeListView
« Reply #6 on: March 05, 2011, 05:58:30 pm »
Nop, i have the stable release (0.9.28.2 beta), and you mean if this is possible in runtime mode?
Lazarus 1.0.4 Stable - FPC 2.6.0 - gtk2 | Linux Mint 14 Nadia | GNOME Shell 3.6.2 - Awesome | Intel x86 | HP Mini 1020-LA Netbook (old)
Lazarus 2.0.2 Stable - FPC 3.0.2 - Windows | Lenovo IdeaPad Y

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: TTreeListView
« Reply #7 on: March 05, 2011, 07:44:03 pm »
Wow, this is exactly what I needed in my project some times ago. I wrote my own similiar component for this. It has no TListView functionality. My component have only live search bar functionality (like in GNOME nautilus) similar to yours, but I am hiding non-matching nodes when writting. Can you add this "hiding" functionality (most important thing in my project)? I would like to use your component instead of my. Regards.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TTreeListView : VirtualDBTreeEx
« Reply #8 on: March 05, 2011, 08:25:16 pm »
Don't forget The VirtualDBTreeEx, which permits to use data rules for checking :
http://www.lazarus-components.org/remository/Components-with-sources/Visual-Components/Trees/TVirtualDBTreeEx/

Dosen't VirtualDBTreeEx depend on VirtualTreeView? Is VirtualDBTreeEx now compatible with the latest version of VirtualTreeView because last time I tried to install VirtualDBTreeEx, it didn't work.

TTreeListView is another excellent component for Lazarus. Well done. Keep them coming....
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TTreeListView
« Reply #9 on: March 05, 2011, 08:29:38 pm »
Not really aware, but I kind of expected it, because qt is said to not allow to bypass  the paint event.
I will fix this bug, if I ever manage to compile the qt-LCL.

Qt passes paint events, but my wild guess is that you are doing some paints outside of paintevent, so it won't work on carbon too.

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TTreeListView
« Reply #10 on: March 05, 2011, 08:53:30 pm »
Yes, just tested your component, and that's it: you are using painting outside of paint event so it cannot work with qt and carbon (it works but it's ugly).

BeniBela

  • Hero Member
  • *****
  • Posts: 908
    • homepage
Re: TTreeListView
« Reply #11 on: March 05, 2011, 09:18:53 pm »
you mean if this is possible in runtime mode?
???
I meant that you can put (e.g.) a panel as placeholder on the form and then create the treelistview like view:=ttreelistview.create(panel); view.align:=alClient;


Wow, this is exactly what I needed in my project some times ago. I wrote my own similiar component for this. It has no TListView functionality. My component have only live search bar functionality (like in GNOME nautilus) similar to yours, but I am hiding non-matching nodes when writting. Can you add this "hiding" functionality (most important thing in my project)? I would like to use your component instead of my. Regards.
I will think about it.

Qt passes paint events, but my wild guess is that you are doing some paints outside of paintevent, so it won't work on carbon too.
As I said, the treelistview bypasses the paint event.
On Windows direct drawing was always faster than waiting for paint messages

BeniBela

  • Hero Member
  • *****
  • Posts: 908
    • homepage
Re: TTreeListView
« Reply #12 on: March 06, 2011, 02:03:51 am »
Okay, I added a workaround for qt and the drawing works there.

But it removes all optimizations; does anyone know, how to disable the background erasing with the qt interface?

AmatCoder

  • Jr. Member
  • **
  • Posts: 57
    • My site
Re: TTreeListView
« Reply #13 on: March 06, 2011, 06:17:57 am »
Okay, I added a workaround for qt and the drawing works there.

I'm glad to heard that. Thanks!

Quote
But it removes all optimizations;does anyone know, how to disable the background erasing with the qt interface?

Probably Zeljko knows somehow...

Regards.

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TTreeListView
« Reply #14 on: March 06, 2011, 04:03:36 pm »
Okay, I added a workaround for qt and the drawing works there.

But it removes all optimizations; does anyone know, how to disable the background erasing with the qt interface?

Qt::WA_NoSystemBackground or Qt::WA_OpaquePaintEvent attributes on TTreeListView handle (viewport) should be used in that case.


 

TinyPortal © 2005-2018