Lazarus
Announcements => Third party => Topic started by: BeniBela on March 05, 2011, 01:54:11 am
-
The TTreeListView (http://benibela.de/components_en.html#treelistview) 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.
-
It's nice!!. I can't wait to test it :D
/BlueIcaro
-
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.
-
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... :(
-
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/
-
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)
-
Nop, i have the stable release (0.9.28.2 beta), and you mean if this is possible in runtime mode?
-
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.
-
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....
-
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.
-
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).
-
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
-
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?
-
Okay, I added a workaround for qt and the drawing works there.
I'm glad to heard that. Thanks!
But it removes all optimizations;does anyone know, how to disable the background erasing with the qt interface?
Probably Zeljko knows somehow...
Regards.
-
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.
-
Qt::WA_NoSystemBackground or Qt::WA_OpaquePaintEvent attributes on TTreeListView handle (viewport) should be used in that case.
Thanks, now it works.
But the mouse wheel doesn't %)
-
I have been testing your component with last changes and Lazarus SVN updated, and now Qt is working fine.
I wanted to thank you for the effort... Really it's appreciated. :)
-
I have downloaded on Feb 26.
Do I have to download again to get the latest one ?
-
Qt::WA_NoSystemBackground or Qt::WA_OpaquePaintEvent attributes on TTreeListView handle (viewport) should be used in that case.
Thanks, now it works.
But the mouse wheel doesn't %)
What do you mean by "mouse wheel doesn't work" ?
What's your qt version ? What's lazarus revision ?
-
Do I have to download again to get the latest one ?
Only if you want to use it with qt widgetset. (3f4040b15434 is the latest version)
What do you mean by "mouse wheel doesn't work" ?
This. (http://bugs.freepascal.org/view.php?id=18880), but you solved it already. :D
-
Is it possible to have characters in bold or different color in given rows or columns?
For example I have tree:
node1 --> recorditems
--> node2 --> recordeitems
--> node3 --> recorditems
I would like to see node1 and it's recorditems in bold and red, node2 and it's recorditems in bold and green, node3 only in black
-
There is the event OnCustomRecordItemDraw, if you set the font of sender.canvas there, the item in that row+column should be drawn with that font
-
Thanks, but how to make node1, node2 and node3 different colors. When I set sender.font.bold:=true in OnCustomRecordItemDraw, all rows are in bold. But I want ie. only rows with node1 and node2 in bold.
I have:
node1
--> node2
--> node3
--> node2
node1
-->node2
-->node2
-->node3
-->node3
EDIT:
I managed to do this:
procedure TForm1.TreeListViewCustomItemDraw(sender: TObject;
eventTyp_cdet: TCustomDrawEventTyp; item: TTreeListItem;
var defaultDraw: Boolean);
begin
if item.SubItems.Count>0 then TreeListView.Font.Bold:=True else TreeListView.Font.Bold:=False;
end;
-
I managed to do this:
So it works like you want?
Anyways it is better to use TreeListView.canvas.Font instead of TreeListView.Font
-
But canvas.font doesn't work
Yes, it works like I wanted with one exception. It changes font of headers of columns :(
-
Right, because every column can has it own font, so the font change is overwritten by the record item.
But OnCustomRecordItemDraw with canvas.font works:
procedure TExampleForm.TreeListView1CustomRecordItemDraw(sender: TObject;
eventTyp_cdet: TCustomDrawEventTyp; recordItem: TTreeListRecordItem;
var defaultDraw: Boolean);
begin
if recordItem.Parent.SubItems.Count>0 then TreeListView1.Canvas.Font.Style:=[fsBold]
else TreeListView1.Canvas.Font.Style:=[];
end;
-
Компонент очень хороший, спасибо. Но как присвоить ему уже созданную и настроенную поисковую панель searchBar?
-
you only need to call TTreeListView.CreateSearchBar and it creates its own search bar
-
Спасибо.
Я так понял, что встроенных инструментов для создания combobox или DateTimePicker в столбцах нет? DateTimePicker можно создать только в TreeListView1CustomRecordItemDraw?
-
This component should be included in Online Package Manager.. ;)
-
Да, я всё включил.
Как в ячейку поместить DateTimePicker? %)
-
This component should be included in Online Package Manager.. ;)
I never used the OPM
You could submit it there if you want
Да, я всё включил.
Как в ячейку поместить DateTimePicker? %)
There is no function for that
You could draw it in CustomRecordItemDraw or place a control on the treelistview and move it around manually
-
Спасибо.
-
@dalfy: outside of the language specfic boards please speak English or at least provide a translation done by Google translate in addition to your native tongue.