LWUIT源代码分析之浅析TextFiled(2)
setFG(g, ta);
// display ******** if it is a password field
String displayText = getTextFieldString(ta);
Style style = ta.getStyle();
int x = 0;
int cursorCharPosition = ta.getCursorPosition();
Font f = ta.getStyle().getFont();
int cursorX = 0;
int xPos = 0;
int align = ta.getAbsoluteAlignment();
int displayX = 0;
String inputMode = ta.getInputMode();
int inputModeWidth = f.stringWidth(inputMode);
// QWERTY devices don’t quite have an input mode hide it also when we have a VK
if(ta.isQwertyInput() || Display.getInstance().isVirtualKeyboardShowing()) {
inputMode = “”;
inputModeWidth = 0;
}
// there is currently no support for CENTER aligned text fields
if (align == Component.LEFT) {
if (cursorCharPosition > 0) {
xPos = f.stringWidth(displayText.substring(0, cursorCharPosition));
cursorX = ta.getX() + style.getPadding(ta.isRTL(), Component.LEFT) + xPos;
// no point in showing the input mode when there is only one input mode…
相关新闻>>
- 发表评论
-
- 最新评论 更多>>