LWUIT源代码分析之浅析TextFiled(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:46 点击:次
if(inputModeWidth > 0 && ta.getInputModeOrder() != null && ta.getInputModeOrder().length == 1) {
inputModeWidth = 0;
}
if(ta.isEnableInputScroll()) {
if (ta.getWidth() > (f.getHeight() * 2) && cursorX >= ta.getWidth()-inputModeWidth – style.getPadding(ta.isRTL(), Component.LEFT)) {
while (x + xPos >= ta.getWidth() – inputModeWidth – style.getPadding(ta.isRTL(), Component.LEFT) * 2) {
x–;
}
}
}
}
displayX = ta.getX() + x + style.getPadding(ta.isRTL(), Component.LEFT);
} else {
x = 0;
cursorX = getTextFieldCursorX(ta);
int baseX = ta.getX() + style.getPadding(false, Component.LEFT) + inputModeWidth;
int endX = ta.getX() + ta.getWidth() – style.getPadding(false, Component.RIGHT);
if(cursorX<baseX) {
x = baseX – cursorX;
} else {
if (cursorX > endX) {
x = endX – cursorX;
}
}
displayX = ta.getX() + ta.getWidth() – style.getPadding(false, Component.RIGHT) – f.stringWidth(displayText)+x;
}
g.drawString(displayText, displayX, ta.getY() + style.getPadding(false, Component.TOP));
// no point in showing the input mode when there is only one input mode…
相关新闻>>
- 发表评论
-
- 最新评论 更多>>