Column width in the group LIST

Hi !

If you reset the column width in the LIST group, the result is:

  If ?List{PropList:GroupNo + PropList:Group,Index#} > 0  ! Column in Group
     ?List{PropList:Width,Index#} = 0
     Message(?List{PropList:Width,Index#})  ! = -1
  end

What’s the problem here? Thanks ! :slight_smile:

-1 means that the column has no size = it is hidden including its right border.

Thanks ! It’s a great idea. But if you look at the example, the practice is much worse.

  1. If the column is without a group, the code works normally:
  If ?List{PropList:GroupNo + PropList:Group,Index#} = 0  ! Column without Group
     ?List{PropList:Width,Index#} = 0
     Message(?List{PropList:Width,Index#})  ! = 0 OK !
  end
  1. There is a list with five columns in the group:
    1

Let’s make the four columns have zero width (hide the columns). The result is not very good:
2

The reason is the negative width of the hidden column.
Maybe there is another way to hide a column in the LIST ? Thanks !

An example is the real code, if possible. The image gives not all the information.

This is incorrect understanding how the RTL calculates positions and sizes inside list boxes.

I showed the code. I can clarify

?List{PropList:Width,1} = 0
?List{PropList:Width,2} = 0
?List{PropList:Width,3} = 0
?List{PropList:Width,4} = 0

I will be grateful for a proper understanding of how to hide a column in the list. :slight_smile:

Everything is dependent from the format string. The format string can have flags for columns which affect visual result of setting column’s width.

Column flags can be any. This is an RTL C11.1 problem, there is no such problem when building in C63.
There are many similar problems “Clarion by subscription”, but I have not yet found a solution for this one. :frowning:

Perhaps you could post your FORMAT() string and give folks the information they need to be of assistance.

Please provide the listbox’s format string.

OK ! I understood. Please assemble the standard Clarion example and follow the steps. Thanks !

School.zip (268,9 КБ)

The incorrect behavior really exists but there are nuances. The behavior is dependent from the font and, probably, from other window/list properties - I didn’t run the test under debugger. That’s why I asked for a real example.

Here is the test program: TEST.CLW (1.5 KB)

If the font set to Segoe UI,10, everything is OK after setting with of 4 columns to 0:

After10

If the font set to Segoe UI,9, the format string becomes wrong after setting width of columns to 0:

After9

2 Likes

Thank you. This is a lucky exception. I have your example in Win10 that looks like this (I added the font size). When building with RTL C63, there is no problem with any font. This is the C11 issue :frowning:

1

The change in the LIST implementation which is a root of the problem has been made for C7. For some reasons, the LIST code reserves the space at the right of grouped columns even if the | modifier is not present. If the program changes some LIST/column property affecting data set from the format string, the RTL rebuilds the format string and applies it to LIST. The original reason of the problem is that the extra space should not be reserved if column width is 0. The secondary one is that the code could check width that the column’s width is 0 and not deduct the extra space on rebuilding the part of the format string corresponding to particular column,

There is no a good work around for this issue, The only one is to handle the format string and set it using PROP:Format rather than use property assignments to change every single property.

There’s a simple algorithm, I recalculate the width of the group when hiding the columns.
Now the LIST is working with problems, I will try to remove the column shift through the offset…
Thanks for the discussion. :slight_smile:

I completely solved this problem by adding an offset to the column header and content.
But here, of course, there should be a “hidden” flag for the column, and not a “-1” width…
Thanks again to everyone for checking the problem and finding a solution.

I’ve always set it to 0 for hidden, not -1.

And I also set the width to “0”. But it is set to “-1”.
Check the example from the first message or the LIST format.

RTL should not shift the column to “-1”… this is of course a mistake.
Where’s Robert ? Where is C12 ? :slight_smile: