Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to show tooltips in Symbian applications

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: rathodavinash (27 Jun 2007)
Last edited: hamishwillee (25 Jul 2012)

A Tooltip is a small rectangular dialog that comes up as a help/description when you pause over a partucular control. It can either stay or dismiss in sometime.


Derive a container from CCoeControl, and in its ConstructL set the size of the rectangle of the tooltip along with the position where you want to show the tooltip.

iText->SetExtent(TPoint( 15, 15 ),iText->MinimumSize() );

iText here is a RichTextEditor.


void CTooltipContainer::Draw( const TRect& aRect ) const
{
///Make a Tooltip like rectangle
TRect iRect;
iRect = aRect;
iRect.Shrink(10,10);
CWindowGc& gc = SystemGc();
gc.SetPenColor(KRgbBlack);
gc.SetBrushColor( TLogicalRgb( TRgb(254,255,213) ) );
gc.Clear(iRect);
gc.DrawRect(iRect);
gc.SetClippingRect(iRect);
}

This tooltip can be shown depending upon a HandleKeyEventL/HandleCommandL or use a Timer to detect pause on a control and then show the tooltip.

A good tooltip example is the Active Standby screen of S60 2nd ED FP3 onwards devices, where the active standby apps display a tooltip of the app name.

The code above is simple and works as long as you always draw the tooltip topmost in the controller. You can create a floating tooltip by using a separate window, removing the coupling, see http://mikie.iki.fi/symbian/textbox.html .

This page was last modified on 25 July 2012, at 10:55.
52 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×