Sign in Join

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

Mailing lists / lazarus / 2010-07

TreeView with columns

25 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

Hi

If I want to use columns in a TreeView, what alternatives I have? Is there any such component used in Lazarus project itself?

I have used VirtualTreeView myself and it supports columns.

Juha

Reply by email

Noli Sicad
to Juha Manninen

Juha,

Then why don't you use VitualTreeView in Lazarus? It is supported in Lazarus. I just install it the other day.

Get it here, Install the latest version. 4.8.6
http://sourceforge.net/projects/lazarus-ccr/files/

It needs the lclextensions0.30

Download lclextensions0.30 here
http://code.google.com/p/luipack/downloads/list

Noli

Juha Manninen wrote 15 lines
Hi If I want to use columns in a TreeView, what alternatives I have? Is there any such component used in Lazarus project itself? I have used VirtualTreeView myself and it supports columns. Juha -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Vincent Snijders
to Juha Manninen: Actually I would need it for the Lazarus code itself, for converter configuration.…

2010/7/13 Juha Manninen :

Show quoted text 8 lines
Noli Sicad wrote: > Then why don't you use VitualTreeView in Lazarus? It is supported in > Lazarus. I just install it the other day. Actually I would need it for the Lazarus code itself, for converter configuration. VirtualTreeView is not very big but it adds some more kilobytes to Lazarus code. I hope it is OK for other developers.

I don't mind the extra bytes in the executable, but I fear the amount of extra source code in the Lazarus svn tree. People might think that VirtualTreeView is maintained as part of the Lazarus sources too.

Vincent

Reply by email

Luiz Americo Pereira Camara
to Juha Manninen: Now I remember, last time I checked VirtualTreeView for Lazarus it had x86 assembly code…
Juha Manninen wrote
Now I remember, last time I checked VirtualTreeView for Lazarus it had x86 assembly code which is not portable obviously. Is that still the case?

Yes.

Luiz

Show quoted text 12 lines
VirtualTreeView cannot be used for Lazarus itself if it's not portable. Juha -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Luiz Americo Pereira Camara
Show quoted text 11 lines
Juha Manninen escreveu: > Now I remember, last time I checked VirtualTreeView for Lazarus it had x86 > assembly code which is not portable obviously. > Is that still the case? > Yes. Luiz > VirtualTreeView cannot be used for Lazarus itself if it's not portable.

Maybe you want to add a simple columned TreeView for package lazcontrols.

Mattias

Reply by email

Noli Sicad
to Mattias Gaertner: On Tue, 13 Jul 2010 08:35:36 -0300 Maybe you want to add a simple columned TreeView for…
> VirtualTreeView cannot be used for Lazarus itself if it's not portable.

In the Object Inspector there is inspector tab, so it is up to developer /programmer what components he use in his program.

The 3 VTV components does not have restrictions in my lazarus installation - Windows, x86 Mac OS X and x86 Linux OS.

Mattias Gaertner wrote 28 lines
On Tue, 13 Jul 2010 08:35:36 -0300 Luiz Americo Pereira Camara wrote: > Juha Manninen escreveu: > > Now I remember, last time I checked VirtualTreeView for Lazarus it had > > x86 > > assembly code which is not portable obviously. > > Is that still the case? > > > > Yes. > > Luiz > > > VirtualTreeView cannot be used for Lazarus itself if it's not portable. Maybe you want to add a simple columned TreeView for package lazcontrols. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Luiz Americo Pereira Camara
to Juha Manninen: Now the question was about the code-base of Lazarus itself, not about an application made…
Juha Manninen wrote 6 lines
Including VirtualTreeView into Lazarus code-base would make it compile on x86 architecture only and many people would be unhappy. I wouldn't be happy either if I forced such a limitation. (although I currently have only x86 machines myself.) @Luiz: is there any plan to port the code?

Yes. But there are other priorities like removing dependency of winapi specific code and improve theming.

