I am attempting to create a view in TVirtualStringTree
which will be similar to something like this:
In the above example I have shown some of the possible scenarios I want to reach. FolderA has bold text and after that red-colored unbolded text just behind it in the same node. I am looking for way to make this sort of output.
However, if this is too hard or too problematic to create, I would be happy with FolderB or FolderC type of output - which could probably be made with 2 columns, one containing the folder name and another containing the count of files inside.
FolderD is here just as example of a folder with no files and the output for that folder (text is unbolded and there is no number).
I am looking for any directions how to make this effect as it seems that VirtualTreeView can only have single color or bold setting per one node. Any tips or suggestions how to move in the direction of FolderA or FolderB or FolderC highly appreciated so I have a starting point. Delphi or C++ Builder examples are both welcome (the final code will be in C++ Builder though).
OnMeasureTextWidth
event to provide the overall text width and render both texts in theOnDrawText
event handler. But I would personally use 2 columns, which would allow the users to always see the count. – ExemplificationtoShowStaticText
does exactly that. It is unfortunate I can only accept only one answer as both of your answers are good solutions. – Kentigadon't see anyhow
more complicated handling theOnPaintText
and switching onColumn
in case of two columns. – Exemplification