Clickable header cells for ListView.

  • 5 Replies
  • 62 Views
Clickable header cells for ListView.
« on: 04 September 2019, 17:15:16 »
It would be great to have opportunity handle click on header cells. For example for sorting some data. 

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Clickable header cells for ListView.
« Reply #1 on: 04 September 2019, 20:13:51 »
I'll look into adding a signal for a click on the header soon.

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Clickable header cells for ListView.
« Reply #2 on: 07 September 2019, 11:36:36 »
I've added a HeaderClicked signal. Your callback function can have an int parameter which will contain the index of the clicked column.

Re: Clickable header cells for ListView.
« Reply #3 on: 07 September 2019, 12:32:20 »
Yes, it works perfect. Is there any way to change background color of column header on click?
I see that it possible to change text for them, so they are already separated and I think it would be good have opportunity work with columns headers as with usual widgets. 

*

texus

  • *****
  • 1463
    • View Profile
    • Texus's Blog
Re: Clickable header cells for ListView.
« Reply #4 on: 07 September 2019, 12:50:20 »
I currently don't have any plans for it. I implemented the clicking signal because I believe it is a necessity for sorting columns. Other things like different colors, showing a small arrow inside the column header or even supporting sorting in the widget itself are extras that I am at this moment not going to spend my time on. I would love to see these things supported too, but I can't do everything at the same time.

Btw, if you use ListBox or ComboBox widgets then you may want to download and rebuild TGUI again. Together with the change to ListView I also pushed another change online which had a bug that could lead to a crash when using ListBox or ComboBox. The issue has been fixed by now. It slipped through my linux test that I ran before making the code public, but luckily it was caught by my windows tests afterwards (which actually runs the exact same code as the passing linux test).

Re: Clickable header cells for ListView.
« Reply #5 on: 07 September 2019, 13:09:29 »
I currently don't have any plans for it. I implemented the clicking signal because I believe it is a necessity for sorting columns. Other things like different colors, showing a small arrow inside the column header or even supporting sorting in the widget itself are extras that I am at this moment not going to spend my time on. I would love to see these things supported too, but I can't do everything at the same time.
I understand, it's not really important things and there are enough ways around it. 

Btw, if you use ListBox or ComboBox widgets then you may want to download and rebuild TGUI again.

Yeah, thanks, I seen it.