Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
This page was last modified 12:29, 5 November 2008.

TSS000675 - Retrieving text for softkey labels

From Forum Nokia Wiki



ID TSS000675 Creation date June 4, 2007
Platform S60 3rd Edition
S60 3rd Edition, FP1
Devices
Category Symbian C++ Subcategory UI, UI components, Localization


Keywords (APIs, classes, methods, functions):

Overview

Retrieving text for softkey labels

Description

The following code example demonstrates how to read label texts currently displayed in the control pane (CBA) for left, middle (if in use), and right softkeys.
A label (CEikLabel) for each softkey can be retrieved with CCoeControl::ComponentControl(). The label is the first control owned by the softkey.

Solution

    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    if( cba )
        {
        MEikButtonGroup* buttonGroup = cba->ButtonGroup();
        for( TInt pos = 0; pos < 3; pos++ )
            {
            TInt cmdId = buttonGroup->CommandId( pos );
            CCoeControl* button = buttonGroup->GroupControlById( cmdId );               
            if( button && buttonGroup->IsCommandVisible( cmdId ))
                {
                CEikLabel* label = static_cast<CEikLabel*>( button->ComponentControl(0) );
                const TDesC* txt = label->Text();
                }
            }
        }   
   
Notes:
- The above code always returns the full label text, even if a shortened version of the label is displayed on screen.
- The CEikCommandButton class provides a Label() function for this purpose. However, this class is not supported by the current implementation of CBA; CEikButtonGroupContainer::CommandButtonOrNull() always returns NULL.

Related Discussions

Thread Thread Starter Forum Replies Last Post
Help with Tab Indicators in N70 + Carbide Ui chie cosay Themes/Carbide.ui 9 2006-12-13 09:39
How to handle Ok-softkey pressed? xDaex General Symbian C++ 4 2007-08-30 08:37
AknDoubleGraphicStyleListBox sunny_singh General Symbian C++ 1 2006-01-16 06:28
launch MIDlet on series40 softkey possible? hansprueller Mobile Java General 3 2005-08-27 16:13
Displaying Unicode characters jp4symbian Symbian User Interface 35 2007-05-18 07:48

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia