09-15-2011 05:10 AM
Is there a way to force vertical alignment for text of control labels?
This option is useful when "Size to text" is disabled (so a fixed size is specified), and the text can be on 1 or 2 rows. If there is only one row, it's quite common to see the text vertically centered.
09-15-2011 05:28 AM
Hi Vix,
I am not aware of an attribute that does it - but it's pretty straightforward to implement it yourself using SetCtrlAttribute (,, ATTR_LABEL_TOP,); for example, label height changes from 15 to 28 pt if a second line is added - am I correct that you're going to suggest it ? If so the new attribute could be extended to top_align, center_align, and also bottom_align ![]()
09-15-2011 06:34 AM
The label text is loaded from a text file, so I don't know if it needs one or two lines.. for this reason I chose a fixed size; and the text is automatically split into two lines (if necessary).
And you're right: I'm going to write a new suggestion ![]()
09-15-2011 06:39 AM
...but you could find out using ATTR_LABEL_WIDTH: display the text on an invisible label and measure its width, then compare it to the space reserved for the label...
09-15-2011 10:27 AM
Is this what you're looking for?
SetCtrlAttribute (panel, control, ATTR_LABEL_ANGLE, 900)
This rotates the label text 90 degrees.
09-16-2011 08:23 AM
Hi jared,
I'm not looking for a way to rotate the text 90 degrees.
I'm looking for a way to specify a vertical justification for the text inside a fixed size label area (i.e. if the label text is 14 px high, and the label area is 30 pixel high, I'm looking for a way to leave 8 px above the text and 8 px under the text).
09-19-2011 10:43 AM - edited 09-19-2011 10:44 AM
Unfortunately, vertical justification is only available for tree and table cells. You could use a single-cell table and make it look almost like a control label, however the edges won't look the same. I don't know how much of a problem that is for you.
09-20-2011 01:33 AM
Waiting for this property in a future release, the best solution is to pragmatically move the label (as Wolfgang suggested)