Clickable header cells for ListView.

Started by Kvaz1r, 04 September 2019, 17:15:16

Kvaz1r

It would be great to have opportunity handle click on header cells. For example for sorting some data. 

texus

I'll look into adding a signal for a click on the header soon.

texus

I've added a HeaderClicked signal. Your callback function can have an int parameter which will contain the index of the clicked column.

Kvaz1r

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

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).

Kvaz1r

Quote from: texus 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.
I understand, it's not really important things and there are enough ways around it. 

Quote from: texus on 07 September 2019, 12:50:20
Btw, if you use ListBox or ComboBox widgets then you may want to download and rebuild TGUI again.

Yeah, thanks, I seen it.