Automatic row height in list boxes, a new 4D View Pro feature!

Starting with 4D v16, you can set a different row height for each row in your list box. So with a few lines of code, you have a list box with rows that conform to the content. With this 4D v16 feature, we gave full control to the developer to precisely define the height for every single row of the list box.

With 4D v16 R5, we’ve decided to go further, and provide you with a fully automatic mode. It’s now possible to display lists in a gorgeous interface without any programming. You only need to set a few properties in the list box, and 4D does the rest for you. It’s magical, fluid, and again … not a single line of code!

When list boxes are based on arrays, the automatic row height feature allows them to automatically adapt the height of each row to its content. This is so the full text or picture can be displayed.

Columns can either be taken into account or ignored when it comes to row height calculation. Limits definition is possible with either pixels, lines or both (e.g., min: 2 lines, max 200 pixels).

Database example

List box new properties

Three new settings can be easily defined thanks to the Property List. They allow developers to define whether the list box uses the automatic row height mode as well as the minimum and maximum height that a row can be.

Code sample

These settings can also be managed by programming when dynamic interface settings are needed:

LISTBOX SET PROPERTY (*;"LB";lk auto row height;lk yes)
LISTBOX SET AUTO ROW HEIGHT (*;"LB"; lk row min height; 2; lk lines)
LISTBOX SET AUTO ROW HEIGHT (*;"LB"; lk row max height; 100; lk pixels)

To do so, the LISTBOX SET PROPERTY command has been updated to support the new lk auto row height selector. We have also create a new command, LISTBOX SET AUTO ROW HEIGHT, to set the minimum and maximum heights for a list box with an automatic row height.

Roland Lannuzel
• Product Owner & 4D Expert •After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.