Anyway anyone feel free to send patches (I already applied some for 64bit and carbon)

Show quoted text 5 lines
The easiest way is to make a pascal version of the code for all other architectures. If speed demands, it could be coded again in assembly for selected CPUs.

BTW: the license is not compatible with Lazarus/LCL

Luiz

Reply by email

Juha Manninen
to Noli Sicad: In the Object Inspector there is inspector tab, so it is up to developer /programmer what…
Noli Sicad wrote 5 lines
In the Object Inspector there is inspector tab, so it is up to developer /programmer what components he use in his program. The 3 VTV components does not have restrictions in my lazarus installation - Windows, x86 Mac OS X and x86 Linux OS.

Now the question was about the code-base of Lazarus itself, not about an application made by a developer / programmer using Lazarus.

Including VirtualTreeView into Lazarus code-base would make it compile on x86 architecture only and many people would be unhappy. I wouldn't be happy either if I forced such a limitation. (although I currently have only x86 machines myself.)

@Luiz: is there any plan to port the code? The easiest way is to make a pascal version of the code for all other architectures. If speed demands, it could be coded again in assembly for selected CPUs.

Juha

Reply by email

Hans-Peter Diettrich
to Juha Manninen: Actually I would need it for the Lazarus code itself, for converter configuration.…
Show quoted text 8 lines
Noli Sicad wrote: > Then why don't you use VitualTreeView in Lazarus? It is supported in > Lazarus. I just install it the other day. Actually I would need it for the Lazarus code itself, for converter configuration. VirtualTreeView is not very big but it adds some more kilobytes to Lazarus code. I hope it is OK for other developers.

When the converter is an installable package, it will burden only those users that need it.

DoDi

Reply by email

Marco van de Voort
to Vincent Snijders: 2010/7/13 Juha Manninen : I don't mind the extra bytes in the executable, but I fear the…
Vincent Snijders wrote 8 lines
> Actually I would need it for the Lazarus code itself, for converter > configuration. > VirtualTreeView is not very big but it adds some more kilobytes to Lazarus > code. I hope it is OK for other developers. I don't mind the extra bytes in the executable, but I fear the amount of extra source code in the Lazarus svn tree. People might think that VirtualTreeView is maintained as part of the Lazarus sources too.

So we kick out synedit too ? :-)

License wise it is also not possible IIRC. (MPL)

Reply by email

Mattias Gaertner
to Marco van de Voort
Show quoted text 13 lines
On Tue, Jul 13, 2010 at 12:13:48PM +0200, Vincent Snijders wrote: > > Actually I would need it for the Lazarus code itself, for converter > > configuration. > > VirtualTreeView is not very big but it adds some more kilobytes to Lazarus > > code. I hope it is OK for other developers. > > I don't mind the extra bytes in the executable, but I fear the amount > of extra source code in the Lazarus svn tree. People might think that > VirtualTreeView is maintained as part of the Lazarus sources too. So we kick out synedit too ? :-) License wise it is also not possible IIRC. (MPL)

Synedit is double licensed under GPL2.

Mattias

Reply by email

Marco van de Voort
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
> > So we kick out synedit too ? :-) > > License wise it is also not possible IIRC. (MPL) Synedit is double licensed under GPL2.

I was wrong, VST is dual licensed to LGPL even (but not with FPC exception)

Reply by email

Juha Manninen
to Hans-Peter Diettrich: When the converter is an installable package, it will burden only those users that need…

Hi

When the converter is an installable package, it will burden only those users that need it.

Now thinking of it, the converter could well be a package. Many other features are in packages, too.

The only issue may be that the converter should be easy to find for people who come from Delphi and want to quickly test Lazarus with their Delphi prog. They will not find the converter from a long package list in the package configuration window.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Hi > When the converter is an installable package, it will burden only those > users that need it.

What burden?

Show quoted text 7 lines
Now thinking of it, the converter could well be a package. Many other features are in packages, too. The only issue may be that the converter should be easy to find for people who come from Delphi and want to quickly test Lazarus with their Delphi prog. They will not find the converter from a long package list in the package configuration window.

