Alternating row colors in wxDataViewVirtualListModel

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
XMarshall
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 13, 2018 3:11 pm

Alternating row colors in wxDataViewVirtualListModel

Postby XMarshall » Tue Mar 13, 2018 3:24 pm

Hello,

I am trying to create an List View Control on the lines of the MyListModel tab in the dataview sample.
I am having the colors as in the Sample. However, I want the colors till the last column in the List View only, and not beyond that.
Currently the Sample is also showing Alternating colors beyond the last column (after we select File -> Style of Panel#2 -> Alternating colors).

Do I need to call SetColumnCount() so that the control knows how many columns are there, after building the control, and from where should I make that call?

Please refer to the attached image, I would not like to have alternating colors in the Red cross marked section.

Thanks,
Colors.jpg

User avatar
doublemax
Moderator
Moderator
Posts: 12321
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Alternating row colors in wxDataViewVirtualListModel

Postby doublemax » Tue Mar 13, 2018 4:46 pm

wxDVC has three different implementations, a generic one for Windows and native controls under OSX and GTK, so they behavior might be slightly different across platforms.

I haven't checked yet, but my first feeling tells me that what you want might not be possible.

Just out of curiosity: Why do you want to change this? For esthetic reasons or another one?
Use the source, Luke!

XMarshall
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 13, 2018 3:11 pm

Re: Alternating row colors in wxDataViewVirtualListModel

Postby XMarshall » Wed Mar 14, 2018 1:13 pm

Hello doublemax, thanks for your reply.

Currently I am targeting Windows and Linux (CentOS and Ubuntu).
I am yet to check and run my code in Linux, but normally in Windows (in MFC) we can make sure that the highlighting only extends till the last column, in a Virtual List View or otherwise. And yes, most probably its an esthetic/looking good issue.

A probable solution would be to distribute all the columns (length wise) evenly in the List View client area, so that the row color highlighting seems to last till the last column only. But, lot of extra code and calculations need to be made.
Thanks,


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 6 guests