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: 69
Registered: ‎08-25-2008
My Device: Not Specified

How to set tooltip to a image icon (Bitmap field)?

[ Edited ]

Hi for displaying image icon iam using BitmapField. I have 3 BitmapFields, i want unque tooltips for three image icons. 

 

Please give your solution for the same.  Advanced thanks.

 

Regards

Sunil.G

Message Edited by sunil_garlapati on 09-08-2008 12:46 PM
BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to set tooltip to a image icon (Bitmap field)?

The BlackBerry API set does not have a method that offers this.  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.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: How to set tooltip to a image icon (Bitmap field)?

[ Edited ]

Hi,

 

As per MSohm suggestion I have overriding the drawFocus() method in the BitmapField for creating tooltip for BitmapField.  It is diplaying tooltip but not full tooltip up to that bitmapfield width.

BitmapField bmf_temp = new BitmapField(bitmap_temp, BitmapField.FOCUSABLE) { private XYRect xyrect=new XYRect(); protected boolean navigationClick(int status, int time) { esourceFetchThread thread = new PrimaryResourceFetchThread("http://"+info.getDataUrl(), null, null, null,application_temp); if(thread.isAlive()==false) { thread.start(); } return true; } public void paint( Graphics graphics ) { graphics.setColor(Color.GRAY); graphics.drawRect(0,0,getWidth()-3,getHeight()-3); super.paint(graphics); } protected void drawFocus(Graphics graphics, boolean on)
                    {
                        System.out.println("Inside drawFocus method !!!!!!!!!!!!!!!!!!!!");
                        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);
                     }

};

 

Message Edited by sunil_garlapati on 11-14-2008 08:45 AM
Developer
Posts: 50
Registered: ‎07-17-2008
My Device: 8310

Re: How to set tooltip to a image icon (Bitmap field)?

Hi there,

 

I just saw this thread. If you haven't figured out the problem, let me know. Or else, forget my reply please.

 

William

William

EasyDialer -- Calling card dialer, Google Voice Dialer, Conference Call dialer! Relieve the pain of dialing lengthy numbers...
----------------------------------------
If you love it, please let friends know.
If you hate it, please let me know.

Developer
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

Re: How to set tooltip to a image icon (Bitmap field)?

hi,

The easy way to create a tooltip please use popup screen with setlayout method(pass width and height according to u) and setposition method and to remove border include applytheme method.

Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: How to set tooltip to a image icon (Bitmap field)?

Hi Guest,

 

Thanks for your reply,  i will try with this solution.

Contributor
Posts: 10
Registered: ‎11-28-2010
My Device: Not Specified

Re: How to set tooltip to a image icon (Bitmap field)?

please can you share the codes? or link