It should be installed by default like todolist and others. What is the gain of making it a package?

Mattias

Reply by email

Juha Manninen
to Mattias Gaertner
What burden?

The burden of installing VirtualTreeView I guess.
However I will not use VirtualTreeView for Lazarus now. Later it could be done especially because the assembly code seems not to be a problem and the license is OK, too.

It should be installed by default like todolist and others. What is the gain of making it a package?

I don't see any real gain if it is installed by default, but isn't it the same thing with other packages installed by default (like ToDoList)?

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 6 lines
> What burden? The burden of installing VirtualTreeView I guess. However I will not use VirtualTreeView for Lazarus now. Later it could be done especially because the assembly code seems not to be a problem and the license is OK, too.

IMO the converter should be installed by default, because Delphians expect a converter from Lazarus. And if it is installed by default (as part of the IDE or bigIDE), then all needed things must be in the lazarus svn. And as Vincent wrote if it is in the lazarus svn it must be maintained.

I think you have several choices:
- use a grid and extend it
- use a TTreeView and extend it
- write an extension of TTreeView for lazcontrols with a simple column
- extend TTreeView for columns
- use VTV and put converter or parts of it as separate package in examples (it can not be used in bigIDE)
- use VTV and maintain it in the lazarus svn

As you are the implementor it is your choice, but I guess many users will be disappointed if the converter is no longer preinstalled.

Show quoted text 5 lines
> It should be installed by default like todolist and others. > What is the gain of making it a package? I don't see any real gain if it is installed by default, but isn't it the same thing with other packages installed by default (like ToDoList)?

The todolist was made a package because it was hardly maintained and some users said they would write a better one and would like to replace it. So far I didn't see the better one, not even a start of it. Because the same guys now talk about splitting another IDE part, I tend to disagree.

Mattias

Reply by email

Hans-Peter Diettrich
to Juha Manninen: Hi Now thinking of it, the converter could well be a package. Many other features are in…
Show quoted text 7 lines
Now thinking of it, the converter could well be a package. Many other features are in packages, too. The only issue may be that the converter should be easy to find for people who come from Delphi and want to quickly test Lazarus with their Delphi prog. They will not find the converter from a long package list in the package configuration window.

It could be added by default, or we could have various lists of installed packages (to be installed), for certain user groups.

DoDi

Reply by email

Luiz Americo Pereira Camara
Adem wrote 12 lines
On 2010-07-14 15:36, Juha Manninen wrote: Hi Juha, Yes, it makes sense to use ListView now; as VT is under development for adaption to Lazarus by Luiz. BTW, it was asked/commented in Lazarus list that VT isn't compatible with Lazarus since VT isn't licensed under LGPL. I don't think it is a valid issue, since VT is licensed under MPL and GPL; MPL makes it even more liberally licensed than LGPL.

Not that i think this is a big issue but, AFAIK, mixing licenses are not so straightforward even if is toward a more liberal.

Show quoted text 7 lines
see here for license info: http://code.google.com/p/virtual-treeview/ Luiz, I am glad that you're working on VT, but wouldn't it be better if you started off with v5.x instead of v4.8.6?

Maybe you dont know but i started more than 3 years ago: http://lazarusroad.blogspot.com/2007/02/ports-of-delphi-components.html

