Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

EditField curserPosition Problem

I have a editField. In this editfield i have small icon i.e.searchImage and a text. I have drawn this using drawText and  drawBitmap. So now my curserpostion is on searchImage.I want curserPosition after text that i have drawn after drawText. How to do this?

Developer
Posts: 78
Registered: ‎05-17-2012
My Device: 9900 - OS 7.0 Torch device
My Carrier: Reliance

Re: EditField curserPosition Problem

Hi
Edit field does not have the option to take the image as well text. EditField always takes text as input. In your case, there might be a horizantal manager to which image(Browserfield/buttonfield) and editifield are added. If so, There would be sublayout in which you set the extension inpositionchild. In your case, In sublayout both image and editfield might start at same position
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: EditField curserPosition Problem

I am not taking image as input. i am drawing it using paint(). I just want to set cursor position.
Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: EditField curserPosition Problem

Can anyone plz help?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: EditField curserPosition Problem

If you attempt to override paint on an EditField you will get yourself in trouble.  It is s heavily optimized input Field that tries to cope with input form the user, wrapping, relayout, selection, focus highlighting and the like.  If you start overriding paint you will have to recode all of this yourself. 

 

Can you describe what you are trying to achieve.  Describe this in words as though you were describing it to someone who didn't know how to program.  We will give you an opinion as to whether you can actually do what you are trying....