Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: C++ Builder 5.0 Listview - using more modern versions


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Feb 24, 2017 11:13 AM Last Post By: Remy Lebeau (Te...
Andy Stobirski

Posts: 18
Registered: 6/12/16
C++ Builder 5.0 Listview - using more modern versions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 5:44 AM
Hi All

Question about using the Listview in Borland C++ Builder 5.0. As it currently stands, it doesn't offer more modern features like grouping.

Is there any way of using a more modern version of the Listview within BCB5? Any hints or tips would be greatly appreciated.

Cheers Andy
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: C++ Builder 5.0 Listview - using more modern versions
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 5:52 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy Stobirski wrote:
Hi All

Question about using the Listview in Borland C++ Builder 5.0. As it currently stands, it doesn't offer more modern features like grouping.

Is there any way of using a more modern version of the Listview within BCB5? Any hints or tips would be greatly appreciated.

Cheers Andy

The only way I can think of is that you create a new component, derived from TListView, and that you add the necessary Windows API nuts and bolts needed for these newer features. After all, TListView is basically just a warpper around the LISTVIEW control of Windows.

I have done some overriding of controls this way (like the THeaderControl, because that contains some serious glitches in the 5.0 VCL), but haven't messed with TListView.
Andy Stobirski

Posts: 18
Registered: 6/12/16
Re: C++ Builder 5.0 Listview - using more modern versions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 6:05 AM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Thanks for your reply Jan, it was very helpful.

I'm still feeling my way through BCB5.0 - as a final request, do you have any resources that would be get me started on creating a new component?
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: C++ Builder 5.0 Listview - using more modern versions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 7:17 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy Stobirski wrote:
Thanks for your reply Jan, it was very helpful.

I'm still feeling my way through BCB5.0 - as a final request, do you have any resources that would be get me started on creating a new component?

Unfortunately, no. The process is not really good documented. However, components are, at their core, nothing more than classes. They just come with a set of member functions that allow the VCL to do it's magic.

If you want to override something like TListView, then you are most likely just adding a couple of properties (to define the new capabilities) with their getter and setter functions, and you probably want to hook into the window proc/dispatch function to do your custom processing of the various Windows API messages and notifications you want to be handled differently. And probably CreateParams, to tell the Windows API what capabilities of the LISTVIEW class you want turned on or off.
Sean Hoffman

Posts: 126
Registered: 3/28/99
Re: C++ Builder 5.0 Listview - using more modern versions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 7:21 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy Stobirski wrote:
Thanks for your reply Jan, it was very helpful.

I'm still feeling my way through BCB5.0 - as a final request, do you have any resources that would be get me started on creating a new component?

There are a couple of Youtube videos but I'm sure they're targeted towards newer versions of C++ Builder. That being said, I don't imagine that things have changed enough.

https://www.youtube.com/watch?v=8DDhZnPAkVw
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: C++ Builder 5.0 Listview - using more modern versions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 24, 2017 11:13 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy wrote:

Question about using the Listview in Borland C++ Builder 5.0. As it
currently stands, it doesn't offer more modern features like grouping.

Support for ListView groups was added in CB/D/RADStudio 2009.

BCB5 does not support it natively, but you have full access to the Win32
API, so you can enable all modern features manually by simply manipulating
the style bits of, and sending appropriate messags to, the HWND provided
by the ListView's Handle property. For instance:

How to Use Groups in a List-View
https://msdn.microsoft.com/en-us/library/windows/desktop/hh298437.aspx

Otherwise, you will have to find a 3rd party ListView that still supports
BCB5 and natively implements what you need. Or just write your own.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02