Column Overflow in Listview

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
MattC
Posts: 114
Joined: Mon 16 Apr 2018, 06:17

Column Overflow in Listview

Post by MattC »

Hi,

Does anyone know if there is a way to allow column overflow in a Listview? I have a column where the contents sometimes exceed the width of the column, and there is no content on the following one. However, the contents are curtailed, never-the-less. I've been through all the Listview styles and messages, but can't seem to come up with anything that works.

Matt
User avatar
hellomike
Posts: 192
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: Column Overflow in Listview

Post by hellomike »

Hi,

While setting up details per column, in an older program I used:

Code: Select all

LVCOLUMN.fmt%=LVCFMT_FIXED_WIDTH
Such a column can't be resized by the user but when an item is wider than the cell, Windows truncates and displays an ellipses.

Hope it helps.

Mike
MattC
Posts: 114
Joined: Mon 16 Apr 2018, 06:17

Re: Column Overflow in Listview

Post by MattC »

Thanks for your reply, Mike, much appreciated. However, this is exactly opposite of what I want. I need the text to overflow into the next column if there is no text in that one, rather than be truncated.

Matt
User avatar
hellomike
Posts: 192
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: Column Overflow in Listview

Post by hellomike »

Ah, ok, I see.
My guts tell me that it's very unlikely that Windows facilitates that. I.e. only overflow if the column next to it is empty. What if the text is even longer than that? It should also overflow to the second next column, but only if that is empty too?

Anyhow, good luck with it and let us know if you find a solution or workaround please.

Regards,

Mike
MattC
Posts: 114
Joined: Mon 16 Apr 2018, 06:17

Re: Column Overflow in Listview

Post by MattC »

Hi Mike,

Thanks. The work around I've instigated isn't really a work around but a bodge.

What's actually happening is that, depending on certain settings, column 0 width is either set to a normal size ('open') or at zero ('closed'). (It's not removed.) The appropriate line has text (information to the user) that requires it to be visible whether the column is open or closed. But when the column is closed the text disappears. Therefore the overflow would be required. The bodge is that when the column is closed, the text is shifted to column 1 (or in some cased even column 2). However, although the text is normally visible, it could potentially still be clipped if the column is too narrow. Currently, it just about working. I'd rather have, at least, a proper overflow work around, rather than a bodge, though.

Matt