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

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?

답변 (1개)

Saurabh
Saurabh 2024년 5월 22일
편집: Saurabh 2024년 5월 22일

0 개 추천

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.

댓글 수: 7

Hi @Saurabh, I edited the original post: object type DropDown (not UiLabel) does not have WordWrap
>>Mode.WordWrap = false
Unrecognized property 'WordWrap' for class 'matlab.ui.control.DropDown'
If possible can you share the file you are working on, so that I can have a look on it.
covfefe
covfefe 2024년 5월 23일
편집: covfefe 2024년 5월 24일
Hi, I have edited the main post, you can now find the attached example. I installed 2021b and can see the same undesired behavior, so it seems to have been introduced sometime between 2019 and 2021.
I tried on Matlab online as well, which shows a similar behavior (though only truncated 1 of the DropDown, not the other).
Is there an easier way to try all Matlab releases without installing them all on my computer?
Hi @Saurabh, just checking if you were able to see the example file?
Saurabh
Saurabh 2024년 5월 31일
편집: Saurabh 2024년 5월 31일
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.
I am curious, any update?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

릴리스

R2024a

질문:

2024년 5월 21일

댓글:

2026년 1월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by