Aside that point, i already split the svn to prepare to merge the 5x changes. I just did not yet (and it's easy) because there are API breaking changes in 5x and this will break some code out there, including mine. Also the code is not wild tested so can be some bugs. This can lead to some confusion: the bug is from the LCL port or from 5x version changes?

The idea is: fix the remaining issues with 4.8.6 and wait for a 5x version be released in Delphi side so the merge can be more safe.

Show quoted text 15 lines
http://code.google.com/p/virtual-treeview/source/browse/#svn/trunk/Source One more thing: While 'TVirtualNode = record' was a good decision at the time, I am not sure it still is. For one thing, it makes the component too complex for casual users, and hard to maintain and/or expand. Refactoring it as 'TVirtualNode = class(TPersistent)' solves many of those problems (not least of which is the issues with TWorkerThread which becomes totally redundant) and paves the way for future expansion.

Agree. Just two points:

- The main philosophy behind the port is to keep the original code where possible. So the node handling/logic is almost identical from Delphi, i just changed parts related to painting that was impossible to implement as in the original, like the header (that uses non client area) or the painting of checkboxes (that was not working cross platform).

-This is a feature to be implemented in version 5x: http://code.google.com/p/virtual-treeview/issues/detail?id=3 . The LCL port will take advantage as soon is implemented (and released) there.

Show quoted text 37 lines
Now that you're moving VT to a new platform, wouldn't you like to consider making it properly object oriented? > Thanks for checking Adem. I added the component's maintainer Luiz as CC. > > I will not push VirtualTreeView for Lazarus code-base, at least not now, > because of some other issues. > The component is under development (removing dependency of winapi > specific code and improve theming). > And, including it in Lazarus source raises questions about its > maintenance. > > I will solve the converter UI with ListView, adding a category column > which I > planned to be a top level tree node. > > Later I can return to VirtualTreeView. I also have some components built > around it which I plan to make public. > > Juha > > > Adem wrote: >> There are only 2 routines that are x86 assembler. >> >> One is already pascalized. >> >> The other one checks whether MMX is available in that platform. >> >> As far as I know, only x86 has has MMX; so that piece of code can be >> surrounded by a compiler directive --or pascalized if checking for MMX >> is possible in native FPC. >> >> In short, VTV is already fully portable.

Reply by email

Marco van de Voort
to Luiz Americo Pereira Camara

In our previous episode, Luiz Americo Pereira Camara said:

(I seem to have failed to receive Adem's msg, so I might reply to him sometimes)

Show quoted text 5 lines
> I don't think it is a valid issue, since VT is licensed under MPL and > GPL; MPL makes it even more liberally licensed than LGPL. Not that i think this is a big issue but, AFAIK, mixing licenses are not so straightforward even if is toward a more liberal.

MPL is said to be GPL incompatible. VST is also LGPL (but without exception)

Show quoted text 5 lines
> Refactoring it as 'TVirtualNode = class(TPersistent)' solves many of > those problems (not least of which is the issues with TWorkerThread > which becomes totally redundant) and paves the way for future expansion. Agree. Just two points:

Creating classes is significantly more expensive than records, which can be mass cheaply allocated, cheaply initialized and their allocations are more tightly packed.

It would make it more troublesome for large scale users. (and yes, such things are still noticable)

-This is a feature to be implemented in version 5x: http://code.google.com/p/virtual-treeview/issues/detail?id=3 . The LCL port will take advantage as soon is implemented (and released) there.

I don't read that there? Sb suggests it, and half shoot it down, half not?

Reply by email

Adem
to Luiz Americo Pereira Camara: Not that i think this is a big issue but, AFAIK, mixing licenses are not so…
Not that i think this is a big issue but, AFAIK, mixing licenses are not so straightforward even if is toward a more liberal.

OK. We can always ask Mike about this. I am sure he wouldn't object to adding LPGL.

> I am glad that you're working on VT, but wouldn't it be better if you > started off with v5.x instead of v4.8.6? Maybe you dont know but i started more than 3 years ago: http://lazarusroad.blogspot.com/2007/02/ports-of-delphi-components.html

I have been away from Delphi for about 4 years. Hence, I didn't know.

Show quoted text 9 lines
Aside that point, i already split the svn to prepare to merge the 5x changes. I just did not yet (and it's easy) because there are API breaking changes in 5x and this will break some code out there, including mine. Also the code is not wild tested so can be some bugs. This can lead to some confusion: the bug is from the LCL port or from 5x version changes? The idea is: fix the remaining issues with 4.8.6 and wait for a 5x version be released in Delphi side so the merge can be more safe.

API changes, radical ones at that, are bound to happen --especially if TObject-ifying is on the cards.

Maybe a better idea is to have 2 different branches; one for v4.x and another one for v5.x --and rename the v5.x component something else so that both can be present simultaneously (which is what I did, for my own internal use at the time).

Show quoted text 15 lines
> Refactoring it as 'TVirtualNode = class(TPersistent)' solves many of > those problems (not least of which is the issues with TWorkerThread > which becomes totally redundant) and paves the way for future expansion. Agree. Just two points: - The main philosophy behind the port is to keep the original code where possible. So the node handling/logic is almost identical from Delphi, i just changed parts related to painting that was impossible to implement as in the original, like the header (that uses non client area) or the painting of checkboxes (that was not working cross platform). -This is a feature to be implemented in version 5x: http://code.google.com/p/virtual-treeview/issues/detail?id=3 . The LCL port will take advantage as soon is implemented (and released) there.

I have code lying around here from 2007 (v4.3.1) when I refactored VT to use TVirtualNode = class(TPersistent); and everything else was also modified to be class/object based (as opposed to pointers/records). I also converted the Advanced Demo to run with it.

The only thing that needed to be done was to further refactor the code so that each TVirtualNode handles its own painting --rather than having the main tree do it, as it is currently done in the calssical VT. That would make deriving new node classes much more easy.

But, as you must have guessed, objectifying VT is a radical departure from the classical VT in that code using it will need re-examining.

Can't promise, but I might check what new bug-fixes there have been so far, and incorporate them in my version.

Of course, you, or anyone else is/are welcome to take a look --just drop me a line and I'll send a copy.

Cheers,

Adem

Reply by email

Adem
to Marco van de Voort: In our previous episode, Luiz Americo Pereira Camara said: (I seem to have failed to…
Marco van de Voort wrote
In our previous episode, Luiz Americo Pereira Camara said: (I seem to have failed to receive Adem's msg, so I might reply to him sometimes)

After being told off being off topic, I decided not to bother this list again; but even though my initial message on this subject was a private email, which --through nobody's fault-- wound up being replied to the list, hence I am replying to the list. Sorry.

> Not that i think this is a big issue but, AFAIK, mixing licenses are not > so straightforward even if is toward a more liberal. MPL is said to be GPL incompatible. VST is also LGPL (but without exception)

I don't agree with that. But, I have no intention of starting an endless discussion on it either.
All I'd be suggesting, at this point, is to ask Mike. I doubt if he would refuse the exception --whyever it is necessary, I have no idea.

> Agree. Just two points: Creating classes is significantly more expensive than records, which can be mass cheaply allocated, cheaply initialized and their allocations are more tightly packed.

That being so, IIRC, speed difference wasn't that significant when I did refactor VT to use pure objects.

Similarly, again IIRC, memory impact wasn't significan either --nodes were already large enough.

But, there are significant advantages --at least AFAIC: The first and most important one is the unintuitive nature of VT, as far as node addition etc. are concerned.

Secondly, deriving new node classes were major pain: You had to know and juggle far too many balls in the air. I am not saying it wasn't doable (even I have done a few myself), but for a casual developer VT is hell --IMO-- to use for different purposes.

It would make it more troublesome for large scale users. (and yes, such things are still noticable)

True.

For that, I would suggest keeping the classic version around both for speed/memory reasons and legacy code, but rename the new version something else so that they can both coexist in the same IDE.

Show quoted text 5 lines
> -This is a feature to be implemented in version 5x: > http://code.google.com/p/virtual-treeview/issues/detail?id=3 . The LCL > port will take advantage as soon is implemented (and released) there. I don't read that there? Sb suggests it, and half shoot it down, half not?

AFAIT, they are at the initial stages of discussions --but, I haven't read any more than that link either.

Cheers,

Adem

Reply by email