How can I avoid ellipsis in checkbox GUI?

Dear all,
I try to set the following text in checkbox in a GUI: "If the value is under 1, then the process is adiabatic. Pressure will increase due to conservation of energy"
But text is too long so it displays:
If the value is under 1, then...
I would like to avoid such ellipsis (three points: ...) and show the rest of the text in a second or several lines instead of a single line with ellipsis at the end.
If the value is under 1, then the
process is adiabatic. Pressure
will increase due to conservation
of energy
How could I do it?
Thank you.
Marc

1 commentaire

Rik
Rik le 20 Mai 2018
Not a real answer, but you might hack this by using no text for the checkbox string property and create the text with the uicontrol text option.

Connectez-vous pour commenter.

 Réponse acceptée

Jan
Jan le 20 Mai 2018
Modifié(e) : Jan le 20 Mai 2018

0 votes

Checkboxes do not accept multi-line text. But you can create a checkbox without a string, and set a multi-line text right beside it. Then you have full control over the appearance of the text.

Plus de réponses (2)

Image Analyst
Image Analyst le 20 Mai 2018
Modifié(e) : Image Analyst le 20 Mai 2018

0 votes

Are you using GUIDE or App Designer? You need to set the Max property to 2 I believe. Or create the text label with sprintf() to make the string in your code and use \n if you want it on a new line. Or just have all that be in the TooptipString and not the label itself.

2 commentaires

Marc Bingo
Marc Bingo le 20 Mai 2018
I am using guide. I tried to used sprintf but it didn't work.
Thank you.
Walter Roberson
Walter Roberson le 20 Mai 2018
This is not correct. Max makes a difference in output lines for uicontrol style text or style edit, but for uicontrol style checkbox, Max controls the Value that the uicontrol will have when the check box is active.

Connectez-vous pour commenter.

Walter Roberson
Walter Roberson le 20 Mai 2018

0 votes

If you must use a checkbox for this purpose then you have two options:
  1. instead of setting the String property with the desired text, create a image array containing the desired text rendered as an image, and set the CData property of the uicontrol style checkbox; or
  2. look over on http://undocumentedmatlab.com for information on how to use the java objects that underlie uicontrols.

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by