Package ilcd
Class Control
Public Method getTextMessageExtent
static Size getTextMessageExtent(int messageIndex)
Throws:
static Size getTextMessageExtent(String name)
Throws:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
by index:
| Parameter |
Range |
Description |
| messageIndex |
0 ... max. messageIndex |
index of the message stored in the iLCD |
by name:
| Parameter |
Range |
Description |
| messageName |
ASCII chars (0x01 .. 0xFF) |
name of the message |
| Returns |
Description |
| static Size |
size of the message |
Both methods return the extent of a text message (stored in the iLCD via iLCD Manager XEJoC Manager) when drawn with the current font.
The Size return type delivers the height and width values of the message.
Note
- When addressing by messageIndex, the message offset (see Extra.setMessageOffset(int)) is taken into account.
- When addressing by messageName, the message prefix (refer to Extra.setMessageNamePrefix(String)) and suffix (refer to Extra.setMessageNameSuffix(String)) are taken into account.
- Any control characters like carriage returns and ANSI sequences are interpreted correctly if ANSI mode is enabled.
- Characters not defined in the current font table are calculated as full width spaces and this is how they are shown on the display.
- If you use a symbol font (refer to Attribute.setSymbolFontEnabled(boolean)) no horizontal or vertical spaces between the characters will be displayed, and the this method calculates its values accordingly.
- If text alignment is on (see Control.setTextAlignment(int, int, int)), the reported height and width values correspond to the setting of the alignment. However, the current cursor position is not taken into account (that means no correction of the right and bottom margin will be made in this case).
Size textMessage = Control.getTextMessageExtent(0);
int height = textMessage.getHeight();
int width = textMessage.getWidth();
Alternatively a value can be optained with a single call:
int height = Control.getTextMessageExtent(0).getHeight();
int width = Control.getTextMessageExtent(0).getWidth();
See also:
Copyright © demmel products gmbh. All rights reserved.