BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-13-2008, 01:36 PM   #1 (permalink)
New Member
 
Join Date: Nov 2008
Model: 8010T
PIN: N/A
Carrier: Blackberry 8010
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to set tooltip to BitmapField?

Please Login to Remove!

Hi,

I have one bitmapfield i need to set tooltip for this. I tried this by overriding drawFocus() method in BitmapField but i dont know much about Graphics class. How i can do this please let me know if you having any sample code please send it to me. Advanced Thanks.
Offline  
Old 11-14-2008, 01:22 AM   #2 (permalink)
New Member
 
Join Date: Nov 2008
Model: 8010T
PIN: N/A
Carrier: Blackberry 8010
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please provide help i was strucked here.

Advanced Thanks.
Offline  
Old 11-14-2008, 08:43 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Did you read the API docs?

Sounds like you are in the right place. Use drawText() in the Graphics class to display the tip. You might want to do a "fill" so that the text has an opaque background.

Of course, the drawback of your strategy here is that you can only paint within the extent of the BitmapField if you use this field paint() or drawFocus() methods. If you want the tip to appear elsewhere, you'll have to override the paint() method in the field's container (Screen).
Offline  
Old 11-14-2008, 11:10 AM   #4 (permalink)
New Member
 
Join Date: Nov 2008
Model: 8010T
PIN: N/A
Carrier: Blackberry 8010
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Dougsg38p,

Thanks alot for your reply.

As per you exactly i structed at extending the size of the tooltip because i am overriding drawFocus(). As per your suggestion i will going to override paint() of MainScreen for displaying large tooltips. FYI i am using below drawFocus() now.

protected void drawFocus(Graphics graphics, boolean on)
{
XYRect xy = graphics.getClippingRect();
graphics.setColor(Color.BLACK);
graphics.drawRect(5,15,xy.width+10+2,xy.height-15+2);
graphics.setColor(Color.SILVER);
graphics.fillRect(5,15,xy.width+10,xy.height-15);
graphics.setColor(Color.BLACK);
graphics.drawText("news profiles", 5, 15);
}
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.