01-18-2010 08:50 AM
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)?
01-18-2010 08:59 AM
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
01-19-2010 04:02 AM
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,
01-20-2010 02:10 AM
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.
01-20-2010 04:36 AM - edited 01-20-2010 04:37 AM
I think this link will be pretty useful to you and may give solution for you