Problem with list control in report mode

34 views
Skip to first unread message

Fulvio Senore

unread,
Jul 12, 2022, 11:48:55 AMJul 12
to wx-users
I have a problem using Windows 10.

I have a list control in report mode and if I resize a column making it
very narrow the text in the header becomes ellipsized but it leaves some
white space at the left of the text itself. The result is that the text
is ellipsized too early. This behavior can be seen in the listctrl
sample (column 2, for example) and it looks like a wast of space.

I have checked file explorer and it does not have this problem. Maybe
the header reserves room for an icon but it would be nice to avoid this
waste of space.

I realize that this is a minor issue, but is there a way to solve this
problem?

Thanks in advance.

Fulvio Senore

Vadim Zeitlin

unread,
Jul 12, 2022, 6:15:18 PMJul 12
to wx-u...@googlegroups.com
On Tue, 12 Jul 2022 17:48:49 +0200 Fulvio Senore wrote:

FS> I have a problem using Windows 10.
FS>
FS> I have a list control in report mode and if I resize a column making it
FS> very narrow the text in the header becomes ellipsized but it leaves some
FS> white space at the left of the text itself. The result is that the text
FS> is ellipsized too early. This behavior can be seen in the listctrl
FS> sample (column 2, for example) and it looks like a wast of space.
FS>
FS> I have checked file explorer and it does not have this problem. Maybe
FS> the header reserves room for an icon but it would be nice to avoid this
FS> waste of space.
FS>
FS> I realize that this is a minor issue, but is there a way to solve this
FS> problem?

AFAIK the only solution is to not use any icons at all. If you do use
them, the native control reserves space for them, even if there no icon in
this particular column.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Fulvio Senore

unread,
Jul 13, 2022, 10:50:25 AMJul 13
to wx-u...@googlegroups.com
Thank you for your answer.

I have an icon in the first column for each row so it looks like this is
the culprit. My control shows the contents of various folders and it
mimics the appearance of File Explorer.

I looked at File Explorer: each row starts with an icon but there is not
the problem that I noticed. Even in the column with an icon the header
text is aligned with the icon and not with the following text.
Do you think that File Explorer uses a different native control or is
there a particular style /at the Windows level) for this behavior?

Fulvio

PB

unread,
Jul 13, 2022, 12:05:13 PMJul 13
to wx-users
I am probably missing something but cannot see such an issue? The left margin of the second column heading in the listctrl sample seems quite small, certainly smaller than the icon width and no bigger than the one in File Explorer?

I would also say that the header control in File Explorer uses a different style than the default native one in wxWidgets and I would not be surprised if it was owner drawn.

PB

unread,
Jul 16, 2022, 1:47:57 AMJul 16
to wx-users
Fulvio probably accidentally posted his reply directly to my e-mail (I did not know it was possible?) stating that the problem seems to be fixed in wxWidgets 3.2.


Fulvio Senore

unread,
Jul 17, 2022, 3:27:31 PMJul 17
to wx-u...@googlegroups.com
Yes, thanks for noticing it: I keep making that mistake.

Here is the original message:



Thank you for your help. I looked at your image and it did not show the
problem.

I made my tests with an older version of wxWidgets so I checked the
sample in wxWidgets 3.2.0 and the problem was gone: it looks like it was
fixed before that release.

Just building the program with 3.2.0 will solve the problem.

Fulvio Senore
Reply all
Reply to author
Forward
0 new messages