BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-17-2008, 03:44 AM   #1
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default ListField itemīs text exceed width

Please Login to Remove!

How can I implement a tooltip when one of the itemīs text exceed the width of the screen?

Another solution could be a single item take 2 rows.

Any idea?

Thanks.
Offline  
Old 10-17-2008, 03:52 AM   #2
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

This i prefer(there may be better than this) get the item before adding it in listfield and check out its length with screenwidth .if that exceeds
just do string manipulation and add those two item in the listfield...
Offline  
Old 10-17-2008, 04:12 AM   #3
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

Quote:
Originally Posted by sunnan View Post
This i prefer(there may be better than this) get the item before adding it in listfield and check out its length with screenwidth .if that exceeds
just do string manipulation and add those two item in the listfield...
But if I check the string length and then I have to split it in two items would be wrong, because the user could select two items when really it's just one.

Thanks for your answer, but I need another solution.
Offline  
Old 10-17-2008, 04:34 AM   #4
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

Code:
XYRect xy = g.getClippingRect();      drawFocus(g,true);                                                                                        drawHighlightRegion(g,Field.HIGHLIGHT_FOCUS,true,xy.x,xy.y,xy.width,xy.height+16);                
       invalidate();
       super.paint(g);
for the required item in listfield,overridden the paint method in your listfield by the above code. you can extent the height of your focus for that particular item....

Last edited by sunnan; 10-17-2008 at 05:08 AM.. Reason: missed adding "XYRect xy = g.getClippingRect();" in above code
Offline  
Old 10-17-2008, 05:58 AM   #5
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

I'm sorry, but I think there's a better solution.

Thanks.
Offline  
Old 10-17-2008, 06:10 AM   #6
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

Quote:
Originally Posted by sickned View Post
I'm sorry, but I think there's a better solution.

Thanks.
you are welcome to share it
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 10-17-2008, 06:27 AM   #7
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

Quote:
Originally Posted by simon.hain View Post
you are welcome to share it
Sorry for my english. I wanted to say that I think that better solution is posible, but I dont know it.
Offline  
Old 10-20-2008, 04:28 AM   #8
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

Any help, please?
Offline  
Old 10-21-2008, 05:16 AM   #9
sunnan
Thumbs Must Hurt
 
Join Date: Nov 2007
Model: 8100
PIN: N/A
Carrier: vodafone
Posts: 61
Default

The BlackBerry API does not have method for tooltips. To accomplish this you could override the draw drawFocus method of the Field class and draw your tool tips using the Graphics object passed into this method.
Offline  
Old 10-21-2008, 07:03 PM   #10
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

...and my next comment is "where are you going to paint the tool-tip if the width of the text already exceeds the width of the display"?
Offline  
Old 11-12-2008, 07:51 AM   #11
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

Any help, please?
Offline  
Old 11-12-2008, 10:45 AM   #12
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

you can use drawtext to paint several lines of text in your listfield. use setheight accordingly.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 11-12-2008, 11:42 AM   #13
sickned
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: Unknow
Posts: 42
Default

Thanks everyone for your answers.

Finally, I've implemented a tooltip inside the ListField (well, ColorListField).

If anybody wants the sample code, just write me.

Regards.
Offline  
Old 11-13-2008, 06:02 AM   #14
gsk_56
New Member
 
Join Date: Nov 2008
Model: 8010T
PIN: N/A
Carrier: Blackberry 8010
Posts: 4
Default

Hi sickned,

Please send your sample code for implementing tooltip.

Advanced Thanks.

Regards
Sunil.G
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage V-Mac Industries Inc. Pipe Threader Vosper Drophead Threader - READ picture

Vintage V-Mac Industries Inc. Pipe Threader Vosper Drophead Threader - READ

$199.00



Vintage MAC Knife Japan 4.75

Vintage MAC Knife Japan 4.75" Folding Lock Blade Knife Chef Pocket Knife Utility

$224.99



Vintage Mac Warehouse  3.5” Floppy Disk Solar Powered Calculator Company Swag picture

Vintage Mac Warehouse 3.5” Floppy Disk Solar Powered Calculator Company Swag

$66.60



Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower picture

Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower

$64.99



Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver  picture

Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver

$50.00



Vintage VTG A. W. Mack 122387 Large Industrial Fuse Puller 100 Amp - 600 Amp picture

Vintage VTG A. W. Mack 122387 Large Industrial Fuse Puller 100 Amp - 600 Amp

$104.99







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