Does anyone know if there is any way to control the width of the columns in a UI_LISTFIELD? Or at least a way where the field name text appears all over (not the column name 😉).
And does anyone else notice that it appears differently in the preview of the programming environment and in the object choice window? The dimensions are never the same.
Without your code, I'm not sure if I understood the problem correctly, but I will try to help you the best I can, but a code snippet would be appreciated for more accurate solution. 🙂
With the UI_LISTFIELD command you can define a scrollable list for your parameters. This listfield has x, y coordinates and also width and height (and optionally other stuff as well, see here ).
The UI_LISTITEM command will help you put your parameters into the defined listfield.
The width of the individual columns cannot be defined, but if you set the listfield's width correctly, your text should be fully visible.
I'm not sure what you mean by column name in your second question. Could you be more specific?
An important thing to mention is that the preview UI is a bit different, because the page cannot be resized, meanwhile when you open the object's ui, you will see that the window is resizeable, and everything on it is mostly responsive, including the GDL page containing listfields and listitems (other GDL UIs are not, they have fixed dimensions).
Hopefully, I answered most of your questions. 🙂
His issue is clearly that the first column can't be read properly.
I have not tested it, but from the screenshot it does look like that the columns are not user resizable when the description and value header texts are empty strings.
Together with the very low overall size of the UI_LISTFIELD causes the first column to be unreadable (all params saying "test..." instead of something distinguishable).
I forgot to show the code. Its a very simple, I only have 2 columns (Drawer, Height) with no icons. So, that being so narrow I thought "I dont need use all window width for that". I used only half-window width (between 250 and 470), but in preview the second column does not appear, nor does the scroll bar. Please pay attention to height.
UI_LISTFIELD 1, 250, 85, 200, 160, 0, "", ""
FOR n = 1 to drawQtd
ui_listitem n, 1, "drawHeight"+STR(n,1,0), 0, 0, "Drawer "+STR(n,1,0)
Now we can see both columns (the widths are wrong) and scroll bar, but the height is also different.
Anyway, after a lot of attempts I understood that UI_LISTFIELD only works properly if you use all window width. Or, more than half-window at least.
Well, there is actually much more to this story!
See this comment from Péter Baksa.
The UI_LISTFIELD control has a feature that it can grow automatically with the dialog size if it's right side is beyond 444. This limit hasn't changed, so it is not possible to create a listfield with its right side between 444-480.
You might have encountered this special behavior here, unbeknownst to you.
I think it is more complex than we believe @Runa , I moved the field to left and I had the same problem.
After some tests I realized that the preview completely ignores any length over then 20 at right side. But its okay if everything is okay in the end.
But at the result, the box fitted perfectly, but still with the same column width problem. Even using the headers, you cannot resize the columns. This is very annoying.
My conclusion is that no matter what field size you try, if it is smaller than the full width of the window, you will have an error 😒