2020r1 Listbox HeaderHeight

It appears that 2020r1 has changed the height of Listbox headers. In 2019r3.2 they were 15px and now they are 22px. It looks like the new size matches modern macOS better, but my app now needs its layout adjusted. Is there a way to alter the HeaderHeight? It appears to be a read only Property.

No, HeaderHeight always has been a constant.

well if you look to this link here you will see one reason why I guess.

So the font size seems to change the header height automaticly.

Very good. Hadn’t known that.

You’re not alone…

Well there are new events to paint the header which is a BIG improvement over 2019rx.x

So at last I can (and have) put images in the my header, instead of just text. And it has a background colour (not possible before).

So a plus for 2010r1, AFAIAC.

It would be great to add the individual row height to the listbox.

1 Like

Unfortunately though, the border between the header and content is still out of our control.

Sure it was possible before. Here is my object-oriented ListBox done with 2018 R3 (I wrote a tutorial “Best programming practises: the ListBox” and a series of articles in xDev about it). All is done in one ListBox, and putting pictures into the header is trivial if you use an object-oriented design.

Normal:

!

Hierarchical:

With QRcodes:

And just to prove it:

I just had to draw the picture and move the text, so go from

g.Bold = True 
g.DrawString TextToDraw, 10, g.TextAscent + (g.Height - g.TextHeight) \ 2

to

g.DrawPicture( StarfleetAcademyLogo128x128,  5, 5, g.height-10, g.Height-10,  0, 0, 128, 128 )
g.Bold = True 
g.DrawString TextToDraw, g.height + 10, g.TextAscent + (g.Height - g.TextHeight) \ 2

With Starfleet Logo

Not with my object-oriented Listbox :wink:

Thanks everyone. Lots of good info here.

I did subscribe to xDev about then but never received any information back. Is this listbox available somewhere?

The Listbox articles (“From Ooops to OOP with the ListBox”) were in the last 3 issues, part 4 is in the next one, and there is one more coming (maybe two), and the source code for each stage can be downloaded from the xDev site. I might publish it as a separate booklet with source code too …

1 Like

If you send me your email in a pm I can ask Marc Zeedar (editor) to contact you.

And of course make sure you’ve checked your spam folder …

I bet that is because you are using the first row of the listbox and just always painting the header there regardless of what may be in the actual cell when scrolling… have done that myself.

-Karen

Yes, I use the first row, but no, nothing quite as advanced. After all, my target audience is beginners so I like to keep it simple and easy to follow and modify :wink:.

And actually I just changed it a bit and moved the header to it’s own ListBox so that the header can be of a different size compared to the normal rows, and also made the text sizes adapt automatically as the row height gets changed from the slider:

It’s all easy to do, it’s just knowing how.

That’s the kind of tutorials that Xojo is missing badly in my opinion, and in this particular case it is also used to introduce the concepts of interfaces and casting so that anyone can understand them … and just for fun use Ryan Gosling’s trousers as a prop :scream:.

1 Like

will your ListBox do individual row height as well ?

Since it is a subclass of Xojo’s Listbox, this is not possible.