custom basic edit field
Please Login to Remove!
Hello All,
I am trying to customize basic edit field for editing text which is more than screen height
First I split the text in number of lines. Then in paint I drawn them. And i have set the cursor position to 0 (zero).
Below is the paitn method.
protected void paint(Graphics graphics){
try{
graphics.setColor(0x620000);
graphics.setFont(textFieldFont);
graphics.drawBitmap(0, 0, Graphics.getScreenWidth(), Graphics.getScreenHeight(), backgroundImage, 0 , 0);
int y = 5;
graphics.setColor(0x620000);
for(int i = startIndex; i < scrollIndex; i++){
graphics.drawText(vecData.elementAt(i).toString(), 2, y);
y = y + textFieldFont.getHeight() + 6;
}
super.paint(graphics);
graphics.setColor(0x620000);
graphics.setFont(textFieldFont);
}catch(Exception ex){
System.out.println("Exception in paint :: CustomTextField "+ex.toString());
}
}
statrindex and scrollindex are incremented in navigation method.
But, when I enter new charatcer it gets drawn on present text. And cursor is not visible.
I want the this to be worked same as textfield but its not working. can any one tell me how can I do this?
Thanks
__________________
Crazy for BlackBerry
|