Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:49, 25 January 2008.

TSS000582 - How to find out the correct location for softkey labels

From Forum Nokia Wiki


Subject:

How to find out the correct location for softkey labels TSS000582

 

Platform(s): Device(s), SW version(s):
S60 3rd Edition and FP1 Nokia E70, Nokia E90, Nokia N93, Nokia N95

Category:

Symbian C++

Subcategory:

UI, UI components

Description:

Overview:
The Command Button Array (CBA) is usually located at the bottom of the screen in S60 devices. If a device supports switching between portrait and landscape orientations, the location of the CBA is not fixed (in relation to screen). While the control pane in the S60 UI is always positioned correctly, scalable applications that draw their own custom labels for softkeys should be aware of the correct location for the CBA.
Solution:
In some phones (e.g., the Nokia E70, Nokia E90, Nokia N93, Nokia N95), the softkeys will be on the right or left side of the screen when in landscape mode.
If an application needs to adjust its UI (softkey positions) based on orientation, the CBA location can be retrieved with
    AknLayoutUtils::CbaLocation();
The return value is one of the following:
    enum TAknCbaLocation
        {
        EAknCbaLocationBottom, // landscape and portrait
        EAknCbaLocationRight,  // only landscape
        EAknCbaLocationLeft    // only landscape
        };
When the CBA is located at the bottom, the positive ("OK/Options") softkey is always on the left-hand side, and the negative ("Cancel/Back") on the right-hand side.
When the CBA is on either side of the screen, most devices have the positive softkey at bottom. As an exception, the Nokia E90 Communicator (when open) has the positive softkey on top.
There is no API for directly resolving the order of softkeys. However, the position of the softkey controls can be checked as follows:
    TBool IsOptionsButtonOnTop()
        {
        CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
        if( !cba )
            {
            return EFalse;
            }

        // Assumes that CBA has Options and Exit commands
        CCoeControl* options = cba->ControlOrNull( EAknSoftkeyOptions );
        CCoeControl* exit = cba->ControlOrNull( EAknSoftkeyExit );
 
        if( options && exit )
            {
            if( options->Position().iY < exit->Position().iY )
                {
                return ETrue;
                }
            }
        return EFalse;
        }

Creation date:

February 8, 2007

Last modified:

May 10, 2007
Related Discussions
Thread Thread Starter Forum Replies Last Post
WiFi location approach? ajr General Discussion 0 2006-10-11 17:04
Where can I get AudioClientEx sample. seshukc General Symbian C++ 0 2004-03-26 06:18
TKeyCode in in TKeyEvent amitaggarwal General Symbian C++ 13 2006-11-30 14:45
Location API cjmarsha Mobile Java General 0 2005-08-08 20:16
Layout ignored in S60 concept SDK l1n3n01z Mobile Java General 3 2004-12-29 09:04
 
Powered by MediaWiki