Feb 24, 2011 at 1:29am
a few standard externals (textbutton, tab, etc….) feature a text truncation attribute that allows the user to truncate text that does not fit in the object box. Usually the truncation options are to truncate from the right, from the left or from the middle of the word or sentence.
I love M… [truncate from the right]
I haven’t found any such feature built in the JGraphics API nor in textfield or textlayout, with the only exception of a TEXT_JUSTIFICATION_USEELLIPSIS flag which just allows truncation from the right.
I am wondering if there are other techniques or other not documented flags that allow to easily implement the above mentioned behavior.
Thank you for any help.
Feb 24, 2011 at 2:09am
TEXT_JUSTIFICATION_USEELLIPSIS is the only one available. textbutton and tab have custom hand made truncation (just a few text measurement and string manipulation).
Feb 24, 2011 at 11:24am
Ah, I see…
Would it be possible to post a brief code snippet to show how it’s done?
Feb 24, 2011 at 5:26pm
AFAIR it’s just something which uses
getyourtext() just insert the … in the middle or at then end depending on the mode.
You must be logged in to reply to this topic.