BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-18-2009, 05:53 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.