Effacer les filtres
Effacer les filtres

App Designer: prevent string truncation (DropDown, etc..)

5 vues (au cours des 30 derniers jours)
covfefe
covfefe le 21 Mai 2024
Modifié(e) : Saurabh le 31 Mai 2024
Hi,
I have an app designed in Matlab App Designer 2018b. The same exact code ran in Matlab 2021b / 2024a / Online truncates strings with ellipsis (...) while 2018b does not.
How can I prevent truncation to happen? I want the string as-is, as the built-in truncation function seems unoptimized:
As you can see on the 2018b screenshot, the text has plenty of space to be fully displayed. Yet 2021b+ believes it needs to be truncated.
While Uilabel does have WordWrap and could potentially address this, DropDown does not:
>>Mode.WordWrap = false
Unrecognized property 'WordWrap' for class 'matlab.ui.control.DropDown'
Alternatively, is it possible to modify/overload the built-in truncation function? Where would I find this function?

Réponses (1)

Saurabh
Saurabh le 22 Mai 2024
Modifié(e) : Saurabh le 22 Mai 2024
Hi Covfefe,
I understand that while migrating the app from R2018b to R2024a, the text got clipped, which is not required.
The solution is to set the ‘Wordwrap’ property, but as you have mentioned, the 'Uilabel' does not have 'Wordwrap'. The official documentation says otherwise. I recommend trying to set this property to see if it resolves the problem.
Here is the link for official documentation that speaks about the ‘Wordwrap’ property.
I hope this was helpful.
  6 commentaires
covfefe
covfefe le 30 Mai 2024
Hi @Saurabh, just checking if you were able to see the example file?
Saurabh
Saurabh le 31 Mai 2024
Modifié(e) : Saurabh le 31 Mai 2024
Hi @covfefe, Indeed, the wordwrap functionality is not supported by the dropdown menu. I discovered a similar problem when I tested the example file you sent and I am looking if there is any workaround for this or not.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by