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
bhojwanimukesh
Posts: 20
Registered: ‎07-28-2009
My Device: Not Specified

The text exceeding screen width

Hello all,

 

In my BlackBerry application there is a screen containing a list of items. I use ellipsis style of list such that when the item name exceeds the screen width the item name end with series of periods (...) this works fine. But what I want is when user highlight such item (exceeding screen width) the entire item name should be displayed.

 

Is there any simple way to do so using standard API?

 

Is there something like tool tip (E.g. in HTML we use ALT attribute)?

 

Thanks

Mukesh

 

 

Please use plain text.
Developer
simon_hain
Posts: 15,999
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: The text exceeding screen width

you have to draw the tooltip yourself. use the search force to find some samples.

good starting points would be the paint method of the screen and getFocusRect

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
bhojwanimukesh
Posts: 20
Registered: ‎07-28-2009
My Device: Not Specified

Re: The text exceeding screen width

Thanks for the reply.

 

I 'll try it out and update you.

Please use plain text.
Developer
Sakberry
Posts: 248
Registered: ‎11-23-2009
My Device: Not Specified

Re: The text exceeding screen width

You can display the text in multiple lines. So each list item that has a string longer than the width of the screen will be split into 2 lines. To do this you will have to create a class that implements ListFieldCallBack.

 

Within this class you can use the implement drawListRow() method to draw your list items. You can draw the list items using graphics.drawText(string,listindex,y,DrawStyle);

 

Then you need this class as the callback for the screen with the list using the "setCallBack()" method of your screen.

 

Hope this helps,

Saket

Please use plain text.
Developer
bhojwanimukesh
Posts: 20
Registered: ‎07-28-2009
My Device: Not Specified

Re: The text exceeding screen width

Thanks Saket.

 

Appearance wise I think in my application showing the tool tip would look better as it won't shift down the rows below to the one that exceeds screen width. However, what you suggested is also one of good way to address the problem.

 

Regards.

Please use plain text.
Developer
zany
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: The text exceeding screen width

[ Edited ]

Hi,

    I think this link will be pretty useful to you and may give solution for you

http://www.naviina.eu/wp/blackberry/390/

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please use plain text.