I have an HorizontalFieldManager with two labels inside. The left label shows a description, and the right one shows a money amount.
For me, it's more important to show the full text of the second label. Problem is that if the first label is too long, the second label will be wrapped. I want to avoid that, so text from second label always is displayed. I also need to avoid the wrapping over first label in that case, so text from that label is trimmed and filled with dots.
This is how the HorizontalFieldManager looks:

And this is what I need to get:

How should I do that?
Thanks in advance!
If you create your
LabelFieldwith theLabelField.ELLIPSISflag, it will truncate the field with.characters. I would recommend that you use a customManagersubclass (instead ofHorizontalFieldManager) to decide what the proper width of your twoLabelFieldsshould be. You can do this by asking what the proper width is of the dollar amount, given the current font.Try this example:
Note: you didn't specify whether the dollar/balance field should be a fixed width, or always just barely enough to fit the text. I assumed that it should just barely fit the text, as I think that makes for a better layout in most cases. Also, my code above uses a hardcoded
MARGINvalue for the space around all the fields. You can adjust that if you like.Results